Zabbix_get命令

命令的作用:在zabbix server上执行zabbix_get命令来试着获取被监控端的item值
命令在zabbix安装目录bin下,如果是window命令自然是zabbix_get.exe,使用方法都是一样的。端口和源(绑定)IP是可选的,其他参数不能漏掉

# /usr/local/zabbix-2.2.1/bin/zabbix_get -h
 Zabbix get v2.2.1 (revision 40808) (09 December 2013)
usage: zabbix_get [-hV] -s <host name or IP> [-p <port>] [-I <IP address>] -k <key>
Options:
 -s --host <host name or IP>          Specify host name or IP address of a host
 -p --port <port number>              Specify port number of agent running on the host. Default is 10050
 -I --source-address <IP address>     Specify source IP address
-k --key <key of metric>             Specify key of item to retrieve value for
-h --help                            Give this help
 -V --version                         Display version number
Example: zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]"

继续阅读Zabbix_get命令

Zabbix监控Linux主机

上篇文章中,Zabbix-server已经配置好了,现用它来监控网络中的linux主机。
在被监控LINUX上安装zabbix-agent

yum -y install zabbix20-agent
vim /etc/zabbix_agentd.conf //更改Server=192.168.110.152(服务端ip)
启动客户端 
/etc/init.d/zabbix-agent start
开机自启动
 chkconfig zabbix-agent on
服务端上命令行测试:zabbix_get -s 客户端ip -p10050 -k "system.hostname”

继续阅读Zabbix监控Linux主机

zabbix在mysql改密码后前台php报错无法登入

因刚开始安装zabbix时,在mysql中创建的同名zabbix账号弱口令,修改密码后,前台php一直报错:

[Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

查看zabbix_server.log:

25877:20140304:160513.718 [Z3005] query failed: [1317] Query execution was interrupted [select h.hostid,h.host,h.name,t.httptestid,
t.name,t.variables,t.agent,t.authentication,t.http_user,t.http_password,t.http_proxy,t.retries from httptest t,hosts h where t.hosti
d=h.hostid and t.nextcheck&lt;=1393920313 and mod(t.httptestid,1)=0 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.mai
ntenance_status=0 or h.maintenance_type=0)]
25877:20140304:160513.718 [Z3005] query failed: [2006] MySQL server has gone away [select min(t.nextcheck) from httptest t,hosts h
where t.hostid=h.hostid and mod(t.httptestid,1)=0 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.maintenance_status
=0 or h.maintenance_type=0)]
25877:20140304:160513.719 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

25877:20140304:160513.718 [Z3005] query failed: [1317] Query execution was interrupted [select h.hostid,h.host,h.name,t.httptestid,
t.name,t.variables,t.agent,t.authentication,t.http_user,t.http_password,t.http_proxy,t.retries from httptest t,hosts h where t.hosti
d=h.hostid and t.nextcheck&lt;=1393920313 and mod(t.httptestid,1)=0 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.mai
ntenance_status=0 or h.maintenance_type=0)]
25877:20140304:160513.718 [Z3005] query failed: [2006] MySQL server has gone away [select min(t.nextcheck) from httptest t,hosts h
where t.hostid=h.hostid and mod(t.httptestid,1)=0 and t.status=0 and h.proxy_hostid is null and h.status=0 and (h.maintenance_status
=0 or h.maintenance_type=0)]
25877:20140304:160513.719 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

继续阅读zabbix在mysql改密码后前台php报错无法登入