linux zabbix监控进程和日志
自定义监控进程
以httpd服务为例,在agent1中安装httpd
[root@agent ~]# yum -y install httpd
[root@agent ~]# systemctl restart httpd
[root@agent ~]# systemctl enable httpd
[root@agent ~]# ps -ef | grep httpd
root 2237 1 0 13:42 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 2239 2237 0 13:42 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 2240 2237 0 13:42 ? 00:00:04 /usr/sbin/httpd -DFOREGROUND
apache 2241 2237 0 13:42 ? 00:00:03 /usr/sbin/httpd -DFOREGROUND
apache 2242 2237 0 13:42 ? 00:00:03 /usr/sbin/httpd -DFOREGROUND
apache 3341 2237 0 16:30 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
root 5788 5730 0 19:02 pts/4 00:00:00 grep --color=auto httpd
[root@agent ~]# ps -ef | grep httpd | grep -v grep | wc -l
5
[root@agent ~]# ps -ef | grep -v grep | grep -c httpd