Module: check_mk
Branch: master
Commit: b10731d92fda7fbc12fe121b2bd3665746e79cf0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b10731d92fda7f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jul 3 14:31:54 2014 +0200
websphere_mq_queues: Adden queue length to output
---
agents/plugins/websphere_mq.sh | 46 ++++++++++++++++++++++------------------
checks/websphere_mq_queues | 14 ++++++------
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/agents/plugins/websphere_mq.sh b/agents/plugins/websphere_mq.sh
index a5b556f..fa12b05 100755
--- a/agents/plugins/websphere_mq.sh
+++ b/agents/plugins/websphere_mq.sh
@@ -7,27 +7,31 @@ else
# Loop over all local mq instances
for QM in $( ps -ef | grep -i '[/]usr/mqm/bin/runmqchl -c' | awk '{
print $NF }' | uniq)
do
- echo '<<<websphere_mq_channels>>>'
- for i in `echo " display CHANNEL (*) TYPE (SDR) " | /usr/bin/runmqsc
$QM | grep CHLTYPE | grep -v SYSTEM | awk '{print $1}'`
- do
- j=`echo "display $i " | /usr/bin/runmqsc $QM | grep XMITQ | tr "
" "\n" | grep XMITQ | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'|
awk '{print $2 }'`
- a=`echo " display qlocal ($j) CURDEPTH " | /usr/bin/runmqsc $QM |
grep CURDEPTH | tr " " "\n" | grep CURDEPTH | sed '1,$s/(/ /g'
| sed '1,$s/)/ /g'| awk '{print $2 }' | tr "\n" " "`
- c=`echo " display qlocal ($j) MAXDEPTH " | /usr/bin/runmqsc $QM |
grep MAXDEPTH | tr " " "\n" | grep MAXDEPTH | sed '1,$s/(/ /g'
| sed '1,$s/)/ /g'| awk '{print $2 }' | tr "\n" " "`
+ echo '<<<websphere_mq_channels>>>'
+ for i in `echo " display CHANNEL (*) TYPE (SDR) " | /usr/bin/runmqsc
$QM | grep CHLTYPE | grep -v SYSTEM | awk '{print $1}'`
+ do
+ j=`echo "display $i " | /usr/bin/runmqsc $QM | grep XMITQ | tr
" " "\n" | grep XMITQ | sed '1,$s/(/ /g' | sed '1,$s/)/
/g'| awk '{print $2 }'`
+ a=`echo " display qlocal ($j) CURDEPTH " | /usr/bin/runmqsc $QM |
grep CURDEPTH | tr " " "\n" | grep CURDEPTH | sed '1,$s/(/ /g'
| sed '1,$s/)/ /g'| awk '{print $2 }' | tr "\n" " "`
+ c=`echo " display qlocal ($j) MAXDEPTH " | /usr/bin/runmqsc $QM |
grep MAXDEPTH | tr " " "\n" | grep MAXDEPTH | sed '1,$s/(/ /g'
| sed '1,$s/)/ /g'| awk '{print $2 }' | tr "\n" " "`
- l=`echo $i | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk
'{print $2 }'`
- s=`echo " display chstatus($l)" | /usr/bin/runmqsc $QM | grep STATUS
| tail -1 | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk '{print $NF
}'`
+ l=`echo $i | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk
'{print $2 }'`
+ s=`echo " display chstatus($l)" | /usr/bin/runmqsc $QM | grep STATUS
| tail -1 | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk '{print $NF
}'`
- if [ "$s" = "" ]
- then
- s="Unknown"
- fi
- echo "$a $i $c $s"
- done
- echo '<<<websphere_mq_queues>>>'
- for t in `echo " display queue (*) where (USAGE EQ NORMAL) " |
/usr/bin/runmqsc $QM | grep QLOCAL | grep -v SYSTEM | grep -v _T0 | grep -v _T1 | grep
-v _T2 | grep -v _T3 | grep -v mqtest | grep QUEUE | awk '{ print $1 }' | sed
'1,$s/(/ /g' | sed '1,$s/)/ /g'| awk '{print $2 }'`
- do
- a=`echo " display queue ($t) CURDEPTH " | /usr/bin/runmqsc $QM | grep
CURDEPTH | tail -1 | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk '{print
$2 }'`
- echo "$a $t"
- done
- done
+ if [ "$s" = "" ]
+ then
+ s="Unknown"
+ fi
+ echo "$a $i $c $s"
+ done
+ echo '<<<websphere_mq_queues>>>'
+ for t in `echo " display queue (*) where (USAGE EQ NORMAL) " |
/usr/bin/runmqsc $QM | grep QLOCAL | grep -v SYSTEM | grep -v _T0 | grep -v _T1 | grep
-v _T2 | grep -v _T3 | grep -v mqtest | grep QUEUE | awk '{ print $1 }' | sed
'1,$s/(/ /g' | sed '1,$s/)/ /g'| awk '{print $2 }'`
+ do
+ a=`echo " display queue ($t) CURDEPTH " | /usr/bin/runmqsc $QM |
grep CURDEPTH | tail -1 | sed '1,$s/(/ /g' | sed '1,$s/)/ /g'| awk
'{print $2 }'`
+ b=`echo " display qlocal ($t) MAXDEPTH " | /usr/bin/runmqsc $QM |
grep MAXDEPTH | tr " " "\n" | grep MAXDEPTH | sed '1,$s/(/ /g'
| sed '1,$s/)/ /g'| awk '{print $2 }' | tr "\n" " "`
+
+ # Muster: Anzahl eingehender Messages $a auf $t Max-Queues $b
+
+ echo "$a $t $b"
+ done
+ done
fi
diff --git a/checks/websphere_mq_queues b/checks/websphere_mq_queues
index 4ced3ec..087c118 100755
--- a/checks/websphere_mq_queues
+++ b/checks/websphere_mq_queues
@@ -25,11 +25,11 @@
# Boston, MA 02110-1301 USA.
#<<<websphere_mq_queues>>>
-#0 CD.ISS.CATSOS.REPLY.C000052
-#0 CD.ISS.COBA.REPLY.C000052
-#0 CD.ISS.DEUBA.REPLY.C000052
-#0 CD.ISS.TIQS.REPLY.C000052
-#0 CD.ISS.VWD.REPLY.C000052
+#0 CD.ISS.CATSOS.REPLY.C000052 5000
+#0 CD.ISS.COBA.REPLY.C000052 5000
+#0 CD.ISS.DEUBA.REPLY.C000052 5000
+#0 CD.ISS.TIQS.REPLY.C000052 5000
+#0 CD.ISS.VWD.REPLY.C000052 5000
websphere_mq_queues_default_levels = ( 1000, 1200 )
@@ -37,11 +37,11 @@ def inventory_websphere_mq_queues(info):
return [ ( x[1], 'websphere_mq_queues_default_levels' ) for x in info ]
def check_websphere_mq_queues(item, params, info):
- for messages, queue in info:
+ for messages, queue, queue_length in info:
if queue == item:
warn, crit = params
messages = saveint(messages)
- message = "%d Messages in Queue" % messages
+ message = "%d/%s Messages in Queue" % ( messages, queue_length )
perf = [ ( "queue", messages, warn, crit ) ]
if messages >= crit:
return 2, message, perf