summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanley Hopcroft <stanleyhopcroft@users.sourceforge.net>2003-05-26 10:09:23 (GMT)
committerStanley Hopcroft <stanleyhopcroft@users.sourceforge.net>2003-05-26 10:09:23 (GMT)
commit64d1ef0db6c347f7a04cd6967f736995d19981ce (patch)
tree1aa1e74b48ad6e9b4ea3d19e0943f847524dc8b0
parentfb54f2574171bcbdfae5d33b5f64715b193b4215 (diff)
downloadmonitoring-plugins-64d1ef0db6c347f7a04cd6967f736995d19981ce.tar.gz
Revisions to Tom De Blende contributed plugins: check_axis.sh and check_mssql.sh
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@522 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--contrib/check_axis.sh2
-rwxr-xr-xcontrib/check_mssql.sh4
2 files changed, 5 insertions, 1 deletions
diff --git a/contrib/check_axis.sh b/contrib/check_axis.sh
index e97d4cd..231d9da 100644
--- a/contrib/check_axis.sh
+++ b/contrib/check_axis.sh
@@ -73,6 +73,8 @@ elif [ "$status" == "Printing" ]; then
73 exit="1" && stdio="WARNING - PRINTING. Out of paper."; 73 exit="1" && stdio="WARNING - PRINTING. Out of paper.";
74 elif [ "$comments" == "Out of" ]; then 74 elif [ "$comments" == "Out of" ]; then
75 exit="1" && stdio="WARNING - PRINTING. Out of paper. Bytes printed: $bytes."; 75 exit="1" && stdio="WARNING - PRINTING. Out of paper. Bytes printed: $bytes.";
76 elif [ "$comments" == "Busy Out" ]; then
77 exit="1" && stdio="WARNING - Busy, out of paper.";
76 elif [ "$comments" == "Ready " ]; then 78 elif [ "$comments" == "Ready " ]; then
77 exit="0" && stdio="OK - PRINTING. Bytes printed: $bytes."; 79 exit="0" && stdio="OK - PRINTING. Bytes printed: $bytes.";
78 elif [ "$comments" == "Printer off-line" ]; then 80 elif [ "$comments" == "Printer off-line" ]; then
diff --git a/contrib/check_mssql.sh b/contrib/check_mssql.sh
index 048da72..7faa6be 100755
--- a/contrib/check_mssql.sh
+++ b/contrib/check_mssql.sh
@@ -10,6 +10,7 @@
10# 10#
11# Version 1.0. 11# Version 1.0.
12# Version 1.1: rewritten the initial script so that it not only works from the CLI but also from within Nagios. Always helpful... 12# Version 1.1: rewritten the initial script so that it not only works from the CLI but also from within Nagios. Always helpful...
13# Version 1.2: grouped output so things look a bit better.
13# 14#
14# You might want to change these values: 15# You might want to change these values:
15 16
@@ -21,6 +22,7 @@ mktempcmd=`which mktemp`
21wccmd=`which wc` 22wccmd=`which wc`
22sedcmd=`which sed` 23sedcmd=`which sed`
23trcmd=`which tr` 24trcmd=`which tr`
25uniqcmd=`which uniq`
24 26
25################################################################################################################### 27###################################################################################################################
26 28
@@ -68,7 +70,7 @@ if [ ! -s $resultfile ]; then
68 exit 2; 70 exit 2;
69else 71else
70 nmbr=`$catcmd $resultfile | $grepcmd -v "\-\-\-\-\-" | $grepcmd -v "loginame" | $grepcmd -v "affected" | $sedcmd '/^$/d' | $sedcmd 's/ //g' | $wccmd -l | sed 's/ //g'`; 72 nmbr=`$catcmd $resultfile | $grepcmd -v "\-\-\-\-\-" | $grepcmd -v "loginame" | $grepcmd -v "affected" | $sedcmd '/^$/d' | $sedcmd 's/ //g' | $wccmd -l | sed 's/ //g'`;
71 users=`$catcmd $resultfile | $grepcmd -v "\-\-\-\-\-" | $grepcmd -v "loginame" | $grepcmd -v "affected" | $sedcmd '/^$/d' | $sedcmd 's/ //g' | $trcmd \\\n , | $sedcmd 's/,$/./g' | $sedcmd 's/,/, /g'`; 73 users=`$catcmd $resultfile | $grepcmd -v "\-\-\-\-\-" | $grepcmd -v "loginame" | $grepcmd -v "affected" | $sedcmd '/^$/d' | $sedcmd 's/ //g' | $uniqcmd -c | $trcmd \\\n , | $sedcmd 's/,$/./g' | $sedcmd 's/,/, /g' | $sedcmd 's/ //g' | $trcmd \\\t " "`;
72 $rmcmd -f $tmpfile $resultfile; 74 $rmcmd -f $tmpfile $resultfile;
73 echo "OK - MS SQL Server $srv has $nmbr user(s) connected: $users" | sed 's/: $/./g'; 75 echo "OK - MS SQL Server $srv has $nmbr user(s) connected: $users" | sed 's/: $/./g';
74 exit 0; 76 exit 0;