[Nagiosplug-devel] check_nt UpTime Enhancement
Glover, Rick I.
RickGlover at paulhastings.com
Tue Jan 4 14:58:35 CET 2005
I added a little bit of code to give check_nt the ability to have warning and critical alerts against the uptime. Provide -w and -c values in minutes to alert. For example, to warn that the server was restarted within the last 2 hours use "./check_nt -v UPTIME -w 120" and to provide a critical alert for restarts within the last 15 minutes use: "./check_nt -v UPTIME -w 120 -c 15" (other required parameters were left out intentionally to keep the e-mail brief). The purpose of this change is to catch restarts of systems in between the Nagios checks. Some systems restart faster than the configuration of the Nagios polling. To do this replace the "return_code=STATE_OK;" under "else if(vars_to_check==CHECK_UPTIME){" with the code below.
if(check_critical_value==TRUE && (uptime / 60 <= critical_value))
return_code=STATE_CRITICAL;
else if (check_warning_value==TRUE && (uptime / 60 <= warning_value))
return_code=STATE_WARNING;
else
return_code=STATE_OK;
__________________________________________________________________________________________
Rick Glover, Sr. Network Administrator, CCNA, MCP, MCSA | Paul, Hastings, Janofsky & Walker LLP | 515 South Flower Street, Twenty-third Floor, Los Angeles, CA 90071| direct: 213 683 5625 | main: 213 683 6000 | direct fax: 213 622 5545 | RickGlover at PaulHastings.com <mailto:RickGlover at PaulHastings.com> | www.paulhastings.com <http://www.paulhastings.com/>
_____________________________________
This message is sent by a law firm and may contain information that is privileged or confidential. If you received this transmission in error, please notify the sender by reply e-mail and delete the message and any attachments.
For additional information, please visit our website at www.paulhastings.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nagios-plugins.org/archive/devel/attachments/20050104/c9880bb6/attachment.html>
More information about the Devel
mailing list