Services issues
Re: Services issues
Well, I just ran the same command against two other boxes. All seem fine.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Services issues
Hello,
OK, so where is the issue?
Thanks,
Imran Khan.
OK, so where is the issue?
Thanks,
Imran Khan.
Re: Services issues
We are using the same script right? From the web page you linked?
How did you copy the script? (You could have issues with dos line endings, or a missing the shabang . . . or something?)
Could you post the script as an attachment - copy the file off of the server intact and attach it here.
How did you copy the script? (You could have issues with dos line endings, or a missing the shabang . . . or something?)
Could you post the script as an attachment - copy the file off of the server intact and attach it here.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Services issues
Hello,
Yes I am using same script. Please find the script file with this thread.
Thanks,
Imran Khan.
Yes I am using same script. Please find the script file with this thread.
Thanks,
Imran Khan.
- Attachments
-
- check_snmp_time.txt
- (3.66 KiB) Downloaded 325 times
Re: Services issues
I downloaded the file you had posted check_snmp_time.sh, and it had the following 4 lines missing from the bottom of the bash script:
please attach the following to the bottom of your check_snmp_time.sh
None of the actual bash script functions would be invoked, and when I tested
your copy of the script, it would always return a zero return code.
Code: Select all
diff check_snmp_time.sh /usr/local/nagios/libexec/check_snmp_time.sh
153,157d152
<
< # The calls to the different functions.
< readargs "$@"
< checkvariables
< getandprintresults
Code: Select all
# The calls to the different functions.
readargs "$@"
checkvariables
getandprintresults
your copy of the script, it would always return a zero return code.
Re: Services issues
I have checked and confirmed that the the below 4 lines are already there on check_snmp_time.sh
# The calls to the different functions.
readargs "$@"
checkvariables
getandprintresults
Its there on the file which imran_khan attached earlier as well. Please review the text again and let us know what else can be the issue.
# The calls to the different functions.
readargs "$@"
checkvariables
getandprintresults
Its there on the file which imran_khan attached earlier as well. Please review the text again and let us know what else can be the issue.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Services issues
Hi imran_khan,
I can confirm that negate is not working as we might expect it to with your check_snmp_time.sh script, however it does seem to work as we'd expect it to with most other plugins. I did discover what seems to be a functional workaround that won't require you to rework your script. Could you try to use negate in your check with a -t value of 5 or less? Something like this:
In my lab negate itself times out and returns code 2 for the check. This might solve your issue as long as your hosts are expected to respond to an snmp query in a reasonable amount of time.
I can confirm that negate is not working as we might expect it to with your check_snmp_time.sh script, however it does seem to work as we'd expect it to with most other plugins. I did discover what seems to be a functional workaround that won't require you to rework your script. Could you try to use negate in your check with a -t value of 5 or less? Something like this:
Code: Select all
[jdalrymple@localhost ~]$ ./negate -t 5 ~/check_snmp_time.sh -H 10.10.10.1 -C public -w 30 -c 60
-
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Services issues
Hello,
Thanks for the reply.
I have tried to put –t with negate but still getting “No data returned from command” error. Please suggest me on the same.
[root@NAGIOS libexec]# ./negate -t 5 -u CRITICAL /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 3 -u CRITICAL /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 5 /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 3 /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
Thanks,
Imran Khan.
Thanks for the reply.
I have tried to put –t with negate but still getting “No data returned from command” error. Please suggest me on the same.
[root@NAGIOS libexec]# ./negate -t 5 -u CRITICAL /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 3 -u CRITICAL /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 5 /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
[root@NAGIOS libexec]# ./negate -t 3 /usr/local/nagios/libexec/check_snmp_time -H Server_IP -C Community_Name -w 30 -c 60
No data returned from command
Thanks,
Imran Khan.
Re: Services issues
Could you run this and post back the output?
Code: Select all
/usr/local/nagios/libexec/check_snmp_time -H <IP Address> -C <community> -w 30 -c 60 ; echo $?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Services issues
Hello,
Here is the output of check_snmp_time command.
[root@NAGIOS ~]# /usr/local/nagios/libexec/check_snmp_time -H IP Address -C Community -w 30 -c 60 ; echo $?
Time difference is less than 30 seconds: 0|diff=0
0
Thanks,
Imran Khan.
Here is the output of check_snmp_time command.
[root@NAGIOS ~]# /usr/local/nagios/libexec/check_snmp_time -H IP Address -C Community -w 30 -c 60 ; echo $?
Time difference is less than 30 seconds: 0|diff=0
0
Thanks,
Imran Khan.