How to make Perl Script to work with Nagios

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.
Locked
satishvjadhav
Posts: 16
Joined: Tue Mar 07, 2017 5:18 am

How to make Perl Script to work with Nagios

Post by satishvjadhav »

Hi All,

Good morning !

I am curious to know how can I make my perl scripts to work with nagios?
is there any changes I need to do in perl script so that it will return output in terms of exit codes which nrpe will understand and provide result to nagios to display on UI or send email alerts. OR just plain working perl script will do ? if yes how should i go ahead ?

Thank you,
Sj
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to make Perl Script to work with Nagios

Post by dwhitfield »

The most basic thing you need to know:
exit 0 - Whenever the status of the output of the executed script is "OK", Nagios Server would highlight the check with Green color.
exit 1 - Whenever the status of the output of the executed script is "WARNING", Nagios Server would highlight the check with Yellow color.
exit 2 - Whenever the status of the output of the executed script is "CRITICAL", Nagios Server would highlight the check with Red color.
exit 3 - Whenever the status of the output of the executed script is "UNKNOWN", Nagios Server would highlight the check with Grey color.

You'll find more detail at http://nagios-plugins.org/doc/guidelines.html

Please let us know if you have additional questions.
satishvjadhav
Posts: 16
Joined: Tue Mar 07, 2017 5:18 am

Re: How to make Perl Script to work with Nagios

Post by satishvjadhav »

dwhitfield wrote:The most basic thing you need to know:
exit 0 - Whenever the status of the output of the executed script is "OK", Nagios Server would highlight the check with Green color.
exit 1 - Whenever the status of the output of the executed script is "WARNING", Nagios Server would highlight the check with Yellow color.
exit 2 - Whenever the status of the output of the executed script is "CRITICAL", Nagios Server would highlight the check with Red color.
exit 3 - Whenever the status of the output of the executed script is "UNKNOWN", Nagios Server would highlight the check with Grey color.

You'll find more detail at http://nagios-plugins.org/doc/guidelines.html

Please let us know if you have additional questions.
Thank you.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: How to make Perl Script to work with Nagios

Post by cdienger »

Can this thread be locked or did you have any further questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
satishvjadhav
Posts: 16
Joined: Tue Mar 07, 2017 5:18 am

Re: How to make Perl Script to work with Nagios

Post by satishvjadhav »

Yes, pls locked it.
Locked