1.0 Fast deployment of Zabbix 2.4 and 1.0zabbix2.4
1. Prepare the environment
CentOS 1, 6.4
Disable selinux and iptables
Two virtual machines: one Server and one Agent
2. Install the official yum Source
Install this yum source on all servers
| 1 |
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm |
3. Deploy Zabbix Server
| 1234567891011121314151617181920212223 |
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent mysql-server mysql -y/etc/init.d/mysqld startmysql -e "create database zabbix character set utf8 collate utf8_bin;"mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';" cd /usr/share/doc/zabbix-server-mysql-2.4.*/create/mysql -uroot zabbix < schema.sqlmysql -uroot zabbix < images.sqlmysql -uroot zabbix < data.sqlsed -i 's/^.*DBPassword=.*$/DBPassword=zabbix/' /etc/zabbix/zabbix_server.confservice zabbix-server startservice zabbix-agent start sed -i 's/^.*date.timezone =.*$/date.timezone = Asia\/Shanghai/g' /etc/php.inised -i 's/^.*post_max_size =.*$/post_max_size = 16M/g' /etc/php.inised -i 's/^.*max_execution_time =.*$/max_execution_time = 300/g' /etc/php.inised -i 's/^.*max_input_time =.*$/max_input_time = 300/g' /etc/php.iniservice httpd restart chkconfig mysqld onchkconfig zabbix-server onchkconfig zabbix-agent onchkconfig httpd on |
Open a browser to access http: // server_ip/zabbix/
Click Next...
Click Next...
Click 'test connection' to continue Next
Continue Next...
Continue Next...
Click 'finish 'to complete the page configuration.
Log On with the default account and password
Admin/zabbix note that the first Admin letter is in uppercase.
To change the page to Chinese:
| 12 |
sed -i '/zh_CN/ s/false/true/' /usr/share/zabbix/include/locales.inc.php/etc/init.d/httpd restart |
Now you can see that you can select Chinese, which is effective after.
Enable Zabbix Server monitoring:
Click continue as shown in the following figure to enable the monitoring function of the default Zabbix Server.
The image cannot display Chinese characters:
After the language is switched to Chinese, select any image ..
| 123456789 |
cd /usr/share/zabbix/fontsmv graphfont.ttf graphfont.ttf.bakwget -SO graphfont.ttf http://v.dbsa.cn/zabbix/DejaVuSans.ttf # Do not replace graphfont. ttf# Download the font file. ttf#vi /usr/share/zabbix/include/defines.inc.php# ('Zbx _ GRAPH_FONT_NAME ', 'graphfont'); # Replace graphfont with the downloaded file name.# ('Zbx _ FONT_NAME ', 'graphfont'); # Replace graphfont with the downloaded file name. |
Follow logs
| 12345678 |
tail -f /var/log/zabbix/zabbix_server.log 1943:20141126:142146.893 server #23 started [history syncer #4] 1942:20141126:142146.893 server #22 started [history syncer #3] 1947:20141126:142146.900 server #25 started [proxy poller #1] 1946:20141126:142146.900 server #24 started [escalator #1] 1950:20141126:142146.906 server #26 started [self-monitoring #1] 1935:20141126:142147.096 server #19 started [discoverer #1] 1922:20141126:144903.783 cannot send list of active checks to [127.0.0.1]: host [Zabbix server] not monitored |
There is a 'could not send list of active checks to' type which is not an error. The Zabbix Agent (active) will be updated later to describe this situation.
4. Deploy Zabbix Agent
| 12345678910111213 |
yum install zabbix-agent zabbix-sender zabbix-get -y [root@localhost ~]# grep -vE '(^$|^\#)' /etc/zabbix/zabbix_agentd.confPidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix/zabbix_agentd.logLogFileSize=0Server=172.16.43.40 # Modify the IP address to the Server. Multiple IP addresses are supported, which are separated by commas (,). If domain names are used, reverse resolution is required.ServerActive=172.16.43.40 # Modify the IP address to the Server. You cannot write multiple IP addresses.HostnameItem=system.hostname# By default, the Hostname must be manually specified. Instead, the HostnameItem can be automatically obtained using the internal key.Include=/etc/zabbix/zabbix_agentd.d/ /etc/init.d/zabbix-agent startchkconfig zabbix-agent on |
Follow logs
| 12345678910 |
tail -n50 -f /var/log/zabbix/zabbix_agentd.log 1526:20141126:150356.024 Starting Zabbix Agent [localhost.localdomain]. Zabbix 2.4.2 (revision 50419). 1526:20141126:150356.024 using configuration file: /etc/zabbix/zabbix_agentd.conf 1526:20141126:150356.025 agent #0 started [main process] 1530:20141126:150356.026 agent #4 started [listener #3] 1529:20141126:150356.026 agent #3 started [listener #2] 1531:20141126:150356.026 agent #5 started [active checks #1] 1528:20141126:150356.027 agent #2 started [listener #1] 1527:20141126:150356.027 agent #1 started [collector] 1531:20141126:150356.062 no active checks on server [172.16.43.40:10051]: host [localhost.localdomain] not found |
Similarly, 'no active checks on Server' is not an error. The blog will be described later.
5. Add a host on the Server to use the Agent for monitoring.