How to make Perl Script to work with Nagios

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.

How to make Perl Script to work with Nagios

Postby satishvjadhav » Tue Mar 07, 2017 9:38 am

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

Re: How to make Perl Script to work with Nagios

Postby dwhitfield » Tue Mar 07, 2017 11:59 am

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 2104
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 4 guests