返回总目录页

zabbix第二篇

 常用命令

查看版本

[root@zabbix001 xx]# zabbix_server -V 
zabbix_server (Zabbix) 4.2.8
Revision cb5d5b10f4 28 October 2019, compilation time: Oct 28 2019 11:17:55

Copyright (C) 2019 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).

Compiled with OpenSSL 1.0.1e-fips 11 Feb 2013
Running with OpenSSL 1.0.1e-fips 11 Feb 2013
[root@zabbix001 xx]# 

 

zabbix_get

 

zabbix_get命令是在server端用来检查agent端的一个命令,在添加完主机或者触发器后,不能正常获得数据,可以用zabbix_get来检查能否采集到数据,以便判断问题症结所在。

 
zabbix_get 参数说明:
 
-s --host: 指定客户端主机名或者IP
-p --port:客户端端口,默认10050
-I --source-address:指定源IP,写上zabbix server的ip地址即可,一般留空,服务器如果有多ip的时候,你指定一个。
-k --key:你想获取的key
至于使用长参数还是短的,自己选,我经常使用-s而不是-host,
 
 
 
如果不知道key参数可以使用 zabbix_agentd -p 寻找自己想要找的参数
[root@host~]# zabbix_agentd -p | grep system.cpu.load
system.cpu.load[all,avg1] [d|0.040000]
 
如果不知道zabbix_get在什么路径,可以使用find / -name zabbix_get查找
 
[root@host ~]# find / -name zabbix_get
/usr/local/zabbix/bin/zabbix_get
/data/tools/zabbix-4.0.3/src/zabbix_get
/data/tools/zabbix-4.0.3/src/zabbix_get/zabbix_get
 
案例:
[root@zabbix ~]# zabbix_get -s 192.168.1.7 -p 10050 -k system.cpu.load[all,avg1]
0.000000
 
 

nginx vip添加ping检测告警案例

只需要加个触发器,默认有个监控项

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
posted @ 2023-10-11 10:09  马昌伟  阅读(15)  评论(0编辑  收藏  举报
博主链接地址:https://www.cnblogs.com/machangwei-8/