Getting plugins to

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Getting plugins to

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Getting plugins to

Post 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
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Getting plugins to

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Getting plugins to

Post 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.
Former Nagios employee
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Getting plugins to

Post 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)?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Getting plugins to

Post 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.
Former Nagios employee
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Re: Getting plugins to

Post 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!!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Getting plugins to

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked