The monitoring script is as follows: zabbix_monitor_amq.sh
#!/bin/sh# #Description: get activemq dataip=192.168.0.139port=8161queuename=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
2. Edit zabbix_agentd.conf
#Monitor activemquserparameter=activemq.pending,/etc/zabbix/scripts/check_activemq.sh PendingUserParameter= Activemq.consumers,/etc/zabbix/scripts/check_activemq.sh consumersuserparameter=activemq.enqueued,/etc/zabbix/ Scripts/check_activemq.sh enqueueduserparameter=activemq.dequeued,/etc/zabbix/scripts/check_activemq.sh Dequeueduserparameter=activemq.warn_pending,/etc/zabbix/scripts/check_activemq.sh warn_pending
3. Write the item
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/80/23/wKiom1c5OAjBsX3HAAa7niyuysE321.jpg "title=" Amq.jpg "alt=" Wkiom1c5oajbsx3haaa7niyuyse321.jpg "/>
4. Or upload the Attachment monitor template
This article from the "Do not ask for the best, only better" blog, please be sure to keep this source http://yujianglei.blog.51cto.com/7215578/1773826
Zabbix Monitoring Message Queuing activemq