Nagios Graph error
Re: Nagios Graph error
No change after above changes
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
Please post the output of the updated plugin so that we can see what the problem may be.
Re: Nagios Graph error
After modification
--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 "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number of Widgets'=;;;;
[root@db1 libexec]#
--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 "OK - dummy login connected|'Number of Widgets'=$metricwidgets;$warning;$critical;;"
exit $STATE_CRITICAL
fi
;;
[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number of Widgets'=;;;;
[root@db1 libexec]#
Re: Nagios Graph error
Can you upload the whole plugin? I want to run this on my system and tweak it a bit. Something isn't right and it's hard to tell what from just snippets.
Former Nagios employee
Re: Nagios Graph error
Please find the attachment
- Attachments
-
- check_oracle.txt
- (8.86 KiB) Downloaded 416 times
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios Graph error
I'm being horribly repetitive and for that I'm sorry. The problem is your code "looks" OK, but it's obviously not working. The problem is we cannot test/debug it because we don't have the Oracle environment set up to do such a thing.
Going back to the fundamentals:
Also, get rid of your 's and make it 1 word: number_of_widgets
Going back to the fundamentals:
You have to get a number after that equal sign. That is up to you to get your code working in such a way that the scalar ends up there. The fact that it's not showing up simply means your custom plugin isn't working, it has nothing to do with Nagios.nareshtis wrote:[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number of Widgets'=;;;;
Also, get rid of your 's and make it 1 word: number_of_widgets
Re: Nagios Graph error
I dont see any difference after the 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
I need to impress upon you that this is not something we can fix. I can offer pointers and such, but at the end of the day it's on you to make sure that perfdata is populated. If there is no numeric value output in the perfdata then Nagios has nothing to graph. I'll do my best... here is your (relevant) code:
Here is the output you shared:
Lastly - what performance do you want to graph? This portion of the plugin appears to only check whether a login is possible or not. Graphing requires some metric to be placed on a chart. I'm totally confused about how you plan to graph "the quantity of" "dummy login connected" over time???
Code: Select all
--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
;;
I can't make any sense of how you're getting the output you're getting. If the check returns OK then you should never make it into the logic where you've put in performance data. In addition - you used the variables exactly as I wrote them. I was creating an ambiguous sample to try to help you understand the basic layout of performance data, there was no intent for you to use those variables explicitly as they don't exist anywhere else in your code.nareshtis wrote:[root@db1 libexec]# ./check_oracle --login db1
OK - dummy login connected|'Number_of_Widgets'=;;;;
Lastly - what performance do you want to graph? This portion of the plugin appears to only check whether a login is possible or not. Graphing requires some metric to be placed on a chart. I'm totally confused about how you plan to graph "the quantity of" "dummy login connected" over time???