Tuesday, July 17, 2012

Starting Zabbix Agent on Linux

Get Pre-compiled Zabbix agents from here
Add user Zabbix
#useradd  -c 'Zabbix monitoring' zabbix

Start agent service (as zabbix user)
sbin/zabbix_agentd -c /home/zabbix/server.conf
(Agent wont start with # prompt; login with "zabbix" before starting agent)

Server.conf file:
[zabbix@test ~]$ cat server.conf
Server=<ip_of_zabbix_server>
Hostname=test.smf.com
LogFile=/tmp/zabbix_agentd.log


Make sure you specify correct hostname in
- conf file before starting agent.
- Zabbix UI while adding the host.

In my case, I have:
[zabbix@test ~]$ hostname
test.smf.com
[zabbix@test ~]$

Hence, I gave test.smf.com in my conf file. And while adding host in zabbix UI, same name was specified.
You will get "active check errors" in client log file if proper hostname is not provided. Moreover, Zabbix Agent (Active) too will not work.
( Zabbix Agent (Active) is needed if you want to monitor log files)



Sample outputs:

[zabbix@test ~]$ cat /tmp/zabbix_agentd.log
 16494:20120718:052501.334 Starting Zabbix Agent [test.smf.com]. Zabbix 2.0.0 (revision 27675).
 16495:20120718:052501.335 agent #0 started [collector]
 16496:20120718:052501.337 agent #1 started [listener]
 16497:20120718:052501.337 agent #2 started [listener]
 16498:20120718:052501.338 agent #3 started [listener]
[zabbix@test ~]$

[zabbix@test ~]$ ps -ef | grep zabbix
zabbix   16494     1  0 05:25 ?        00:00:00 sbin/zabbix_agentd -c /home/zabbix/server.conf
zabbix   16495 16494  0 05:25 ?        00:00:00 sbin/zabbix_agentd -c /home/zabbix/server.conf
zabbix   16496 16494  0 05:25 ?        00:00:00 sbin/zabbix_agentd -c /home/zabbix/server.conf
zabbix   16497 16494  0 05:25 ?        00:00:00 sbin/zabbix_agentd -c /home/zabbix/server.conf
zabbix   16498 16494  0 05:25 ?        00:00:00 sbin/zabbix_agentd -c /home/zabbix/server.conf

No comments:

Post a Comment