[Nagiosplug-checkins] CVS: nagiosplug/contrib check_lmmon.pl,NONE,1.1

Subhendu Ghosh sghosh at users.sourceforge.net
Tue Jun 25 06:56:02 CEST 2002


Update of /cvsroot/nagiosplug/nagiosplug/contrib
In directory usw-pr-cvs1:/tmp/cvs-serv2372

Added Files:
	check_lmmon.pl 
Log Message:
check motherboard/cpu temp via lmmon

--- NEW FILE ---
#!/usr/bin/perl
# NetSaint Temp warning script
# Written by: Nathan LeSueur

if ($#ARGV < 1) {
print "Usage: $0 <critical temp> <warning temp> <normal temp>\n";
exit; } $crit = shift; $warn = shift; $norm = shift; if ($warn >
$crit) {    print "Warning level cannot be greater than critical
level!\n"; exit; } @b = qx{/usr/local/bin/lmmon -s}; foreach(@b) { @c
= split(/ \/ /, $_); $d = $c[1]; } @e = split(/F/, $d); $f = $e[0];

$status = "$f degrees F\n";

if($f >= $crit) {print "CRITICAL - $status"; exit 2;}
if($f >= $warn) {print "WARNING - $status"; exit 1;}
if($f <= $norm && $f != 0) {print "OK - $status"; exit 0;}
else{print "UNKNOWN - unable to access smb\n"; exit (-1);}







More information about the Commits mailing list