Zabbix Monitor Business process changes

Source: Internet
Author: User
Tags diff

Zabbix Monitoring process Downtime

Business requirements Back-end process can be quickly pulled up in a short period of time, the business impact is small, but the development needs to see coredump, the needto monitor the PID changes, under the existing framework Zabbix can monitor and alarm;

of course Zabbix set alarm settings is no longer one by one

Set the path on each server /etc/zabbix/zabbix_agentd.conf : This example requires only piddiff.sh

userparameter=checkpid,sh/usr/local/script/piddiff.sh

userparameter=test,sh/usr/local/script/test.sh

userparameter=discovery.process,/usr/local/script/disprocess.sh

Userparameter=process.check[*],/usr/local/script/proc_check.sh $ $


/usr/local/script below to store scripts

Vim piddiff.sh

aapid for business monitoring ID

#/bin/sh
Onl_ok=1
Onl_cored=3
Dir=/usr/local/script
if [[!-F "$dir/old.txt"]];then
PS aux|grep aapid |grep-v grep|grep-v/bin/bash|awk ' {print $2,$11} ' > $dir/old.txt
Else

Fi
PS aux|grep aapid |grep-v grep|grep-v/bin/bash|awk ' {print $2,$11} ' > $dir/now.txt
if! Diff-q $dir/old.txt $dir/now.txt >/dev/null; Then
Echo $onl _cored
Diff-c $dir/old.txt $dir/now.txt > $dir/' Date ' +%y%m%d%h%m "' _diff.txt
Cat $dir/now.txt > $dir/old.txt
Else
Echo $onl _OK
Fi

A simple judgment script;

Zabbix30 seconds will crawl once, normal unchanged to 1, there is a change of 3, then the Zabbix crawl value of 3 indicates that the PID has changed, will issue an alarm;

Zabbix Settings:

The monitoring item template is added as follows:


Trigger: {Template OS Linux:checkpid.last ()}=3



Zabbix Monitor Business process changes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.