Nagios graphs - PNP4Nagios
Nagios graphs - PNP4Nagios
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]:
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]:
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nagios graphs - PNP4Nagios
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
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?
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
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
https://www.nagios-plugins.org/doc/guidelines.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Nagios graphs - PNP4Nagios
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.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios graphs - PNP4Nagios
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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Nagios graphs - PNP4Nagios
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.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios graphs - PNP4Nagios
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)
(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)Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Nagios graphs - PNP4Nagios
I did something like this: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)
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
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: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.
Code: Select all
'Message_Length'=" & yourvar";10000;20000;0;0Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.