summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 43841c3..b547615 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -176,7 +176,7 @@ $SIG{'ALRM'} = sub {
176}; 176};
177alarm($TIMEOUT); 177alarm($TIMEOUT);
178 178
179# Execute an "ls" on the share using smbclient program 179# Execute a "du" on the share using smbclient program
180# get the results into $res 180# get the results into $res
181my @cmd = ( 181my @cmd = (
182 $smbclient, 182 $smbclient,
@@ -185,7 +185,7 @@ my @cmd = (
185 defined($workgroup) ? ("-W", $workgroup) : (), 185 defined($workgroup) ? ("-W", $workgroup) : (),
186 defined($address) ? ("-I", $address) : (), 186 defined($address) ? ("-I", $address) : (),
187 defined($opt_P) ? ("-p", $opt_P) : (), 187 defined($opt_P) ? ("-p", $opt_P) : (),
188 "-c", "ls" 188 "-c", "du"
189); 189);
190 190
191print join(" ", @cmd) . "\n" if ($verbose); 191print join(" ", @cmd) . "\n" if ($verbose);
@@ -198,7 +198,7 @@ alarm(0);
198@lines = split /\n/, $res; 198@lines = split /\n/, $res;
199 199
200#Get the last line into $_ 200#Get the last line into $_
201$_ = $lines[$#lines]; 201$_ = $lines[$#lines-1];
202#print "$_\n"; 202#print "$_\n";
203 203
204#Process the last line to get free space. 204#Process the last line to get free space.
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index 664795e..2a8ab21 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -18,6 +18,7 @@ print_usage() {
18 echo " $PROGNAME --tns <Oracle Sid or Hostname/IP address>" 18 echo " $PROGNAME --tns <Oracle Sid or Hostname/IP address>"
19 echo " $PROGNAME --db <ORACLE_SID>" 19 echo " $PROGNAME --db <ORACLE_SID>"
20 echo " $PROGNAME --login <ORACLE_SID>" 20 echo " $PROGNAME --login <ORACLE_SID>"
21 echo " $PROGNAME --connect <ORACLE_SID>"
21 echo " $PROGNAME --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING>" 22 echo " $PROGNAME --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING>"
22 echo " $PROGNAME --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>" 23 echo " $PROGNAME --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>"
23 echo " $PROGNAME --oranames <Hostname>" 24 echo " $PROGNAME --oranames <Hostname>"
@@ -39,6 +40,8 @@ print_help() {
39 echo " filesystem for sgadefORACLE_SID.dbf" 40 echo " filesystem for sgadefORACLE_SID.dbf"
40 echo "--login SID" 41 echo "--login SID"
41 echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password" 42 echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password"
43 echo "--connect SID"
44 echo " Attempt a login and alert if an ORA- error is returned"
42 echo "--cache" 45 echo "--cache"
43 echo " Check local database for library and buffer cache hit ratios" 46 echo " Check local database for library and buffer cache hit ratios"
44 echo " ---> Requires Oracle user/password and SID specified." 47 echo " ---> Requires Oracle user/password and SID specified."
@@ -187,6 +190,18 @@ case "$cmd" in
187 exit $STATE_CRITICAL 190 exit $STATE_CRITICAL
188 fi 191 fi
189 ;; 192 ;;
193--connect)
194 connectchk=`sqlplus $2 < /dev/null`
195 connectchk2=` echo $connectchk | grep -c ORA-`
196 if [ ${connectchk2} -eq 0 ] ; then
197 echo "OK - login successful"
198 exit $STATE_OK
199 else
200 connectchk3=` echo "$connectchk" | grep "ORA-" | head -1`
201 echo "CRITICAL - $connectchk3"
202 exit $STATE_CRITICAL
203 fi
204 ;;
190--cache) 205--cache)
191 if [ ${5} -gt ${6} ] ; then 206 if [ ${5} -gt ${6} ] ; then
192 echo "UNKNOWN - Warning level is less then Crit" 207 echo "UNKNOWN - Warning level is less then Crit"
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
index ffaa974..874e104 100755
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -44,25 +44,28 @@ case "$1" in
44 *) 44 *)
45 sensordata=`sensors 2>&1` 45 sensordata=`sensors 2>&1`
46 status=$? 46 status=$?
47 if test "$1" = "-v" -o "$1" = "--verbose"; then
48 echo ${sensordata}
49 fi
50 if test ${status} -eq 127; then 47 if test ${status} -eq 127; then
51 echo "SENSORS UNKNOWN - command not found (did you install lmsensors?)" 48 text="SENSORS UNKNOWN - command not found (did you install lmsensors?)"
52 exit $STATE_UNKNOWN 49 exit=$STATE_UNKNOWN
53 elif test ${status} -ne 0; then 50 elif test ${status} -ne 0; then
54 echo "WARNING - sensors returned state $status" 51 text="WARNING - sensors returned state $status"
55 exit $STATE_WARNING 52 exit=$STATE_WARNING
56 fi 53 elif echo ${sensordata} | egrep ALARM > /dev/null; then
57 if echo ${sensordata} | egrep ALARM > /dev/null; then 54 text="SENSOR CRITICAL - Sensor alarm detected!"
58 echo SENSOR CRITICAL - Sensor alarm detected! 55 exit=$STATE_CRITICAL
59 exit $STATE_CRITICAL
60 elif echo ${sensordata} | egrep FAULT > /dev/null \ 56 elif echo ${sensordata} | egrep FAULT > /dev/null \
61 && test "$1" != "-i" -a "$1" != "--ignore-fault"; then 57 && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
62 echo SENSOR UNKNOWN - Sensor reported fault 58 text="SENSOR UNKNOWN - Sensor reported fault"
63 exit $STATE_UNKNOWN 59 exit=$STATE_UNKNOWN
60 else
61 text="SENSORS OK"
62 exit=$STATE_OK
64 fi 63 fi
65 echo sensor ok 64
66 exit $STATE_OK 65 echo "$text"
66 if test "$1" = "-v" -o "$1" = "--verbose"; then
67 echo ${sensordata}
68 fi
69 exit $exit
67 ;; 70 ;;
68esac 71esac