summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/check_lmmon.pl19
1 files changed, 19 insertions, 0 deletions
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 @@
1#!/usr/bin/perl
2# NetSaint Temp warning script
3# Written by: Nathan LeSueur
4
5if ($#ARGV < 1) {
6print "Usage: $0 <critical temp> <warning temp> <normal temp>\n";
7exit; } $crit = shift; $warn = shift; $norm = shift; if ($warn >
8$crit) { print "Warning level cannot be greater than critical
9level!\n"; exit; } @b = qx{/usr/local/bin/lmmon -s}; foreach(@b) { @c
10= split(/ \/ /, $_); $d = $c[1]; } @e = split(/F/, $d); $f = $e[0];
11
12$status = "$f degrees F\n";
13
14if($f >= $crit) {print "CRITICAL - $status"; exit 2;}
15if($f >= $warn) {print "WARNING - $status"; exit 1;}
16if($f <= $norm && $f != 0) {print "OK - $status"; exit 0;}
17else{print "UNKNOWN - unable to access smb\n"; exit (-1);}
18
19