zabbix使用用户自定义键值来监控应用系统连接数:

1、修改配置文件zabbix_agentd.conf

格式: UserParameter=<key>,<shell command>

加入一行:UserParameter=connections,netstat -n| grep 12345| wc –l

[rusky@zabbix etc]$ pwd                  
/home/rusky/zabbix/etc
[rusky@zabbix etc]$ ls
zabbix_agent.conf  zabbix_agent.conf.d  zabbix_agentd.conf  zabbix_agentd.conf.d
[rusky@zabbix etc]$ vi zabbix_agentd.conf

####### USER-DEFINED MONITORED PARAMETERS ####### 

### Option: UnsafeUserParameters
#       Allow all characters to be passed in arguments to user-defined parameters.
#       0 - do not allow
#       1 - allow
#
# Mandatory: no
# Range: 0-1
# Default:
# UnsafeUserParameters=0
### Option: UserParameter
#       User-defined parameter to monitor. There can be several user-defined parameters.
#       Format: UserParameter=<key>,<shell command>
#       See 'zabbix_agentd' directory for examples.
#
# Mandatory: no
# Default:
# UserParameter=
UserParameter=connections,netstat -n| grep 12345| wc -l 

2、Web界面添加监控项

zabbix监控应用连接数

Name值自己定义,Key值为我们配置文件里的key值Connections,其它参数可默认。

zabbix监控应用连接数

修改完后,点Add添加即可。

相关文章:

  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-12-06
  • 2021-09-20
  • 2022-12-23
猜你喜欢
  • 2021-07-04
  • 2021-05-11
  • 2021-09-10
  • 2021-06-19
  • 2021-12-30
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案