Bad result code in a PERL plugin

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Bad result code in a PERL plugin

Postby andresrinaldi_uy » Tue Jan 10, 2017 10:00 am

It's the number of interface, doesn't matter which interface I check, the result (OK, CRITICAL or WARNING), always shows orange (UNKNOWN).
andresrinaldi_uy
 
Posts: 13
Joined: Wed Oct 28, 2015 11:19 am

Re: Bad result code in a PERL plugin

Postby tgriep » Tue Jan 10, 2017 5:36 pm

It could be the embedded perl setting causing the error.
Can you edit your nagios.cfg file and change the following line from
Code: Select all
enable_embedded_perl=1

to
Code: Select all
enable_embedded_perl=0


Save the file and restart nagios.

Wait for the check to run and see if the unknown status is gone and it is OK.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4320
Joined: Thu Oct 30, 2014 9:02 am

Re: Bad result code in a PERL plugin

Postby andresrinaldi_uy » Thu Jan 12, 2017 10:10 am

I did this but the result was worst. With this in mind I did some research and I found this article:

https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/embeddedperl.html

Change this setting from 1 to 0 for testing purpose

use_embedded_perl_implicitly=0

And it worked, but CPU consumption was too high so I kept reading and found something interesting:

Plugin-Specific Use of the Perl Interpreter

Beginning with Nagios 3, you can specify which Perl plugins or scripts should or should not be run under the embedded Perl interpreter. This is particularly useful if you have troublesome Perl scripts which do not work well with the Perl interpreter.

To explicitly tell Nagios whether or not to use the embedded Perl interpreter for a particular perl script, add one of the following entries to your Perl script/plugin...

To tell Nagios to use the Perl interpreter for a particular script, add this line to the Perl script:

# nagios: +epn
To tell Nagios to NOT use the embedded Perl interpreter for a particular script, add this line to the Perl script:

# nagios: -epn
Either line must be located within the first 10 lines of a script for Nagios to detect it.


So I added "# nagios: -epn" to the plugin and this solved the problem.

In conclusion, this plugin works as should without the Nagios embedded perl.

Image

Thanks a lot for all your help.
Attachments
okstatus.png
andresrinaldi_uy
 
Posts: 13
Joined: Wed Oct 28, 2015 11:19 am

Re: Bad result code in a PERL plugin

Postby dwhitfield » Thu Jan 12, 2017 10:20 am

Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 2100
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Previous

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests