Page 2 of 4

Re: Nagios Graph error

Posted: Wed Oct 07, 2015 11:25 pm
by nareshtis
Could you please tell me how to enable/configure the script to capture the prefdata?

Re: Nagios Graph error

Posted: Thu Oct 08, 2015 3:39 pm
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

Re: Nagios Graph error

Posted: Tue Oct 13, 2015 7:31 am
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 :(

Re: Nagios Graph error

Posted: Tue Oct 13, 2015 5:14 pm
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

Re: Nagios Graph error

Posted: Tue Oct 13, 2015 7:25 pm
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.

Re: Nagios Graph error

Posted: Wed Oct 14, 2015 1:22 am
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

Re: Nagios Graph error

Posted: Wed Oct 14, 2015 4:04 pm
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.

Re: Nagios Graph error

Posted: Thu Oct 15, 2015 3:28 am
by nareshtis
[root@db1 libexec]# ./check_oracle --login db 1
OK - dummy login connected
[root@db1 libexec]#

Re: Nagios Graph error

Posted: Thu Oct 15, 2015 2:54 pm
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.

Re: Nagios Graph error

Posted: Fri Oct 16, 2015 3:40 am
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?