Nagios Graph error
Re: Nagios Graph error
Isn't that what your current plugin is meant to do? I'm a little lost on what you need. We can't outright write the script for you, but we can help if you have specific questions.
Former Nagios employee
Re: Nagios Graph error
my current plug-in/script unable to collect the pref data, i am not able to get the graphs...
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios Graph error
nareshtis wrote:[root@db1 libexec]# ./check_oracle --login db 1
OK - dummy login connected
[root@db1 libexec]#
What @tmcdonald has pointed out is your problem, your script is not outputting performance data (everything after the pipe symbol) when it's in an OK state. Nagios is not going to display performance data when the plugin is not returning any.tmcdonald wrote: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.
You need to change line 189 to be something like line 193:
Code: Select all
echo "OK - dummy login connected|Number of Widgets=$metricwidgets;$warning;$critical;;"
Code: Select all
echo "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
This is a definitive spec:
https://nagios-plugins.org/doc/guidelines.html#AEN200
I don't mean to blow my own trumpet but a lot of the information about performance data is covered in my presentation.Box293 wrote: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.
Re: Nagios Graph error
Thanks for your response...
I made above changes, but still no joy
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected
I made above changes, but still no joy
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios Graph error
Please show us the updated plugin so we can verify the changes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios Graph error
--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 "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
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 "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
Re: Nagios Graph error
It looks like you have not made any of the changes that @Box293 suggested. You will need to change this:
echo "OK - dummy login connected"
to something like this:
echo "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
obviously changing out the variables and label to something that makes sense in your environment.
echo "OK - dummy login connected"
to something like this:
echo "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
obviously changing out the variables and label to something that makes sense in your environment.
Former Nagios employee
Re: Nagios Graph error
Output after making above changes ...
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number of Widgets'=;;;;
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number of Widgets'=;;;;
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
This still won't graph anything. At a minimum you will need a scalar to go with the "thing" (in your case "Number of Widgets") that you're monitoring.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios Graph error
Try moving the line loginchk3=` echo "$loginchk" | grep "ORA-" | head -1` further up the script so it is defined:
Code: Select all
--login)
loginchk=`sqlplus dummy/user@$2 < /dev/null`
loginchk2=` echo $loginchk | grep -c ORA-01017`
loginchk3=` echo "$loginchk" | grep "ORA-" | head -1`
if [ ${loginchk2} -eq 1 ] ; then
echo "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_OK
else
echo "CRITICAL - $loginchk3|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.