Skip to content

Commit

Permalink
Updated readme, enabled by default universal checks
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin86 committed Apr 15, 2022
1 parent 780b2ac commit b93b5eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
4 changes: 4 additions & 0 deletions healthcheck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 5 additions & 14 deletions healthcheck/healthcheck.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ 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+


[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+


[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+)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b93b5eb

Please sign in to comment.