Nagios Graph error
Re: Nagios Graph error
Could you please tell me how to enable/configure the script to capture the prefdata?
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
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:
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:
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]
Code: Select all
rta=0.027000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0
Re: Nagios Graph error
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
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
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
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:
Change it to:
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
Code: Select all
if [ $metric -gt $critical]; then
echo "Crap something is broken|Number of Widgets=$metricwidgets;$warning;$critical;;"
exit 2
fi
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios Graph error
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.
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.
Re: Nagios Graph error
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
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 397 times
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
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
[root@db1 libexec]# ./check_oracle --login db 1
OK - dummy login connected
[root@db1 libexec]#
OK - dummy login connected
[root@db1 libexec]#
Re: Nagios Graph error
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
Re: Nagios Graph error
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?