Bad result code in a PERL plugin
-
- Posts: 13
- Joined: Wed Oct 28, 2015 11:19 am
Re: Bad result code in a PERL plugin
It's the number of interface, doesn't matter which interface I check, the result (OK, CRITICAL or WARNING), always shows orange (UNKNOWN).
Re: Bad result code in a PERL plugin
It could be the embedded perl setting causing the error.
Can you edit your nagios.cfg file and change the following line from
to
Save the file and restart nagios.
Wait for the check to run and see if the unknown status is gone and it is OK.
Can you edit your nagios.cfg file and change the following line from
Code: Select all
enable_embedded_perl=1
Code: Select all
enable_embedded_perl=0
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!
-
- Posts: 13
- Joined: Wed Oct 28, 2015 11:19 am
Re: Bad result code in a PERL plugin
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/nag ... dperl.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:
In conclusion, this plugin works as should without the Nagios embedded perl.
Thanks a lot for all your help.
https://assets.nagios.com/downloads/nag ... dperl.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:
So I added "# nagios: -epn" to the plugin and this solved the problem.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.
In conclusion, this plugin works as should without the Nagios embedded perl.
Thanks a lot for all your help.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Bad result code in a PERL plugin
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!