Using PNP4Nagios

Suppose we want to monitor the CPU load of the example-host.

Enable performance processing in service definition:

define service{
        ...
        host_name                       example-host
        service_description             CPU Load
        process_perf_data		1
        check_command                   check_nrpe!check_load
        ... 
        }                              

The performance data will be automatically created:

# tree /var/log/nagios/rrd/perfdata/

/var/log/nagios/rrd/perfdata/
|-- example-host
    |--  CPU_Load.rrd
    `--  CPU_Load.xml

Interesting config in CPU_Load.xml:

...
    <TEMPLATE>check_load</TEMPLATE>
    <NAME>load1</NAME>
    <WARN>5.000</WARN>
    <CRIT>10.000</CRIT>
... 

The TEMPLATE is auto set to the name of the check command with is “check_load” here1). You can change it to your needs.

Now we need to make sure a corresponding template file exists in the template folder /usr/share/nagios/pnp/templates. The template file is a php file, so it is check_load.php in this example.

We create check_load.php using the stock file /usr/share/nagios/pnp/templates.dist/check_load.php. We can customize it to our needs. Please see offical docs on templates customization.

1) check_nrpe is a special command and will be auto skipped
nagios/using_pnp4nagios.txt · Last modified: 2010-02-15 15:49 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0