From 70cdf8f9d858526dd5b4ea9cad3a8d6f0a62f038 Mon Sep 17 00:00:00 2001 From: Subhendu Ghosh Date: Tue, 25 Jun 2002 13:55:07 +0000 Subject: check motherboard/cpu temp via lmmon git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@59 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/contrib/check_lmmon.pl b/contrib/check_lmmon.pl new file mode 100644 index 0000000..bf4b438 --- /dev/null +++ b/contrib/check_lmmon.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +# NetSaint Temp warning script +# Written by: Nathan LeSueur + +if ($#ARGV < 1) { +print "Usage: $0 \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);} + + -- cgit v0.10-9-g596f