Zabbix automatic Discovery Monitoring tomcat Health Page
Zabbix automatic Discovery Monitoring tomcat Health Page
I. background
The company's system platform has more than 10 tomcat services. Due to the need for the service to maintain uninterrupted service throughout the year, a special monitoring page is embedded in tomcat. When the return value of the special curl page is 200, the service is determined to be running normally, otherwise the alarm will be sent to the mailbox of the special monitoring operation and maintenance staff.
Second, principle
The normal tomcat health monitoring page is shown below
We use the following command to determine whether the return value is 200
Shell > / usr/bin/curl-o / dev/null-s-connect-timeout 5-w'% {http_code} 'http://10.0.0.107:9100/sms-app/health
If the returned value is not 200, it is determined that the service is abnormal and the alarm will be given.
3. The specific auto-discovery operations are deployed as follows
1. First define the URL that needs to monitor the automatically discovered tomcat.
The following content
1. Cat > / etc/zabbix/WEB.txt / dev/null 2 > & 1#/usr/bin/curl-o / dev/null-s-w% {http_code} http://$1/ web_site_discovery () {WEB_SITE= ($(cat / etc/zabbix/WEB.txt | grep-v "^ #")) printf'{\ n' printf'\ t "data": [\ n'for