Nagios: Return code of 7 is out of bounds
Nagios: Return code of 7 is out of bounds
Services are up and running on the remote nodes. CLI execution returns OK, but in UI it returning CRITICAL with Status Information:'Return code of 7 is out of bounds'
nagios-xxxxxxxx:~# /usr/lib/nagios/plugins/check_tcp -H hostname -p 8326 -w 5 -c 10 -t 60
TCP OK - 0.002 second response time on hostname port 8326|time=0.001642s;5.000000;10.000000;0.000000;60.000000
Can someone help me in fixing it?
Nagios log:
[1543834668] Warning: Return code of 7 for check of service 'repbiz-8891' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29304' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29312' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29326' on host was out of bounds.
[1543834671] Warning: Return code of 7 for check of service 'haproxy-08888' on host was out of bounds.
nagios-xxxxxxxx:~# /usr/lib/nagios/plugins/check_tcp -H hostname -p 8326 -w 5 -c 10 -t 60
TCP OK - 0.002 second response time on hostname port 8326|time=0.001642s;5.000000;10.000000;0.000000;60.000000
Can someone help me in fixing it?
Nagios log:
[1543834668] Warning: Return code of 7 for check of service 'repbiz-8891' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29304' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29312' on host was out of bounds.
[1543834669] Warning: Return code of 7 for check of service 'haproxy-29326' on host was out of bounds.
[1543834671] Warning: Return code of 7 for check of service 'haproxy-08888' on host was out of bounds.
Re: Nagios: Return code of 7 is out of bounds
Try switching to the nagios users before running teh check command:
su - nagios
/usr/lib/nagios/plugins/check_tcp -H hostname -p 8326 -w 5 -c 10 -t 60
Do you get an error or is it still successful?
Please provide the config for the services as well as the command definition if the above doesn't help resolve the problem.
su - nagios
/usr/lib/nagios/plugins/check_tcp -H hostname -p 8326 -w 5 -c 10 -t 60
Do you get an error or is it still successful?
Please provide the config for the services as well as the command definition if the above doesn't help resolve the problem.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios: Return code of 7 is out of bounds
with nagios/nagios4 user it results good in CLI. But proble with nagios UI. CommandLine resulting good but not UI resulting (Return code of 7 is out of bounds) . I am adding the screenshot of UI for your reference.
All our services are running with nagios4 user. Most of the services are resulting good.
sudo -Hu nagios4 /usr/lib/nagios/plugins/check_tcp -H hostname -p 8888 -w 5 -c 10 -t 60
TCP OK - 0.003 second response time on repbiz-backend-i-037f397110411230a.b.prod.eng-us port 8888|time=0.002768s;5.000000;10.000000;0.000000;60.000000
recently we increased the server count in nagios. seems it caused the issues.
Tried one of solution provided in the forum[https://support.nagios.com/forum/viewto ... 10#p220778], but no luck.
Thanks
All our services are running with nagios4 user. Most of the services are resulting good.
sudo -Hu nagios4 /usr/lib/nagios/plugins/check_tcp -H hostname -p 8888 -w 5 -c 10 -t 60
TCP OK - 0.003 second response time on repbiz-backend-i-037f397110411230a.b.prod.eng-us port 8888|time=0.002768s;5.000000;10.000000;0.000000;60.000000
recently we increased the server count in nagios. seems it caused the issues.
Tried one of solution provided in the forum[https://support.nagios.com/forum/viewto ... 10#p220778], but no luck.
Thanks
Re: Nagios: Return code of 7 is out of bounds
please find the config file.
Issues started after we recently added new hosts and services to nagios instance.
Issues started after we recently added new hosts and services to nagios instance.
- Attachments
-
- nagios4-nagios.cfg
- config file
- (43.73 KiB) Downloaded 332 times
Re: Nagios: Return code of 7 is out of bounds
Nagios CLI resulting OK but UI is showing (Return code of 7 is out of bounds) for all new services in nagios.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Nagios: Return code of 7 is out of bounds
Hi, @mouli449. /usr/lib/nagios/plugins/ is a non standard folder for nagios plugins. Usually its /usr/local/nagios/etc/libexec/. Return code of 7 could mean that your commands are pointing to the plugin in a wrong location. Can you show me the config file with service check definitions and commands from the Core server?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios: Return code of 7 is out of bounds
We set our infrastructure to use location: /usr/lib/nagios/plugins/ for plugins.
Service definition:
define service {
use generic-rep-service
servicegroups r4e-prod-repbiz
hostgroup_name r4e-prod-repbiz
service_description repbiz-8897
check_command check_rd_tcp!8897!5!10!
notification_interval 0 ; set > 0 if you want to be renotified
}
Command definition:
define command {
# Arg1= port Arg2=warning Arg3=critical
command_name check_rd_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -t 60
}
resource.cfg:
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/lib/nagios/plugins
# Sets $USER2$ to be the path to event handlers
#$USER2$=/usr/share/nagios4/lib/x86_64-linux-gnu/eventhandlers
We have other services which are resulting good, we are facing the issues with recently added instances. Can we many configuration change to get this fixed.
Atcching a screenshot for your reference:
Thanks
Service definition:
define service {
use generic-rep-service
servicegroups r4e-prod-repbiz
hostgroup_name r4e-prod-repbiz
service_description repbiz-8897
check_command check_rd_tcp!8897!5!10!
notification_interval 0 ; set > 0 if you want to be renotified
}
Command definition:
define command {
# Arg1= port Arg2=warning Arg3=critical
command_name check_rd_tcp
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -t 60
}
resource.cfg:
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/lib/nagios/plugins
# Sets $USER2$ to be the path to event handlers
#$USER2$=/usr/share/nagios4/lib/x86_64-linux-gnu/eventhandlers
We have other services which are resulting good, we are facing the issues with recently added instances. Can we many configuration change to get this fixed.
Atcching a screenshot for your reference:
Thanks
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Nagios: Return code of 7 is out of bounds
@mouli449, The command you ran from the command line uses port 8888.
[user]sudo -Hu nagios4 /usr/lib/nagios/plugins/check_tcp -H hostname -p 8888 -w 5 -c 10 -t 60
TCP OK - 0.003 second response time on repbiz-backend-i-037f397110411230a.b.prod.eng-us port 8888|time=0.002768s;5.000000;10.000000;0.000000;60.000000
[/user]
Please relplace the HOSTADDRESS in my command, then run the commands and show me the output:But in the service definition, you're using the port 8897.
check_command check_rd_tcp!8897!5!10!
su - nagios4
/usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p 8897 -w 5 -c 10 -t 60
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios: Return code of 7 is out of bounds
The issue is resolved. Actual issues are, there were duplicate service configurations generated for the same service. I just removed them and restarted Nagios service.
Issues fixed. Thanks for helping me out with some suggestions.
Regards,
Issues fixed. Thanks for helping me out with some suggestions.
Regards,
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios: Return code of 7 is out of bounds
glad to hear it is resolved.mouli449 wrote:The issue is resolved. Actual issues are, there were duplicate service configurations generated for the same service. I just removed them and restarted Nagios service.
Issues fixed. Thanks for helping me out with some suggestions.
Regards,
Locking thread