# 适用于C++服务PID获取方法 UserParameter=Cpid[*],pgrep $1 # 适用于C++服务的句柄数 UserParameter=C_handle[*],sshpass -p admin12345 ssh -p 2343 -o StrictHostKeyChecking=no root@127.0.0.1 "ls -l /proc/\`pgrep \$1\`/fd | wc -l" # 适用于C++服务获取CPU% UserParameter=C_CPUPer[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getCCPUPer.sh $1 # 适用于java服务PID获取方法 UserParameter=Jpid[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getPID.sh $1 # 适用于java服务的句柄数 UserParameter=J_handle[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getHandle.sh $1 # 适用于java服务获取虚拟内存 UserParameter=JVirt[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getVirtMem.sh $1 # 适用于java服务获取物理内存 UserParameter=JRSS[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getRSSMem.sh $1 # 适用于java服务获取CPU% UserParameter=JCPUPer[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getCPUPer.sh $1 # 适用于java服务获取Mem% UserParameter=JMemPer[*],/usr/local/zabbix/etc/zabbix_agentd.conf.d/getMemPer.sh $1 # 网络连接状态、socket UserParameter=socket.tcp_listen,ss state all |grep "\bLISTEN\b" |wc -l UserParameter=socket.tcp_synsent,ss state all |grep "\bSYN-SENT\b" |wc -l UserParameter=socket.tcp_synrecv,ss state all |grep "\bSYN-RECV\b" |wc -l UserParameter=socket.tcp_established,ss -s |awk '/estab/ {print $4}' |cut -d',' -f1 UserParameter=socket.tcp_finwait1,ss state all |grep "\bFIN-WAIT1\b" |wc -l UserParameter=socket.tcp_finwait2,ss state all |grep "\bFIN-WAIT2\b" |wc -l UserParameter=socket.tcp_closewait,ss state all |grep "\bCLOSE-WAIT\b"|wc -l UserParameter=socket.tcp_closing,ss state all |grep "\bCLOSING\b" |wc -l UserParameter=socket.tcp_lastack,ss state all |grep "\bLAST-ACK\b" |wc -l UserParameter=socket.tcp_timewait,awk '/TCP:/ {print $7}' /proc/net/sockstat UserParameter=socket.total_sockets,awk '/sockets:/ {print $3}' /proc/net/sockstat UserParameter=socket.tcp_inuse,awk '/TCP:/ {print $3}' /proc/net/sockstat UserParameter=socket.tcp_orphan,awk '/TCP:/ {print $5}' /proc/net/sockstat UserParameter=socket.tcp_alloc,awk '/TCP:/ {print $9}' /proc/net/sockstat UserParameter=socket.tcp_mem,awk '/TCP:/ {print $11}' /proc/net/sockstat UserParameter=socket.udp_inuse,awk '/UDP:/ {print $3}' /proc/net/sockstat # 443端口连接数 UserParameter=netstat.443,netstat -n | grep tcp | grep 443 | wc -l