Nagios Graph error

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.
nareshtis
Posts: 24
Joined: Sun Sep 27, 2015 5:29 am

Re: Nagios Graph error

Post by nareshtis »

Could you please tell me how to enable/configure the script to capture the prefdata?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graph error

Post by jdalrymple »

You indicated that this is a script that you customized?

Adding perfdata is trivial, just append to the status output of the plugin the pipe character "|" followed by the metrics in the format described in the link I sent you:

Code: Select all

'label'=value[UOM];[warn];[crit];[min];[max]
You can have multiple metrics in your perfdata, to achieve that just add a whitespace character followed by the additional metrics. An example from my ping check:

Code: Select all

rta=0.027000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0
nareshtis
Posts: 24
Joined: Sun Sep 27, 2015 5:29 am

Re: Nagios Graph error

Post by nareshtis »

Is this is what you mean to say

command[check_oracle_login]=/usr/local/nagios/libexec/check_oracle --login db1 -w 20% -c 10%

The above command is not able to collect the data :(
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graph error

Post by jdalrymple »

No, what I'm saying is that the status output of your plugin (the part that usually says something like "Everything is OK" or "CRITICAL something is wrong") needs to have perfdata appended. It uses the format I specified above.

This is part of your plugin, not part of nagios.

So if your plugin had something like:

Code: Select all

if [ $metric -gt $critical]; then
     echo "Crap something is broken"
     exit 2
fi
Change it to:

Code: Select all

if [ $metric -gt $critical]; then
     echo "Crap something is broken|Number of Widgets=$metricwidgets;$warning;$critical;;"
     exit 2
fi
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios Graph error

Post by Box293 »

I did a talk on performance data at the Nagios World Conference, you can watch it here:

https://www.youtube.com/watch?v=kqA2KcpUFg4
http://www.slideshare.net/nagiosinc/tro ... and-graphs

This might help you understand the concepts.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
nareshtis
Posts: 24
Joined: Sun Sep 27, 2015 5:29 am

Re: Nagios Graph error

Post by nareshtis »

Hi
I have modified the script as below,

--login)
loginchk=`sqlplus dummy/user@$2 < /dev/null`
loginchk2=` echo $loginchk | grep -c ORA-01017`
if [ ${loginchk2} -eq 1 ] ; then
echo "OK - dummy login connected"
exit $STATE_OK
else
loginchk3=` echo "$loginchk" | grep "ORA-" | head -1`
echo "CRITICAL - $loginchk3|Number of Widgets=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
But its didn't work , could you please tell me where do i need to modify.. I have attached my script as well
Attachments
check_oracle.txt
(8.86 KiB) Downloaded 395 times
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graph error

Post by jdalrymple »

Show me the output when you run the plugin from the command line. That is more useful (much quicker to debug) than the code itself.
nareshtis
Posts: 24
Joined: Sun Sep 27, 2015 5:29 am

Re: Nagios Graph error

Post by nareshtis »

[root@db1 libexec]# ./check_oracle --login db 1
OK - dummy login connected
[root@db1 libexec]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Graph error

Post by tmcdonald »

Sometimes in certain plugins an OK state won't return performance data, but it really should if you want your graphs not to have gaps in them. Your plugin seems to be running as intended looking at the code you gave, you just need to have the same performance data output when the check is OK that you have when it is not.
Former Nagios employee
nareshtis
Posts: 24
Joined: Sun Sep 27, 2015 5:29 am

Re: Nagios Graph error

Post by nareshtis »

Guys can anyone help me with a scrip to monitor oracle services like DB, tns and login status which will support graph plug-in as well?
Locked