1. Install Basic Environment 1) LAMPsudoapt-getupdatesudoapt-getinstallapache2mysql-servermysql-clientphp5php5-gdphp5-mysql2) Basic Software
1. Install the Basic Environment
1) LAMP
Sudo apt-get update
Sudo apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql
2) Basic Software
Sudo aptitude install build make snmplibsnmp-devsnmpdlibmysql +++ devminicomlibcurl4-openssl-devfping
3) install the Basic Environment offline
Run the above installation on a computer that can access the internet. Install all the software. The default software is downloaded to/var/cache/apt/archives for packaging.
Tar-zcvf ~ /Var_apt.tar.gz/var/cache/apt
Copy to the Installation server to unpack
Var_apt.tar.gz-C/tar-zcvf/
Install all software packages under archives
Sudo dpkg-I *. deb
4) Fping configuration change
Run as root
Cp/usr/bin/fping/usr/sbin/
Cp/usr/bin/fping6/usr/sbin/
Chown root. zabbix/usr/sbin/fping
Chmod 710/usr/sbin/fping
Chmod ug + s/usr/sbin/fping
2. Install zabbix
1) Configure users and databases
* Create zabbix user groups and users:
Sudo useradd zabbix
Sudo adduser zabbix dialout (SMS cat user)
Sudo passwd zabbix
* Create a mysql database:
Sudo mysql-u root-p
Create database zabbix character set utf8;
* Create a mysql user:
Grant all on zabbix. * to zabbix @ localhost identified by 'zabbix ';
2) Import tables and data
Cd zabbix-1.8
Sudo mysql-uroot-p zabbix <create/schema/mysql. SQL
Sudo mysql-uroot-p zabbix <create/data/images_mysql. SQL
Sudo mysql-uroot-p zabbix <create/data. SQL
3) Configure Compilation
Tar zxf zabbix-1.8.tar.gz
Cd zabbix-1.8
Sudo./configure -- prefix =/usr/local/zabbix -- enable-server -- enable-agent -- enable-ipv6 -- with-mysql -- with-net-snmp ---
Libcurl -- with-ldap
Sudo make install
Configuration parameters:
-- Enable-server install Zabbix Server
-- Enable-proxy install Zabbix Proxy
-- Enable-agent install Zabbix Agent
-- With-mysql uses mysql as a database server
-- With-net-snmp supports SNMP
-- With-libcurl supports curl for web Monitoring
4) Service port Definition
Edit/etc/services and append the following content:
Zabbix-agent 10050/tcp # Zabbix Agent
Zabbix-agent 10050/udp # Zabbix Agent
Zabbix-trapper 10051/tcp # Zabbix Trapper
Zabbix-trapper 10051/udp # Zabbix Trapper
5) copy the configuration file
Sudo mkdir/etc/zabbix
Sudo chown-R zabbix. zabbix/etc/zabbix/
Sudo cp misc/conf/*/etc/zabbix
6) modify the zabbix server configuration file
Sudo vi/etc/zabbix/zabbix_server.conf
Modification content:
DBName = zabbix
DBUser = zabbix
DBPassword = zabbix
PidFile =/var/tmp/zabbix_server.pid
LogFile =/var/log/zabbix/zabbix_server.log
AlertScriptsPath =/etc/zabbix/alert
FpingLocation =/usr/local/sbin/fping
Finally, create a log directory:
Sudo mkdir/var/log/zabbix
Sudo chown-R zabbix. zabbix/var/log/zabbix/
Create a defined directory:
Sudo mkdir/etc/zabbix/alert
Sudo chown-R zabbix. zabbix/etc/zabbix/alert
7) modify the zabbix agentd configuration file
Sudo vi/etc/zabbix/zabbix_agentd.conf
Add the following content:
Server = 127.0.0.1
# ServerPort = 11051
Hostname = zabbix
PidFile =/var/tmp/zabbix_agentd.pid
LogFile =/var/log/zabbix/zabbix_agentd.log
8) configure the Startup Script
Copy the startup script:
Sudo cp misc/init. d/debian/zabbix-server/etc/init. d/zabbix-server
Sudo cp misc/init. d/debian/zabbix-agent/etc/init. d/zabbix-agent
Modify the server startup script:
Sudovi/etc/init. d/zabbix-server
Change DAEMON =/usr/local/sbin/$ {NAME} to DAEMON =/usr/local/zabbix/sbin/$ {NAME}
PID =/tmp/$ NAME. pid to PID =/var/tmp/$ NAME. pid
Modify the client Startup Script: Same as above
Enable startup
Sudo update-rc.d zabbix-server ults
Sudo update-rc.d zabbix-agent ults
9) configure the Web Interface
* Copy the Web Interface to the web directory:
Sudo mkdir/var/www/zabbix
Sudo chown-R zabbix. zabbix/var/www/zabbix
Cp-r frontends/php/*/var/www/zabbix
Edit the php. ini file:
Sudo vi/etc/php5/apache2/php. ini
Max_execution_time= 600
Max_input_time= 600
Memory_limit = 256 M
Post_max_size = 32 M
Upload_max_filesize = 16 M
; Date. timezone ==> remove comments and add Asia/Shanghai
Sudo vi/etc/apache2/apache2.conf
Add ServerName 127.0.0.1 to the following line
Restart apache, access http: // ip/zabbix, and initialize the configuration as prompted.