wrapped nagios plugin to enable performance data

In the nagios world, PNP4Nagios is an useful tool for collecting measures and drawing a graphic, e.g. to show the use of a monitored resource.
A plugin for PNP4Nagios is useful if it’s able to write some performance data.

So, the plugin output should be something like

PING OK – Packet loss = 0%, RTA = 0.26 ms|’ping reply time’=26ms

instead of

PING OK – Packet loss = 0%, RTA = 0.26 ms

If Your plugin does’n write performance data, You can put a simple shell scritp between nagios and the plugin with a small modification of Your nagios config.

  1. /etc/nagios/commands.cfg

    define command{
    command_name wrapped_ping
    command_line /usr/lib/nagios/plugins/wrapped_ping $HOSTADDRESS$ $ARG1$ $ARG2$
    }

  2. /etc/nagios/services.cfg

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

    host_name intranet
    service_description PING
    is_volatile 0
    check_period 24×7
    max_check_attempts 3
    normal_check_interval 5
    retry_check_interval 1
    contact_groups admins
    notification_interval 120
    notification_period 24×7
    notification_options w,u,c,r
    check_command wrapped_ping!100.0,20%!500.0,60%
    }

  3. /etc/nagios/serviceextinfo.cfg

    define serviceextinfo {
    host_name intranet
    service_description PING
    action_url /nagios/share/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
    }

Here You can download my version of the wrapped_ping shell script I wrote.

Tags:

Leave a Reply