Return code of 4 is out of bounds

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Return code of 4 is out of bounds

Post by tgriep »

What I see is an conflict is the arguments in the command definition and the arguments in the service check's arguments.

Your command line is

Code: Select all

command_line    $USER1$/check_port.pl -p $ARG1$ -h $HOSTADDRESS$
And the service check command is this

Code: Select all

check_command check_port.pl! -p 80 -h www.google.com '-w 1 -c 2 -v'
It is specifying the -p and the -h option twice in the command which is causing the error.

Change the command line to this for the command

Code: Select all

command_line    $USER1$/check_port.pl $ARG1$
Change the check command for the service like this.

Code: Select all

check_command check_port.pl! -p 80 -h www.google.com -w 1 -c 2 -v
Then try it out and see if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
pintu
Posts: 27
Joined: Fri Jun 09, 2017 6:33 am

Re: Return code of 4 is out of bounds

Post by pintu »

It's working now, thanks a lot for the suggestion. Details - but they could be annoying
kg2857
Posts: 237
Joined: Wed Apr 12, 2023 5:48 pm

Re: Return code of 4 is out of bounds

Post by kg2857 »

Please explain so we can all learn...
Post Reply