Zabbix In addition to its own template provides monitoring CPU, disk capacity, memory, such as the "Old three" function, but also can choose to monitor the server designated programs, in general, the company will have their own developers in Java or C + + write some programs on their respective servers run, and Zabbix can implement "monitoring these programs and whether the ports are working properly".
In fact, the principle of Zabbix monitoring related programs is very simple, in fact, is to look at the number of files in the background, if the number and operation to set the number of the same, then Zabbix basically think this program is running in the background, it will not trigger the alarm. Conversely, there will be a corresponding alarm.
Zabbix_server See "The number of files in the background" the corresponding key is: Proc.num[<name>,<user>,<state>,<cmdline>], the specific meaning is as follows:
<name>: Process name, default to "all Processes";
<user>: User name, default "all users";
<state>: Available values, 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, it is recommended to use this instead of the name above, because this is more accurate.
Thousand said million said than an example, now I want to monitor a module called Mrs, which is an internal module of our company, as for the content of the ghost know, this is not our care, our care is whether it runs in the background. First of all, we first landed this Mrs module in the server, check it now running a few background programs, since it is our PL written in Java program, it will naturally use #ps-ef | grep java .
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/85/F6/wKiom1exH27jcbiRAABNcgYoySk533.png "title=" 1.png " alt= "Wkiom1exh27jcbiraabncgyoysk533.png"/>
As you can see, although this mrs-012 has three lines of Java-related processes, but only one is the Mrs Program, the other is zookeeper, and one is Gerp, these two are not what we want, so the number of background Mrs Process is 1.
Then we'll go back to zabbix-server. Use the Zabbix_get command to see if Zabbix_server can get this "1".
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/85/F6/wKiom1exJADSv1TPAAAz4CrcYbY287.png "title=" 1.png " alt= "Wkiom1exjadsv1tpaaaz4crcyby287.png"/> See, the number of Mrs Process is the number of 1,java process is 2, the same as the real result, so we have the bottom of the heart, this key can be used, can be added directly to the item.
Thus, in the Zabbix Web interface---The configuration---templates/hosts add an item,
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/85/F6/wKioL1exIZHT9JMzAADEDbUZF58862.png-wh_500x0-wm_3 -wmp_4-s_479252653.png "title=" 1.png "alt=" Wkiol1exizht9jmzaadedbuzf58862.png-wh_50 "/>
With the item also have trigger, we all have key also worry about what trigger, directly engage!
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/85/F6/wKioL1exIhrDAyb1AABvt0dQbRU462.png-wh_500x0-wm_3 -wmp_4-s_1615513958.png "title=" 1.png "alt=" Wkiol1exihrdayb1aabvt0dqbru462.png-wh_50 "/>
This expression means that the most recent Mrs Program number of 0 will trigger the high level of the alarm, if you think such a discriminant statement is more prone to false positives, you can change the expression statement, changed to: {templates name/hosts name: Proc.num[,root,all,java].max (#2)}=0}, that is, the last two times a value of 0 will trigger an alarm, so the correct rate may be higher.
As for the action God Horse, is to see a person likes. Not much to repeat here.
Reference: http://blog.csdn.net/apache0554/article/details/45821591
This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1837990
Zabbix detailed steps to monitor specific programs