Page 1 of 2
Nagios graphs - PNP4Nagios
Posted: Thu Oct 17, 2013 7:16 am
by reincarne
Hi there.
I'm using Nagios Core & NagiosXI, on both the Nagios creates automatically graphs for the basic checks such as Ping,CPU,DIsk space,memory & SQL queries.
But I'm wondering why it doesn't created for other checks (talking about check which outputs a number).
As I understood, each graph is built from an XML file & a RRD file, but these files are created automatically. How can I make it for other checks?
P.S, the error below is the error I get when I want to check other graphs.
Thanks.
Please check the documentation for information about the following error.
XML file "/usr/local/pnp4nagios/var/perfdata/LON-MGMT/eToroLogs_Messages_Length.xml" not found. Read FAQ online
file [line]:
application/models/data.php [300]:
Re: Nagios graphs - PNP4Nagios
Posted: Thu Oct 17, 2013 12:54 pm
by slansing
Well first of all we need to see if those checks are actually sending performance data, navigate to Home > Services > Select one of your services that is not graphing > Advanced Tab > Are there values under performance data? If so please tell us what plugin is running the check, and what the perf data values were.
Re: Nagios graphs - PNP4Nagios
Posted: Mon Oct 21, 2013 7:00 am
by reincarne
Thanks.
There are no performance data.
Maybe its because I'm monitoring the service using my own VB script? Do I need to return back to Nagios a specific value?
Re: Nagios graphs - PNP4Nagios
Posted: Mon Oct 21, 2013 1:19 pm
by abrist
Yes. Plugins must adhere to a certain formatting, specifically, the output string should contain a status string, followed by a pipe ( | ) charcter, and then proceeded by properly formatted performance data. See the following document for specifics:
https://www.nagios-plugins.org/doc/guidelines.html
Re: Nagios graphs - PNP4Nagios
Posted: Mon Oct 28, 2013 6:19 am
by reincarne
abrist wrote:Yes. Plugins must adhere to a certain formatting, specifically, the output string should contain a status string, followed by a pipe ( | ) charcter, and then proceeded by properly formatted performance data. See the following document for specifics:
https://www.nagios-plugins.org/doc/guidelines.html
WoW, it didn't help me much, this part is pretty a weakness for me.
Re: Nagios graphs - PNP4Nagios
Posted: Mon Oct 28, 2013 4:20 pm
by sreinhardt
This is not a weakness of nagios. As abrist mentioned, outputted data needs to be formatted so that it understands you would like to store and process as performance data. What issues are you having with the plugin documentation?
Re: Nagios graphs - PNP4Nagios
Posted: Wed Oct 30, 2013 2:35 am
by reincarne
sreinhardt wrote:This is not a weakness of nagios. As abrist mentioned, outputted data needs to be formatted so that it understands you would like to store and process as performance data. What issues are you having with the plugin documentation?
I meant that this is my weakness in Nagios

I just don't understand how to format it. I have a script for example (a VB script) that checks specific queue, I want to humber to be stored in graphs. I just don't know how to format it inside the VB script.
Re: Nagios graphs - PNP4Nagios
Posted: Wed Oct 30, 2013 2:56 pm
by sreinhardt
Ah my mistake!

In somewhat basic terms, you need to output all of the data, standard and perfdata, to standard out. The key for performance data is it has to be initially separated by a | character so that nagios knows to differentiate it. Additionally, each value needs to be separated by a ;;; and a space. Between each of the ; if you wish, you can put the critical and warning values also, but they are not needed. Try taking a look at the below string and see if it makes more sense.
(I didn't write all the output, just a small sample)
Code: Select all
./check_http -H google.com
Output: HTTP OK 0.093 second response, page size 569B | time=0.093s;;;0 size=569B;;;0
./check_http -H google.com -w 1 -c 5
Output: HTTP OK 0.093 second response, page size 569B | time=0.093s;1;5;0 size=569B;;;
Output: HTTP OK 0.093 second response, page size 569B | Label=Value;Warn;Crit;[min value] Label2=Value2;;;0(no warn, crit, or max, just that min must be above 0)
Re: Nagios graphs - PNP4Nagios
Posted: Thu Oct 31, 2013 8:14 am
by reincarne
sreinhardt wrote:Ah my mistake!

In somewhat basic terms, you need to output all of the data, standard and perfdata, to standard out. The key for performance data is it has to be initially separated by a | character so that nagios knows to differentiate it. Additionally, each value needs to be separated by a ;;; and a space. Between each of the ; if you wish, you can put the critical and warning values also, but they are not needed. Try taking a look at the below string and see if it makes more sense.
(I didn't write all the output, just a small sample)
Code: Select all
./check_http -H google.com
Output: HTTP OK 0.093 second response, page size 569B | time=0.093s;;;0 size=569B;;;0
./check_http -H google.com -w 1 -c 5
Output: HTTP OK 0.093 second response, page size 569B | time=0.093s;1;5;0 size=569B;;;
Output: HTTP OK 0.093 second response, page size 569B | Label=Value;Warn;Crit;[min value] Label2=Value2;;;0(no warn, crit, or max, just that min must be above 0)
I did something like this:
wscript.echo ("OK - There are " & c1 & " messages. | Current message length " & c1 & ";10000;20000;0;0")
wscript.quit(0)
Will it work? Cause it doesn't work for me. If you don't know VB, consider " & c1 &" as any number.
Re: Nagios graphs - PNP4Nagios
Posted: Thu Oct 31, 2013 10:59 am
by abrist
reincarne wrote:
I did something like this:
wscript.echo ("OK - There are " & c1 & " messages. | Current message length " & c1 & ";10000;20000;0;0")
wscript.quit(0)
Will it work? Cause it doesn't work for me. If you don't know VB, consider " & c1 &" as any number.
You are close. I would load " & c1 & " into a variable and use that variable in the output. You also need to fix the formatting of your perf data:
Code: Select all
'Message_Length'=" & yourvar";10000;20000;0;0
But I am not a vb coder, so scrutinize if you wish. The big thing is that you need a label and your value separated by an '=' symbol.