Recently, because of the JMS message accumulation caused APACHEMQ frequency failure (the message has not been consumed, causing its database to reach 1.2G,JMS at this time directly hanging off), it is depressed! I was just studying Zabbix. Since Zabbix is so powerful, can it monitor my directory size? After searching the internet for a long time, there was no result. At this time, think of this before the import of other templates, so decided to modify the template, changed to change the problem! But the idea is already there. So I have the article.
With the demand, you can start directly! For the convenience of memory, I will write detailed steps.
Requirements: To monitor/usr/local/activemq5.5/data/kahadb This directory, when this directory space reached 100M, immediately alarm!
This identity is identified when the data is sent by defining the appropriate key on the client side. When the server collects the data, it takes the key and puts it into the corresponding graph.
The first step: Modify the Client configuration file and add the following line!
# vim/etc/zabbix/zabbix_agentd.conf
Userparameter=disk.kahadb,/etc/zabbix/scripts/disk-kahadb
Step Two: Add the disk-kahadb script
# CAT/ETC/ZABBIX/SCRIPTS/DISK-KAHADB
#!/bin/bash
est= ' Sudo/usr/bin/du-m/usr/local/activemq5.5/data/kahadb/| Cut-f1 | Cut-d "M"-f1 '
Echo $est
Step three: Authorize this script
chmod 777/etc/zabbix/scripts/disk-kahadb
Restarting the Zabbix client
Server-side------------>
Fourth step, start the graphical operation
A, add a template group apachemq-kahadb, at this time you can also add a few hosts in!
B, after the addition of the finished.
C, the next step is to add applications,items,triggers three-step song!
D, add Iteams in applictions, please note the red
E, add Tigers
Added after success!
F, click on the graphs can add graphics
G, connect this template on a host!
H, Success! I don't write about Tigger, it's too much trouble.
Monitor a directory size with Zabbix