Use zabbix's built-in key to monitor processes and ports
Every company has its own program, its own process name and port listening. For Nagios, these often need to write their own plug-ins, but zabbix does not need them, it has its own monitoring process and port key.
Before using the zabbix key to monitor processes and ports, I also wrote the plug-in myself, but it is uncomfortable to use it because it requires configuration and maintenance on all agents. If you use zabbix's built-in functions, you only need to maintain them on the server. It's just the difference between exercise and exercise. Why didn't I find this feature early.
Start with the question ......
1. Monitoring Port
The monitoring port uses the following key:
Key: net. tcp. Listen [port]
Checks if this port is in listen state. 0-it is not, 1-it is inlisten state.
Translation: listening port status. If the returned result is 1, it runs. If the returned result is 0, it does not run.
For example, monitoring port 443, net. tcp. Listen [443]
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/48/6B/wKiom1QH7NvhGfSIAAF7wgU_Y7M306.jpg "style =" float: none; "Title =" 1 "alt =" wkiom1q1_nvhgfsiaaf7wgu_y7m306.jpg "/>
2. Monitoring Process
If a process does not have a listening port, you can use the following key.
Key: Proc. Num [<name >,< user >,< state >,< cmdline>]
Number of processes. <Name> and <user> same as inproc. mem item. <State> All (default), run, sleep, zomb. <shortline> filter by command line (supports RegEx ).
Name: process name
User: the user who runs the process
State: The Process status includes run, sleep, and zomb.
Line: Fuzzy match indicates that the field is included in the last column of PS aux.
Note: The name match may not be accurate. Generally, the process is matched based on cmdline.
For example, monitoring cond, Proc. Num [, root, all, crond]
The configuration is as follows:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/48/6C/wKioL1QH7ODyJfXdAAIEsYjNt-g353.jpg "Title =" 2 "style =" float: none; "alt =" wKioL1QH7ODyJfXdAAIEsYjNt-g353.jpg "/>
3. Trigger Configuration
For port monitoring, the return value is 1. For process monitoring, the return value is> = 1. If the return value is 0, the process is down.
For example, configure a trigger for port 443 as follows:
If the last two results are equal to 0, an alarm is triggered. The process trigger configuration is the same.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/48/6B/wKiom1QH7NvQ9oMtAADok345-Jo880.jpg "Title =" 3 "style =" float: none; "alt =" wKiom1QH7NvQ9oMtAADok345-Jo880.jpg "/>
Zabbix is too convenient for the monitoring process and port survival status. Recently, I am studying zabbix by myself. I will explore more useful functions. Please leave a message.
This article from the "this is my hometown" blog, please be sure to keep this source http://yangrong.blog.51cto.com/6945369/1548670
The original zabbix monitoring process and port is so simple!