diff options
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | 2002-06-25 13:55:07 +0000 |
---|---|---|
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | 2002-06-25 13:55:07 +0000 |
commit | 70cdf8f9d858526dd5b4ea9cad3a8d6f0a62f038 (patch) | |
tree | 420ccaf3b0619d8ebdf04ee3e69dbd28eb2a8a61 /contrib/check_lmmon.pl | |
parent | ecb6f13991dbb7743d79432206cac4e3a7457e1d (diff) | |
download | monitoring-plugins-70cdf8f9d858526dd5b4ea9cad3a8d6f0a62f038.tar.gz |
check motherboard/cpu temp via lmmon
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@59 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'contrib/check_lmmon.pl')
-rw-r--r-- | contrib/check_lmmon.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/check_lmmon.pl b/contrib/check_lmmon.pl new file mode 100644 index 00000000..bf4b4386 --- /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 | |||
5 | if ($#ARGV < 1) { | ||
6 | print "Usage: $0 <critical temp> <warning temp> <normal temp>\n"; | ||
7 | exit; } $crit = shift; $warn = shift; $norm = shift; if ($warn > | ||
8 | $crit) { print "Warning level cannot be greater than critical | ||
9 | level!\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 | |||
14 | if($f >= $crit) {print "CRITICAL - $status"; exit 2;} | ||
15 | if($f >= $warn) {print "WARNING - $status"; exit 1;} | ||
16 | if($f <= $norm && $f != 0) {print "OK - $status"; exit 0;} | ||
17 | else{print "UNKNOWN - unable to access smb\n"; exit (-1);} | ||
18 | |||
19 | |||