zabbix怎么监控mysql 消息队列
2个回答
展开全部
#!/bin/sh
#
#Description: get activemq data
IP=192.168.0.139
PORT=8161
QUEUENAME=q.virtual.charge
#WARN_Queuename="DLQ.q.virtual.charge"
WARN_Queuename="DLQ.*"
Warn_Pending=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${WARN_Queuename}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -1`
Pending=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -1`
Consumers=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -2|tail -1`
Enqueued=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -3|tail -1`
Dequeued=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -3|tail -1`
case $1 in
Warn_Pending|Warn_Pending)
echo "$Warn_Pending"
;;
Pending|pending)
echo "$Pending"
;;
Consumers|consumers)
echo $Consumers
;;
Enqueued|enqueued)
echo $Enqueued
;;
Dequeued|dequeued)
echo $Dequeued
;;
*)
echo "Usage: $0 Pending|Consumers|Enqueued|Dequeued|Warn_Pending"
esac
#
#Description: get activemq data
IP=192.168.0.139
PORT=8161
QUEUENAME=q.virtual.charge
#WARN_Queuename="DLQ.q.virtual.charge"
WARN_Queuename="DLQ.*"
Warn_Pending=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${WARN_Queuename}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -1`
Pending=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -1`
Consumers=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -2|tail -1`
Enqueued=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -3|tail -1`
Dequeued=`curl -uadmin:admin http://$IP:$PORT/admin/queues.jsp | grep -A 5 "${QUEUENAME}</a></td>"|awk -F '<' '{print $2}'|sed 's/td>//g'|grep '^[0-9]'|head -3|tail -1`
case $1 in
Warn_Pending|Warn_Pending)
echo "$Warn_Pending"
;;
Pending|pending)
echo "$Pending"
;;
Consumers|consumers)
echo $Consumers
;;
Enqueued|enqueued)
echo $Enqueued
;;
Dequeued|dequeued)
echo $Dequeued
;;
*)
echo "Usage: $0 Pending|Consumers|Enqueued|Dequeued|Warn_Pending"
esac
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询