Page 1 of 1

version 4.0.0: Warning: Return code of 13 for check of...

Posted: Mon Oct 14, 2013 7:12 pm
by Florin Andrei
I've built RPM packages from 4.0.0 for core, plugins and NRPE, and I've installed them on Red Hat 5. I'm using a simple test configuration with a few hosts and services. This stuff used to work on 3.x. Now I get a whole lot of:

Code: Select all

[1381794997] Warning: Return code of 13 for check of host 'foo' was out of bounds.
[1381795002] Warning: Return code of 13 for check of host 'bar' was out of bounds.
[1381795007] Warning: Return code of 13 for check of host 'baz' was out of bounds.
And same code 13 for a few select services. Funny thing is, some services work just fine.

The check_command for hosts is check-host-alive, which is then defined as:

Code: Select all

command.cfg:command[check-host-alive]=/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1
If I run that thing manually, either as root or as nagios, it's fine.

I know it's supposed to be a matter of permissions, I just can't figure out what exactly. I've checked file ownership, it's nagios:nagios in most places in /var used by this service:

Code: Select all

# ls -lR /var/nagios/
/var/nagios/:
total 408
drwxr-xr-x 2 nagios nagios   4096 Oct  1 15:22 archives
-rw-r--r-- 1 nagios nagios  70886 Oct 14 17:02 objects.cache
-rw-r--r-- 1 nagios nagios  70886 Oct 14 17:00 objects.precache
-rw------- 1 nagios nagios 105963 Oct 14 17:02 retention.dat
drwxr-xr-x 2 nagios apache   4096 Oct 14 17:02 rw
drwxr-xr-x 3 nagios nagios   4096 Oct 14 15:42 spool
-rw-rw-r-- 1 nagios nagios 105953 Oct 14 17:06 status.dat

/var/nagios/archives:
total 0

/var/nagios/rw:
total 8
prw-rw---- 1 nagios nagios 0 Oct 14 15:42 nagios.cmd
srw-rw---- 1 nagios nagios 0 Oct 14 17:02 nagios.qh

/var/nagios/spool:
total 8
drwxr-xr-x 2 nagios nagios 4096 Oct 14 17:02 checkresults

/var/nagios/spool/checkresults:
total 0




# ls -lR /var/log/nagios/
/var/log/nagios/:
total 128
drwxr-xr-x 2 nagios nagios   4096 Oct  1 15:22 archives
-rw-r--r-- 1 nagios nagios 113319 Oct 14 17:06 nagios.log

/var/log/nagios/archives:
total 0




# ps axu | grep nagios
nagios   22521  0.2  0.0  22328  1452 ?        S<s  17:10   0:00 /usr/bin/nagios -ud /etc/nagios/nagios.cfg
nagios   22522  0.0  0.0   9708   776 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22523  0.0  0.0   9196   692 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22524  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22525  0.0  0.0   9196   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22526  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22527  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22528  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22529  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22530  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22532  0.0  0.0   9192   688 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22533  0.0  0.0   9192   684 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22534  0.0  0.0   9196   692 ?        S<   17:10   0:00 /usr/bin/nagios --worker /var/nagios/rw/nagios.qh
nagios   22535  0.0  0.0  21688   708 ?        S<   17:10   0:00 /usr/bin/nagios -ud /etc/nagios/nagios.cfg
SELinux is set to "permissive".

Any tips or clues? I've looked everywhere, I'm stumped.

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Tue Oct 15, 2013 10:23 am
by slansing
What version of the plugins package did you install along side 4.0?

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Tue Oct 15, 2013 5:28 pm
by Florin Andrei

Code: Select all

# rpm -qa | grep -e nagios -e nrpe
nagios-4.0.0-2
nagios-plugins-1.4.16-1
nrpe-plugin-2.15-1
nagios-contrib-4.0.0-2

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Tue Oct 15, 2013 7:02 pm
by Florin Andrei
After quite a bit of difficulties (spec file is broken, there are many things not right about the whole package compiling here), I've managed to build an RPM package out of nagios-plugins-1.5. I've upgraded that package on the test server, restarted the nagios service, and I'm getting the same errors.

"Warning: Return code of 13 for check of host..."

Any suggestions would be appreciated.

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Wed Oct 16, 2013 1:51 pm
by slansing
Is this error only occurring on "check_ping" checks?

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Wed Oct 16, 2013 8:20 pm
by Florin Andrei
No, it's multiple plugins.

Meanwhile, I think I've found the problem. The spec files for the RPM packages, contained in the tarballs, are woefully out of date, and incompatible between nagios, nagios-plugins, and nrpe-plugin. Also, there are things such as 644 permissions on directories, etc. It's ugly.

I'll fix the specs and open a new thread, detailing my findings and the fixes. I'll link it here.

EDIT: Okay, I have what seem to be clean specs that build compatible packages. I'm a little busy now (Tue Oct 22 17:44:49 PDT 2013). I'll make a note to post my findings tomorrow.

EDIT2: I've posted all of my findings here:

http://support.nagios.com/forum/viewtop ... =7&t=21809

Feel free to close this old topic, the new topic is much more extensive and also contains fixes.

Re: version 4.0.0: Warning: Return code of 13 for check of..

Posted: Thu Oct 17, 2013 11:06 am
by abrist
Great, we will leave the thread open awaiting your final post.