Virtual server monitor:Nagios plugin
From Revolution Linux OpenSource projects
The release of Virtual server monitor (vsmon) 0.5 introduces a plugin for the well-established OpenSource monitoring software Nagios. This plugin enables to monitor disk space, memory and swap usage using the vsmon backend, with a "no configuration" philosophy.
Advantages
This plugin has several advantages over the competition. First, you don't have to specify the list of mount points to monitor. The plugin will check ALL mount points, and emit an alert if one of them is critical. Second, you don't have to specify the thresold for each mount point. The warning and critical thresold are determined automatically according to an invert logarithmic function. This means that the more capacity the mount point has, the lower the thresolds will be.
Here are some sample values for the warning and critical thresold for different disk capacities:
| Disk capacity | Warning thresold | Critical thresold |
|---|---|---|
| 10 Mb | 42,8% (4,28 Mb) | 24,7% (2,47 Mb) |
| 50 Mb | 24,0 % (12,0 Mb) | 13,3 % (6,7 Mb) |
| 100 Mb | 19,9% (19,9 Mb) | 10,9% (10,9 Mb) |
| 500 Mb | 14,0% (69,9 Mb) | 7,3% (36,4 Mb) |
| 1 Gb | 12,2% (125,2 Mb) | 6,2% (63,7 Mb) |
| 5 Gb | 9,4% (479 Mb) | 4,5% (229 Mb) |
| 10 Gb | 8,4% (863 Mb) | 3,9% (401 Mb) |
| 50 Gb | 6,7% (3,4 Gb) | 2,9% (1,4 Gb) |
| 100 Gb | 6,1% (6,1 Gb) | 2,5% (2,5 Gb) |
| 500 Gb | 5,0% (25,1 Gb) | 1,9% (9,3 Gb) |
| 1 Tb | 4,6% (47,2 Gb) | 1,6% (16,5 Gb) |
Thresolds for memory and swap monitoring are similar but a little more sensitive.
Configuration
The plugin is a python script named check_with_vsmon.py. Here's how to configure Nagios to use the plugin.
First, add an entry to checkcommands.cfg :
define command {
command_name check_with_vsmon
command_line $USER1$/contrib/check_with_vsmon.py $ARG1$ $HOSTADDRESS$
}
Then, in services.cfg, simply specify 'disk', 'swap' or 'mem' as an argument to the check_command parameter of a service definition. For instance :
define service {
[...]
check_command check_with_vsmon!disk
[...]
}
Note that the plugin requires the vsmon backend to be running on the hosts to monitor. These hosts don't need to have the Linux-VServer tools or kernel installed.
For more information about Nagios' configuration files, see Nagios' documentation.
