After you deploy Zabbix server, you naturally deploy the Zabbix agent. In the official description, the agent is deployed on the monitored machine to collect statistics on CPU, memory, disk, etc., and escalate it to the server for further processing. The method of collecting information of agent is also very efficient, which is done through the system call of native operating system.
Agent mainly through the passive and active two ways to report this machine information, as the name implies, the passive means that the server issued the acquisition command, the agent will collect information, and the active means that the agent will be the first time from the server to obtain the items to be collected, and periodically sends a new value for each item to the server side. The question is, is the agent collecting information through passive mode or active mode? The answer depends on which mode is used when you design the item in the server's monitoring interface, and the default is passive mode.
The agent can be deployed to almost any operating system, and in this series, we only use CentOS and Windows two operating systems to illustrate.
Deployed on CentOS
The specific operating system version is centOS6.5.
The first thing to do is to add Zabbix account, Zabbix agent and server, the default is to run under the Zabbix account.
Groupadd zabbixuseradd–g Zabbix Zabbix
Specific installation, but also can be divided into Yum installation and source installation, the following are described separately.
Yum Installation
Yum is easy to install and can be done in almost two lines.
RPM-IVH http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm Yum Install zabbix-agent
SOURCE Installation
- Download the source code and install
cd/usr/local/srctar xvf zabbix-2.4. 7. Tar . GZCD Zabbix-2.4. 7 . /configure--prefix=/usr/local/zabbix--enable-agentmake doinstall
CP /usr/local/src/zabbix-2.4. 7/misc/init.d/fedora/core/zabbix_agentd/etc/init.dvi /etc/init.d/zabbix_agentd# Modify Basedirbasedir=/usr/local/--add Zabbix_agentdchkconfig zabbix_agentd on
Either way, the next configuration file needs to be modified.
#日志最大值, default 1M, exceeds rotatelogfilesize=1#被动模式下服务器地址, can be IP or hostnameserver=192.168 . 0.1 #主动模式下服务器地址, either IP or hostnameserveractive=192.168. 0.1 #被监控机的ip或hostname, note that the value must be consistent with the server name that you defined in the server's monitoring interface hostname=192.168. 0.2
Finally, start the agent and see if it starts correctly.
service zabbix_agentd start# default log pathCat/tmp/zabbix_agentd.log# Start Normally, you should see something like this:9604:20151229:091802.672Starting Zabbix Agent [192.168.0.64]. Zabbix2.4.7(Revision56694).9604:20151229:091802.673Using configurationfile:/usr/local/zabbix/etc/zabbix_agentd.conf9604:20151229:091802.673Agent #0started [main process]9607:20151229:091802.675Agent #3started [Listener #2]9608:20151229:091802.676Agent #4started [Listener #3]9606:20151229:091802.677Agent #2started [Listener #1]9605:20151229:091802.677Agent #1started [collector]9609:20151229:091802.678Agent #5started [Active Checks #1]
However, "No active checks on server [192.9.199.132:10051]: host [192.168.0.139] is not found" error, meaning the server was not found when doing an active check. The solution is to add the monitoring machine in the server's "host", remember that the name must be the same as the hostname you defined in the agent's configuration file, and then restart the agent.
By default, the agent is running on port 10050, note that the firewall is opening this port.
-tlnp| grep zabbix# Note Firewall settings vi /etc/sysconfig/iptables# Add to 10050 ports open 10050 -J accept# Restart Firewall service iptables Restart
Deploy on Windows
The Windows version of the agent for Zabbix_agents_2.4.4.win.zip, unzip it, such as the C drive, enter the configuration file directory, modify the configuration file as follows:
#日志最大值, default 1M, exceeds rotatelogfilesize=1#被动模式下服务器地址, can be IP or hostnameserver=192.168 . 0.1 #主动模式下服务器地址, either IP or hostnameserveractive=192.168. 0.1 #被监控机的ip或hostname, note that the value must be consistent with the server name that you defined in the server's monitoring interface hostname=192.168. 0.3
Add the agent as a Windows Boot service and enter command-line mode.
-C C:\zabbix\conf\zabbix_agentd.win.conf–i
Start and stop of the agent under Windows.
-X
Similar to CentOS, logs can be viewed under the default C:\ZABBIX_AGENTD. If you have Windows Firewall restrictions, set the appropriate inbound rules and outbound rules, which are not mentioned here.
[Original] Zabbix Learning Tour Three: Agent installation