Skip to content

Commit

Permalink
Fix some markdownlint, yamllint + shellcheck warnings
Browse files Browse the repository at this point in the history
Fixed:

* MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
* MD034/no-bare-urls Bare URL used [Context: "https://synpro.solutions"]
* SC1091 (info): Not following: ./megacli.cfg: openBinaryFile: does not exist (No such file or directory)
* SC2086 (info): Double quote to prevent globbing and word splitting.
* SC2236 (style): Use -n instead of ! -z.

Removed ansible molecule because I was not able to install checkmkagent
in the docker enviroment. Mainly because the docker image has no systemd
enabled, see: geerlingguy/docker-debian11-ansible#4

Also, there used to be public Checkmk demo instance: https://demo.checkmk.com/demo
But it is not reachable anymore, so I have no way downloading the
checkmkagent. Decided to not put any more efforts into it.
  • Loading branch information
jkirk committed Jul 7, 2022
1 parent 009e3e3 commit b235cc0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 45 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For currently available local checks, see: [files/check-mk/local](https://github

Currently the following checkmk agent plugins are supported:

```
```yaml
checkmkagent_plugins_available: [ 'mk_ceph', 'mk_logwatch.py', 'mk_mysql' ]
```
Expand All @@ -37,7 +37,7 @@ N/A
Example Playbook
----------------

```
```yaml
- hosts: site
vars:
checkmkagent_host_url: 'http://monitor01.example.com/mysite'
Expand All @@ -59,7 +59,7 @@ Older versions of this role used the variable `checkmkagent_baseurl` instead `ch
`mk_apt` was installed in `/usr/lib/check_mk_agent/plugins/60` instead of `/usr/lib/check_mk_agent/plugins/3600`.
To delete the check on all hosts from the wrong location you could use ansible like this:

```
```console
% ansible -i hosts all -m shell -a "ls -l /usr/lib/check_mk_agent/plugins/60/mk_apt"
% ansible -i hosts all -b -m shell -a "rm /usr/lib/check_mk_agent/plugins/60/mk_apt"
% ansible -i hosts all -b -m shell -a "rmdir /usr/lib/check_mk_agent/plugins/60"
Expand All @@ -74,4 +74,4 @@ MIT
Author Information
------------------

Darshaka Pathirana - https://synpro.solutions
Darshaka Pathirana - <https://synpro.solutions>
4 changes: 3 additions & 1 deletion files/check-mk/local/check_megacli_battery
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ fi
# battery_adapter=ALL or an adapter

if [ -e "$MK_CONFDIR/megacli.cfg" ]; then
. $MK_CONFDIR/megacli.cfg
# shellcheck disable=SC1090
. "$MK_CONFDIR/megacli.cfg"
fi

# if unconfigured then default to all adapters
# shellcheck disable=SC2154
if [ -z "$battery_adapter" ] ; then
exit 0
fi
Expand Down
10 changes: 6 additions & 4 deletions files/check-mk/local/check_megacli_diskgroups
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ fi
# num_disk_groups=0

if [ -e "$MK_CONFDIR/megacli.cfg" ]; then
. $MK_CONFDIR/megacli.cfg
# shellcheck disable=SC1090
. "$MK_CONFDIR/megacli.cfg"
fi

# shellcheck disable=SC2154
if [ -z "$num_disk_groups" ]; then
exit 0
fi
Expand All @@ -38,7 +40,7 @@ for adapter in $adapters ; do
fi

if [ "$num_disk_groups_adapter" -eq 0 ] ; then
[ ! -z "$output" ] && output="${output}, "
[ -n "$output" ] && output="${output}, "
output="${output}Adapter $adapter: no disk group"
continue
else
Expand All @@ -57,7 +59,7 @@ for adapter in $adapters ; do
echo "2 ${check_name} - $STATUS on adapter $adapter [see 'megacli -CfgDsply -a$adapter -NoLog']"
exit 1
else
[ ! -z "$output" ] && output="${output}, "
[ -n "$output" ] && output="${output}, "
output="${output}Adapter $adapter: $STATUS"
fi
done
Expand All @@ -70,7 +72,7 @@ elif [ "$num_disk_groups_present" -gt "$num_disk_groups_expected" ] ; then
exit 1
fi

[ ! -z "$output" ] && output="${output}, "
[ -n "$output" ] && output="${output}, "
output="${output}$num_disk_groups_present disk group(s) found"

echo "0 ${check_name} - $output"
4 changes: 3 additions & 1 deletion files/check-mk/local/check_megacli_num_disks
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ fi
# num_disks=[number of disks to be expected]

if [ -e "$MK_CONFDIR/megacli.cfg" ]; then
. $MK_CONFDIR/megacli.cfg
# shellcheck disable=SC1090
. "$MK_CONFDIR/megacli.cfg"
fi

# shellcheck disable=SC2154
if [ -z "$num_disks" ] ; then
exit 0
fi
Expand Down
7 changes: 0 additions & 7 deletions molecule/default/converge.yml

This file was deleted.

18 changes: 0 additions & 18 deletions molecule/default/molecule.yml

This file was deleted.

10 changes: 0 additions & 10 deletions molecule/default/verify.yml

This file was deleted.

0 comments on commit b235cc0

Please sign in to comment.