NRPE_NT Plugins

Plugins

The plugins are DOS programs written in C/C++ especially for Pipex Communications. The nrpe_nt service calls these plug-ins and they return the following status on exit with a status string for information printed to stdout:

OK = 0;
Warning = 1;
Critical = 2;
Unknown = 3;

The plug-ins available are:

cpuload_nrpe_nt.exe

This plug-in monitors cpuload, it polls the cpu 20 times in a 5 second period and returns an average of the results.

It also returns the variance. A high variance reflects a big difference between readings, i.e. a variance of nearly 100 means the cpu it at 0% for half the time polled and 100% the rest of the time.

The plug-in only returns status results on the average of the last 5 seconds, all other information is for guideline only.

The plug-in also displays information over the last 200 polls, if it does 20 polls per check, and every check is at 5 min intervals that is the last 50 minutes. this is displayed for information purposes only.

Usage:

usage: cpuload warning threshold(%) critical threshold(%)
example: 70 90

Example configuration line in nrpe.cfg:

command[nt_cpuload]=C:\nagios_nt\nrpe_nt.0.7b-SSLupd-bin\bin\cpuload_nrpe_nt.exe 50 80

Note:  command[nt_cpuload] cannot be changed or else the check will not appear in nagios.

diskspace_nrpe_nt.exe

This plug-in monitors disk load, you can specify the drive to monitor and the warning threshold in percent used and critical threshold in percent used.

Usage:

usage: diskload drive warning threshold(%) critical threshold(%)
example: D: 77 90

Example configuration line in nrpe.cfg:

command[nt_check_disk_c]=C:\nagios\bin\diskspace_nrpe_nt.exe c: 70 90
command[nt_check_disk_d]=C:\nagios\bin\diskspace_nrpe_nt.exe d: 70 90
command[nt_check_disk_e]=C:\nagios\bin\diskspace_nrpe_nt.exe e: 70 90

eventlog_nrpe_nt.exe

This plug-in monitors the event log, the first parameter specifies the number of minutes back from the current date to check to; a value of 7200 for example will check the event log for the last 5 days.

The -s switch is optional and allows you to exclude services from influencing the results. the excluded services are listed in quotes separated by comments.

The -i switch works the same as -s but excludes an eventid.

Usage:

Optionally Specify which services to IGNORE when they generate
errors in the event log and how far back in time to look

usage: eventlog_nrpe_nt.exe -m  minutes is <"exluded service, exluded service,..."> -i <"exluded eventid, exluded eventid,..."> Do not include unnecessary white space it will not be removed
example: service_nrpe_nt.exe -m 20 -s "Messenger" -i "1000,7011"
example: service_nrpe_nt.exe -m 7200

Example configuration line in nrpe.cfg:

command[nt_eventlog]=C:\nagios\bin\eventlog_nrpe_nt.exe 7200 "Service Control Manager"

memload_nrpe_nt.exe

This plug-in monitors memory usage, it simply returns the current physical and paged memory usage in percent.

Usage:

usage: memload warning threshold(%) critical threshold(%)
example: 70 90

Example configuration line in nrpe.cfg:

command[nt_memload]=C:\nagios\bin\memload_nrpe_nt.exe 70 90

service_nrpe_nt.exe

This plug-in monitors the status of services, simply provide it with  a list of comma separated services and if any are down or in an unknown or waiting state an appropriate error and status is returned.

Usage:

usage: service_nrpe_nt.exe "service name,service name,..." Do not include unnecessary white space it will not be removed
example: service_nrpe_nt.exe "Event Log,Messenger"

Example configuration line in nrpe.cfg:

command[nt_service]=C:\nagios\bin\service_nrpe_nt.exe "Event Log,DNS Client"

Nagios Configuration

checkcommands.cfg

An example of how the commands are defined in checkcommands.cfg.

define command{
    command_name nt_check_disk_c
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_c
}

define command{
    command_name nt_check_disk_d
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_d
}

define command{
    command_name nt_check_disk_e
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_check_disk_e
}

define command{
    command_name nt_cpuload
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_cpuload
}

define command{
    command_name nt_memload
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_memload
}

define command{
    command_name nt_service
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_service
}

define command{
    command_name nt_eventlog
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c nt_eventlog
}

services.cfg

An example of the services.cfg file where host frontxp is configured to monitor nt_check_disk_c.

define service{
    use generic-service ; Name of service template to use

    host_name frontxp
    service_description NT_DISK_C
    is_volatile 0
    check_period 24x7
    max_check_attempts 3
    normal_check_interval 5
    retry_check_interval 1
    contact_groups linux-admins
    notification_interval 240
    notification_period 24x7
    notification_options c,r
    check_command nt_check_disk_c
}

Source Code and Project Files

All code is currently under CVS.


Stephen Strudwick, 27/01/2004