Reference http://chenx1242.blog.51cto.com/10430133/1837990
1 Pre-description
Zabbix_server The key that corresponds to the "number of files running in the background" is: PROC.NUM[<NAME>,<USER>,<STATE>,<CMDLINE>], specifically, the following:
<name>: The process name, which defaults to "all Processes";
<user>: user name, default "all users";
<state>: The available values, the default is all, can be further set such as Run,sleep and so on;
<cmdline>:p S-ef command-line filtering, where you can write regular expressions or keywords
2 For example, monitoring nginx Process
Ps EF | grep nginx
Root 15032 1 0 Nov17? 00:00:00 Nginx:master process/usr/sbin/nginx-c/etc/nginx/nginx.conf
Nginx 1522215032 0 Nov17? 00:04:36 Nginx:worker Process
Root 2336520018 0 14:56 pts/0 00:00:00 grep--color=auto nginx
there are altogether 3 processes about Nginx, one of which is root -initiated and the other is grep , so there is only one nginx process
3 viewing in zabbix-server
[Email protected]~]#/usr/local/zabbix/bin/zabbix_get-s 192.168.1.8-p 10050-k "Proc.num[,root,all,nginx]" 1
found the result is 1 , normal
4 Add item
in zabbix web interface ---configuration---templates/hosts add a item
650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/ M01/8a/db/wkiom1g9rp_swhpyaaa_zn8ja28133.png "title=" 1.png "alt=" Wkiom1g9rp_swhpyaaa_zn8ja28133.png "width=" 650 " Style= "Padding:0px;margin:0px;vertical-align:top;border:none;"/>
5 setting trigger
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8A/D7/wKioL1g9RSWRvSf1AABEPc5W0Ts270.png "title=" 2.png " alt= "Wkiol1g9rswrvsf1aabepc5w0ts270.png" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: None;float:none; "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8A/DB/wKiom1g9RSbxU3FjAABmOJeRvWk040.png "title=" 3.png " alt= "Wkiom1g9rsbxu3fjaabmojervwk040.png" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: None;float:none; "/>
thisexpressionIt means the last time.Mrsthe number of programs is0it will trigger . Highlevel of alarm,
If you also want to set the image can also be added to see a person's preferences.
6 Summary
with one example above, you can actually see that you can monitor a wide variety of processes, just make some changesto the key, "Proc.num[,root,all, process name ."
This article is from the "Yenokia" blog, make sure to keep this source http://yenokia.blog.51cto.com/1899385/1959250
Zabbix monitoring Nginx process