return code ??? 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
jssingh
Posts: 110
Joined: Mon Apr 29, 2013 4:55 pm

Re: return code ??? out of bounds

Post by jssingh »

I've attached the plugin. It's for testing the read/write speed of a lustre filesystem. It also relies on a binary executable. I don't know how to get that to you. The binary is compiled for SLES 11.
Attachments
cmst_plugin.pl
(10.54 KiB) Downloaded 475 times
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: return code ??? out of bounds

Post by eloyd »

Did you try doing what it said? :mrgreen:

Code: Select all

 author: XXXXXXXXX/NASA Advanced SuperComputing Facility
# email: [email protected]
#
# please report any bugs or other issues to the author, thanks!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
jssingh
Posts: 110
Joined: Mon Apr 29, 2013 4:55 pm

Re: return code ??? out of bounds

Post by jssingh »

yep. :) he can't figure out what's going on either.

Those return codes don't make any sense in terms of the code. It can only return 0,1,2,3.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: return code ??? out of bounds

Post by Box293 »

I suspect that you'll need to enable debugging for Nagios.

Code: Select all

sed -i 's/.*debug_level=.*/debug_level=-1/g' /usr/local/nagios/etc/nagios.cfg
service nagios restart
Make the unknown error occur.
Then look at the log /usr/local/nagios/var/nagios.debug

When you are finished this turns debugging off:

Code: Select all

sed -i 's/.*debug_level=.*/debug_level=0/g' /usr/local/nagios/etc/nagios.cfg
service nagios restart

FYI feature request submitted:
https://github.com/NagiosEnterprises/na ... issues/132
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: return code ??? out of bounds

Post by eloyd »

I'm thinking that running it from the command line on the Nagios server, as the nagios user, will also shed some light on things.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: return code ??? out of bounds

Post by lmiltchev »

@jssingh Any updates?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: return code ??? out of bounds

Post by eloyd »

Code: Select all

cat > eric.pl
use lib oldPerlKnowledge;
use strict;
use vars qw($thisWillNeverWork, $disclaimEverything);
^D

./eric.pl -thisWillNeverWork -disclaimEverything=true
Okay, so my attempt at perl humor aside, debugging this remotely will never work without a lot of dev time trying to figure out exactly what it does, especially without the .../lib/cmst program to do the heavy lifting.

I'm _guessing_ that the various result codes are being caused by that cmst program. Look at lines 289 and 304 and you'll see that the perl code is blindly passing along the exit code of your cmst program without parsing it into Nagios 0/1/2 first. I'm guessing that there's something different/unexpected/changed/broken with that external program and/or how it's being activated through this (very complex) perl code that is now causing it to fail unexpectedly, and pass along seemingly random results, that the plugin is passing along without checking first.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
jssingh
Posts: 110
Joined: Mon Apr 29, 2013 4:55 pm

Re: return code ??? out of bounds

Post by jssingh »

@eloyd thanks for catching that. I'll look into it. I've never had a problem with running it from the command line as the nagios user, but then again if you run this too often it hammers the filesystem, so I run it from the command line sparingly. We only run the nagios check every half hour.

@box293 I've turned debugging on. When the error happens again, I'll take a look. thanks.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: return code ??? out of bounds

Post by eloyd »

Only thank me if it's useful. Like I said, that's my quick examination of the code, as I was only looking for exit points.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: return code ??? out of bounds

Post by lmiltchev »

@box293 I've turned debugging on. When the error happens again, I'll take a look. thanks.
@jssingh, we will keep the thread open for the time being. Let us know if the issue resurfaces.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked