AMP AMP

How to add Linux Host in Zabbix Server on CentOS

To add Linux Host in Zabbix Server on CentOS

Zabbix has the capability to scan the network and add all the hosts in Zabbix server. After installing Zabbix next step is to add some hosts into the Zabbix server for monitoring. It allows the users to add any hosts like network switch, routers and computer systems that are connected to the network. This article explains how to add Linux host in Zabbix Server.


Testing Environment

Zabbix Server:

IP Address - 192.168.5.141
Host Name - linuxhelp.zabbix.com

Zabbix Host:

IP Address - 192.168.5.144
Host Name - client.zabbix.com


To add Host into Zabbix

First install Zabbix agent to add the host. Utilize the following command to add the repository.

[root@client ~]# rpm -Uvh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-agent-2.4.7-1.el6.x86_64.rpm
Retrieving http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-agent-2.4.7-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.tBE0jW: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY
error: Failed dependencies:
    zabbix is needed by zabbix-agent-2.4.7-1.el6.x86_64


To install the zabbix agent package

Run the following command to install the Zabbix agent.

[root@client ~]# yum install zabbix-agent -y
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: kartolo.sby.datautama.net.id
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Resolving Dependencies
-->  Running transaction check
--->  Package zabbix-agent.x86_64 0:1.8.22-1.el6 will be installed
-->  Processing Dependency: zabbix = 1.8.22-1.el6 for package: zabbix-agent-1.8.22-1.el6.x86_64
-->  Running transaction check
--->  Package zabbix.x86_64 0:1.8.22-1.el6 will be installed
-->  Finished Dependency Resolution
.
.
.
Installed:
  zabbix-agent.x86_64 0:1.8.22-1.el6                                                                                                                                                

Dependency Installed:
  zabbix.x86_64 0:1.8.22-1.el6                                                                                                                                                      

Complete!

Next edit the Zabbix configuration file as shown below,

[root@client ~]# vim /etc/zabbix/zabbix_agentd.conf

Entry:

Server=192.168.5.141
Hostname=client.zabbix.com

Once you modified the configuration file, restart the service by using the following command.

[root@client ~]# service zabbix-agent restart
Shutting down Zabbix agent:                                [  OK  ]
Starting Zabbix agent:                                     [  OK  ]

Open the browser and login to Zabbix server with the user credentials.

To add host, navigate to Configuration -> Hosts.

Then click on Create Host option.

Here you need to add the following details and click on add option.

Finally you can see the added host into the Zabbix server.

FAQ
Q
How do I migrate from one database to another in Zabbix server?
A
Dump data only (for MySQL, use flag -t or --no-create-info), create the new database using schema files from Zabbix and import the data.
Q
Why my graphs have dots instead of lines or empty areas in Zabbix?
A
Data is missing. This can happen for a variety of reasons - performance problems on Zabbix database, Zabbix server, network, monitored devices…
Q
What is the structure of IDs in the database for distributed monitoring?
A
NNNSSSDDDDDDDDDDD, where NNN - nodeid (to which node the ID belongs to), SSS - source nodeid (in which node was the ID created), DDDDDDDDDDD - the ID itself.
Q
Why i am getting Zabbix daemons fail to start up with a message Listener failed with error: socket() for [[-]:10050] failed with error 22:?
A
This error arises at attempt to run Zabbix agent compiled on version 2.6.27 or above on a platform with a kernel 2.6.26 and lower.
Q
How can I change graph background colour in a custom theme?
A
See graph_theme table in the database and theming guide.