Last modified: Oct. 22, 2010
Contents
1 - Summary
2 - Zabbix Agent installation
3 - Service configuration
4 - Service check
1 - Summary
This guide will show how to install the Zabbix Agent in FreeBSD. The Zabbix
Agent is the client software that installs on the servers and sends information
to the Zabbix server. Zabbix is an open source monitoring solution. This has
been tested in FreeBSD 8.1.
2 - Zabbix Agent installation
Install the zabbix-agent package.
# sudo pkg_add -r zabbix-agent
Password:
3 - Service configuration
Find where the zabbix agent daemon was installed to.
# pkg_info -L zabbix-agent-* | grep sbin
/usr/local/sbin/zabbix_agent
/usr/local/sbin/zabbix_agentd
Edit /etc/rc.conf.local so that the zabbix agent service will start when the
system starts up. Somewhere in the file add the following.
zabbix_agentd_enable="YES"
# sudo vi /etc/rc.conf.local
Password:
Find where the configuration file should be put.
# grep .conf /usr/local/etc/rc.d/zabbix_agentd
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
required_files="/usr/local/etc/zabbix/${name}.conf"
load_rc_config $name
# strings /usr/local/sbin/zabbix_agentd | grep zabbix_agentd.conf
/usr/local/etc/zabbix/zabbix_agentd.conf
You can create your own configuration file. Here is a simple example.
Hostname=server.test.com
ServerPort=10051
Server=zabbix.test.com
# pkg_info -L zabbix-agent-* | grep zabbix_agentd.conf
/usr/local/etc/zabbix/zabbix_agentd.conf.sample
# sudo cp /usr/local/etc/zabbix/zabbix_agentd.conf.sample /usr/local/etc/zabbix/zabbix_agentd.conf
Password:
# sudo cp /usr/local/etc/zabbix/zabbix_agentd.conf /usr/local/etc/zabbix/zabbix_agentd.conf.example
Password:
# sudo chmod u+w /usr/local/etc/zabbix/zabbix_agentd.conf
Password:
# sudo vi /usr/local/etc/zabbix/zabbix_agentd.conf
Password:
Before starting the service, make sure that tcp port 10050 is open in case you
are running firewall software. Here is a sample rule.
# su - root
Password:
ext_if="em0"
tcp_services={ 10050 }"
pass in on $ext_if proto tcp from any to ($ext_if) port $tcp_services flags S/SA keep state
# cp /etc/pf.conf /etc/pf.conf.previous
# vi /etc/pf.conf
# pfctl -F all && pfctl -f /etc/pf.conf
# logout
Start the zabbix agent service.
# sudo /usr/local/etc/rc.d/zabbix_agentd start
Password:
Starting zabbix_agentd.
# sudo /usr/local/etc/rc.d/zabbix_agentd status
Password:
zabbix_agentd is running as pid 71684 71685 71686 71687 71688 71689.
4 - Service check
Reboot your computer. Log in like normal and check to see that the zabbix
agent service is running. That's it, now you have the zabbix agent running in
FreeBSD.
# sudo shutdown -r now
Password:
# sudo /usr/local/etc/rc.d/zabbix_agentd status
Password:
zabbix_agentd is running as pid 723 731 732 733 734 735.
|