Difference between revisions of "Zabbix agent setup"

 
Line 46: Line 46:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
# List of passive zabbix server (comma separation)    ~ line 85
 
# List of passive zabbix server (comma separation)    ~ line 85
Server=172.16.50.3
+
Server=172.16.50.223
  
 
# List of active zabbix server (comma separation)    ~ line 126
 
# List of active zabbix server (comma separation)    ~ line 126
ServerActive=172.16.50.3
+
ServerActive=172.16.50.223
  
 
# Do not override a default hostname, use the O.S hostname instead.  
 
# Do not override a default hostname, use the O.S hostname instead.  

Latest revision as of 14:39, 11 May 2015


I'm using the Zabbix monitoring solution [1]. So I have to install a Zabbix agent on my client distribution to retrieve data.

>> The Zabbix documentation is really complete! Don't forget to check it out if you're using a different version |and|or| want to know more about the installation details. See https://www.zabbix.com/documentation/


Zabbix agent installation

Source: https://www.zabbix.com/documentation/2.2/manual/installation/install_from_packages


Add zabbix repository

wget http://repo.zabbix.com/zabbix/2.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.2-1+trusty_all.deb
dpkg -i zabbix-release_2.2-1+trusty_all.deb
apt-get update


Install zabbit agent

apt-get install zabbix-agent



Zabbix agent configuration

See https://www.zabbix.com/documentation/2.2/manual/appendix/config/zabbix_agentd for parameters details.


Edit the Zabbix agent configuration file:

vim /etc/zabbix/zabbix_agentd.conf


Adjust the following settings:

# List of passive zabbix server (comma separation)    ~ line 85
Server=172.16.50.223

# List of active zabbix server (comma separation)    ~ line 126
ServerActive=172.16.50.223

# Do not override a default hostname, use the O.S hostname instead. 
# You MUST comment the Hostname instruction           ~ line 137
#Hostname=Zabbix server


# Enable remote command and server push
EnableRemoteCommands=1
ListenPort=10050
ListenIP=0.0.0.0
StartAgents=3

### Option: RefreshActiveChecks
#       How often list of active checks is refreshed, in seconds.
RefreshActiveChecks=120


Firewall

For the Zabbix Agent to work, both TCP 10050 (zabbix client) and TCP 10051 (zabbix server) IN + OUT must be open!

See:


Zabbix host registration (server side)

On the Zabbix server, you can now register the new host.

Configuration > Hosts > Create


NetBoot client specifics

When you're using NetBoot and tmpfs you'll run into specifics issues. The following part is my return of experience.


Zabbix launcher script

The application requires some files and folders to run. Without these it will always failed to start.


Problem: in our case these files are mount in tmpfs = they will not exist by default. You have to adjust the zabbix startup script to create it!


Edit the Zabbix agent configuration file:

vim /etc/init.d/zabbix-agent


Add the following commands around line 18.

LOG_DIR=/var/log/zabbix
LOG_FILE=$LOG_DIR/zabbix_agentd.log

if test ! -d "$LOG_DIR"; then
   mkdir "$LOG_DIR"
   touch "$LOG_FILE"
   chown -R zabbix:zabbix "$LOG_DIR"
fi



Sources

Zabbix documentation


Zabbix bug reporting