Page 1 of 2
Return code of 13 is out of bounds
Posted: Mon Aug 17, 2015 9:48 pm
by braindope
Hi,
Can anyone experience this kind of Status information in Nagios is say
"Return code of 13 is out of bounds"
I have check the file in /tmp and it has a correct ownership
I'm using the check_fortigate.pl pugins, the cluster, Memory and Sessions service are having that kind of error
Re: Return code of 13 is out of bounds
Posted: Mon Aug 17, 2015 10:12 pm
by Box293
Did you originally test the plugin at the command line as the root user?
It's likely that the files created were for the root user and the nagios user (what monitoring engine runs as) cannot update them.
Try deleting the file in /tmp and then force an immediate check from the Nagios interface, does this fix the problem?
Re: Return code of 13 is out of bounds
Posted: Mon Aug 17, 2015 11:43 pm
by braindope
Hi Box,
The problem still persist

, I have clear the files in /tmp then re-run the checks.
Re: Return code of 13 is out of bounds
Posted: Tue Aug 18, 2015 12:57 am
by Box293
So what is the output when you run the command at the cli?
Code: Select all
su nagios
./check_fortigate.pl -H xxx.xxx.xxx.xxx
Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 1:15 am
by braindope
Hi Box,
I have run ./check_fortigate.pl -H IP -C string -T Cluster in nagios user, it yielded positive results, and magically in my nagios web interface the check went OK
However for Memory and Session has the same output as in the Cluster, this is definitely weird
Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 1:56 am
by Box293
Looking at the plugin code it looks like it uses a path to store files:
-p --path STRING Path to store serial filenames, default /usr/lib/nagios/plugins/FortiSerial
Do you have anything like this? I believe it will be named the ip address.
Or perhaps you could run with the -p argument pointing to /tmp
Code: Select all
./check_fortigate.pl -H IP -C string -p /tmp -T Memory
Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 6:28 pm
by braindope
Hi Box,
I have run the command below
./check_fortigate.pl -H IP -C string -p /tmp -T Memory
But it says unknown option p
Below are the only option in my plugins:
Options:
-H --host STRING or IPADDRESS Check interface on the indicated host
-C --community STRING Community-String for SNMP
-T -- type STRING CPU, MEM, Ses, VPN, Cluster
-S --serial STRING Primary serial number
-s --slave get values of slave
-w --warning INTEGER Warning threshold, applies to cpu, mem, session.
-c --critical INTEGER Critical threshold, applies to cpu, mem, session.
-R --reset Resets ip file (cluster only)
-M --mode STRING Output-Mode: 0 => just print, 1 => print and show failed tunnel, 2 => critical
-V --vpnmode STRING VPN-Mode: both => IPSec & SSL/OpenVPN, ipsec => IPSec only, ssl => SSL/OpenVPN only
-? --help Returns full help text
Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 6:40 pm
by Box293
This is where I downloaded the plugin from:
https://exchange.nagios.org/directory/P ... pl/details
It's version is dated 2015-04-08 at the beginning of the file.
Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 10:37 pm
by braindope
Hi Box,
Thanks for the link i've found the answer in there my
check_command check_fortigate_status!memory!string!60!70!
is at fault it should be
check_command check_fortigate_status!mem!string!60!70!
same thing for my sessions checking.
Additional:
i have run the check as root user for the plugins to create a file in my FortiSerial folder. This solve my
Return code of 13 is out of bounds error.
Thank you for your usual help

Re: Return code of 13 is out of bounds
Posted: Wed Aug 19, 2015 11:21 pm
by Box293
Great, glad you were able to get to the bottom of it
