diff --git a/healthcheck/README.md b/healthcheck/README.md index b5bdfde..eef7837 100644 --- a/healthcheck/README.md +++ b/healthcheck/README.md @@ -42,6 +42,10 @@ Copy the script and the config file into the system to check: cp healthcheck.py /usr/local/bin/healthcheck.py cp healthcheck.cfg.example /usr/local/etc/healthcheck.cfg ``` +Make the script executable: +``` +chmod +x /usr/local/bin/healthcheck.py +``` Edit `/usr/local/etc/healthcheck.cfg` enabling the checks you need and configuring email settings. Run `/usr/local/bin/healthcheck.py /usr/local/etc/healthcheck.cfg` to check it is working. If needed, change the config to make a check fail and see if the notification mail is delivered. If you need to do some testing without spamming emails, run with the parameter `--dry-run`. Now copy the cron file: diff --git a/healthcheck/healthcheck.cfg.example b/healthcheck/healthcheck.cfg.example index c3543b2..a619659 100644 --- a/healthcheck/healthcheck.cfg.example +++ b/healthcheck/healthcheck.cfg.example @@ -83,7 +83,7 @@ NOTIFY_ALARM_END=TRUE [system_load_1min] # The system load average in the last minute -DISABLED=True +DISABLED=False ALARM_VALUE_MORE_THAN=1.0 COMMAND=uptime REGEXP=.*load average: (\d+[,.]\d+), \d+[,.]\d+, \d+[,.]\d+ @@ -91,7 +91,7 @@ REGEXP=.*load average: (\d+[,.]\d+), \d+[,.]\d+, \d+[,.]\d+ [system_load_5min] # The system load average in the last 5 minutes -DISABLED=True +DISABLED=False ALARM_VALUE_MORE_THAN=1.0 COMMAND=uptime REGEXP=.*load average: \d+[,.]\d+, (\d+[,.]\d+), \d+[,.]\d+ @@ -99,7 +99,7 @@ REGEXP=.*load average: \d+[,.]\d+, (\d+[,.]\d+), \d+[,.]\d+ [system_load_15min] # The system load average in the last 15 minutes -DISABLED=True +DISABLED=False ALARM_VALUE_MORE_THAN=1.0 COMMAND=uptime REGEXP=.*load average: \d+[,.]\d+, \d+[,.]\d+, (\d+[,.]\d+) @@ -144,18 +144,9 @@ REGEXP=Adapter \d: (.+) ALARM_STRING_EQUAL=off-line -[free_ram] -# Free ram in % -# Shows another approach: does all the computation in the command and picks up -# all the output (by not declaring a regexp). -DISABLED=True -COMMAND=free | grep Mem | awk '{print int($4/$2 * 100.0)}' -ALARM_VALUE_LESS_THAN=20 - - [available_ram] -# Like Free ram, but shows available instead of free. You may want to use this if you use a memcache. -DISABLED=True +# Shows available ram in %. +DISABLED=False COMMAND=free | grep Mem | awk '{print int($7/$2 * 100.0)}' ALARM_VALUE_LESS_THAN=20