Plugins





General info

Plugins are (normally) located in the plugs-dir in apan. The location can be changed by modifying the variable PLUGSDIR in apan.defs.

The name of the plugin to associate to a service should be first argument after the command-name in the definition of the 'check_command' in the service difinition. The following arguments are used by the plugins.
For eample, this line in your service-definition;
check_command                  apan!disk!85!95
will make apan call the disk-plugin. A warning or critical status is returned from apan if the plugin returns a value above 85 or 95 percent.


Plugins

Here are descriptions of the plugins distributed with apan. For information on how to write your own plugins, look in the developemnet section in the docs.

Disk usage

There is two plugins that is used to check disk-usage; 'disk' and 'nt_disk'. The plugins is in the file 'disk'.

disk
This plugin uses nagios-statd (http://www.twoevils.org/html/files.php) to get information from the client. You should specify warning- and critical-levels in percent as the second and third argument of the 'check_command'. The argument to the plugin is a mount-point. A typical line in apan.cfg would look like;
barbar;Disk-usage;/usr/local/nagios/rrd/barbar_disk.rrd;/|/export/home;root:LINE2
home:LINE2;Disk-usage;%
Note that the DS-name cannot contain '/'!

nt_disk
This plugin uses NSClient (nsclient.ready2run.nl) to get the information from the client. The second and third argument should be warning and critical values for megabytes free. Arguments to the plugin are windows drive-letters without colon. There should be two DS per drive named <drive>-used and <drive>-free and the drawing-function should be AREA for <drive>-used and STACK for <drive>-free. This will make the graphs show a filled are in two colors divided at the actual disk-usage. Also, you should add -l 0 -b 1024 as extra command-line arguments tho the graph-function so the graphs starts from 0 and the scaling factor is set to 1024 (1 Kbyte is 1024 bytes)
Example for apan.cfg:

mailserv;Disk-usage;/usr/local/nagios/rrd/mailsrv_disk.rrd;f|g;f-used:AREA f-free:STACK g-used:AREA g-free:STACK;Disk usage;Bytes;-l 1 -b 1024



Ping round-trip time

ping
This plugin uses the Nagios-plugin 'check-ping' to measure the ping roud-trip time to a host. as argument two and three in the check-command you should specify warning and critical levels for the round-trip time (ms) and packet loss (%) as specified for the Nagios-plugin (time:packet-loss%).



Network traffic

Apan uses SNMP to measure network-traffic. Data is collected by the plugin 'snmpget', read more about it below. Apan gets the total number of packages sent and received on the network -interface, therefor you have to set up the DS in the RRD as an COUNTER. RRDTool will then do the calculation of bytes/sec for you;

rrdtool create /usr/local/nagios/rrd/server_net.rrd -s 60 DS:IN:COUNTER:300:0:U DS:OUT:COUNTER:300:U:U RRA:AVERAGE:0.5:1:50400 RRA:AVERAGE:0.5:60:43800


Load

There is two plugins for general system-load monitoring, one for UNIX and one for Windows.

load
This plugin uses the plugin check_unix_load and Nagios-statd to receive load and swap-usage from a host. The check_unix_load-plugin comes with apan and must be copied (or linked) from the libexec-dir in Apan to Nagios libexec-dir
The plugin takes two arguments, CPULOAD and SWAPUSE. To have both parameters recorded at once in the same rrd-file you can add this line to apan.cfg:

server;Load;/usr/local/nagios/rrd/server_load.rrd;CPULOAD|SWAPUSE;CPU-Load:LINE2 SWAP-Used:LINE2;Used resources;load/%;
And an rrd-file like this:

rrdtool create /usr/local/nagios/rrd/server_load.rrd -s 60 DS:CPU-Load:GAUGE:900:0:U DS:SWAP-Used:GAUGE:900:U:U RRA:AVERAGE:0.5:1:50400 RRA:AVERAGE:0.5:60:43800

nt_load
This plugin uses the plugin check_nt_load and NSClient to receive cpuload and mem-usage from a host. The check_nt_load-plugin comes with apan and must be copied from the libexec-dir in Apan to Nagios libexec-dir.
The plugin takes two arguments, CPULOAD and MEMUSE. Look at load above for more details on how to use it.



SNMP

snmpget
 This plugin receives data from a host via SNMP. it uses the Nagios-plugin 'check_snmp'. Arguments to the plugin are <community>:<oid>i. For example: server;Network;/usr/local/nagios/rrd/server_net.rrd;public:.1.3.6.1.2.1.2.2.1.10.1|public:.1.3.6.1.2.1.2.2.1.16.1;IN:LINE2 OUT:LINE2;Network throughput;Bytes/sek; This line gets the total amount of packages sent and received on a network-interface and stores the result in the Datasets OUT and IN.



SMTP-messages in MS-Exchange

nt_smtp
 This plugin uses NSClient to read the performance-counter '\SMTP Server(_Total)\\´. The plugin should be called twice with the arguments 'Messages Sent Total' and 'Messages Received Total'.
Example of apan.cfg:

server;SMTP-messages;/usr/local/nagios/rrd/server_smtp.rrd;Messages Sent Total|Messages Received Total;M-SENT:LINE2 M-RECV:LINE2;Messages;Msgs/min;;

This line gets the total number of messages sent and received by the Exchange-server and stores the result in the Datasets M-SENT and M-RECV.

Note that the message-counters is divided by 60, so the graph will show messages/minute.



Prev: Configuration Next: Howto..
Copyright © 2002 Fredrik Wänglund


Powered by:
SourceForge Logo