Page 1 of 1

Getting plugins to

Posted: Thu Jan 29, 2015 2:47 pm
by highness
Just wrote a number of custom plugins to monitor some off-the-wall stuff we have here at work.

How can I get Nagios XI to create performance graphs for those checks? Is there a module I need to use? Most of these checks are written in bash, but a couple are in perl.

Re: Getting plugins to

Posted: Thu Jan 29, 2015 2:54 pm
by slansing
So performance data actually comes from what the plugin parses, you will need to build in handling for it, you could take a look at some plugins from the nagios plugins package, than read up on performance data here:

https://nagios-plugins.org/doc/guidelines.html#AEN200

Re: Getting plugins to

Posted: Thu Jan 29, 2015 3:22 pm
by highness
slansing wrote:So performance data actually comes from what the plugin parses, you will need to build in handling for it, you could take a look at some plugins from the nagios plugins package, than read up on performance data here:

https://nagios-plugins.org/doc/guidelines.html#AEN200
I had reviewed that, and thought I was doing that... Here is a copy of the output from one of the checks:

OK - (Completed: 0.171ms) (DNS_lookup: 0.001ms) (Connect Time: 0.085ms) (SSL HandShake: 0.000ms): (302)

Or should it be more like this:

OK - Fetched: 0.171ms, DNS_lookup: 0.001ms, Connect_Time: 0.085ms, SSL_Handshake: 0.000ms, HTML 302

Re: Getting plugins to

Posted: Thu Jan 29, 2015 3:38 pm
by tmcdonald
You're missing the pipe "|" character. That is critical because it tells Nagios "Anything before this is regular output, and anything after is performance data".

The performance data needs to be formatted according to the link that slansing posted. Typically the form will be something like:

Code: Select all

'size'=12MB;20;40;
Saying that the size of whatever you are measuring is 12MB, and that a warning should be issues at 20MB and a critical at 40MB.

Re: Getting plugins to

Posted: Thu Jan 29, 2015 5:02 pm
by highness
Got it. That part was easy...

Thank you!

I initially started with two data points to graph, but quickly added two additional data points. The first two show up on the graph, but all four show up on the dials. Is there a way to make sure that the additional two show up on the graph?

Is there an easy way to nuke all the data I've tracked so far (basically reset the performance graph)?

Re: Getting plugins to

Posted: Thu Jan 29, 2015 5:05 pm
by tmcdonald
What version of XI are you running? Newer versions should handle the performance data output without needing to modify any templates, but older versions required altering a PHP template for the graph.

As for resetting the data, look in /usr/local/nagios/share/perfdata and find your host directory, then delete the RRD and XML files for that particular service in that directory.

Re: Getting plugins to

Posted: Thu Jan 29, 2015 5:27 pm
by highness
tmcdonald wrote:What version of XI are you running? Newer versions should handle the performance data output without needing to modify any templates, but older versions required altering a PHP template for the graph.
We're running Nagios XI 2014R2.3


UPDATE: Removing the .XML and RRD files resolved the problem. It's now graphing completely!

Thank you!!!

Re: Getting plugins to

Posted: Thu Jan 29, 2015 5:44 pm
by scottwilkerson
If your plugin changes the quantity of datasources the RRD will fail to update unless you delete the rrd file from
/usr/local/nagios/share/perfdata/<HOST>/<SERVICE>.rrd
and let it be re-created

Or run the following procedure
http://support.nagios.com/wiki/index.ph ... 14_Upgrade