cancel
Showing results for 
Search instead for 
Did you mean: 
Angel_Martinez_
Nimbostratus
Nimbostratus

Problem this snippet solves:

This external script helps you to check the MQSeries queue Status. So the idea is to check the listener with a simple TCP monitor (L4) + a external monitor to check the queue (L7). If both monitors are up the MQSeries server is really available.

MQSeries provides you with the "dspmq" utility which could be called through ssh command

So:

monitor MQPING { defaults from external run "mqping.sh" }

pool pool_mq { monitor all MQPING and tcp members x.x.x.x:1414 }

Code :

#!/bin/bash
MQPING=/usr/bin/dspmq
MQUSER=root
NODE_IP=$1
NODE_PORT=$2
IP=`echo $NODE_IP | sed 's/::ffff://'`

STATUS=`ssh -o 'StrictHostKeyChecking no' -l $MQUSER $IP $MQPING | awk '{ print $2 }'`

case "$STATUS" in
*Running*)
echo "Up"
;;
*)
esac
Version history
Last update:
‎17-Mar-2015 13:28
Updated by:
Contributors