Architecture:
Nginx
php5
mysql
Install depends
#apt-get-y nginx php5-fpm php5-gd mysql-server php5-mysql libmysqld-dev libxml2-dev libsnmp-dev libcurl4-openssl-dev
Config PHP5-FPM
#/etc/php5/fpm/pool.d/www.conf...33349000#service php5-fpm restart
Config Nginx
#cp/etc/nginx/sites-available/default{,.bak}#vim/etc/nginx/sites-enabled/default... -# # root/usr/share/nginx/html; -Root/var/www/html/zabbix; -Index index.php index.html index.htm;... WuLocation ~ \.php$ { -Fastcgi_split_path_info ^ (. +\.php) (/.+) $; About# # Note:you should has "cgi.fix_pathinfo = 0;" In php.ini $# -# # with php5-cgi alone: -Fastcgi_pass127.0. 0. 1:9000; -# with PHP5-FPM: A# Fastcgi_pass Unix:/var/run/php5-fpm.sock; +Fastcgi_index index.php; theInclude Fastcgi_params; -}...#nginx-TNginx:the configuration file/etc/nginx/nginx.conf syntax is oknginx:configuration file/etc/nginx/nginx.conf test is su Ccessful#service Nginx Reload
Installing Zabbix daemons
Download and Untar pkg
#wget http://7mnldi.com1.z0.glb.clouddn.com/zabbix-2.2.10.tar.gz#tar -xf zabbix-2.2.10.tar.gz
Create user Account
#groupadd zabbix#useradd -g zabbix zabbix
Create Zabbix Database
For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is required. It is not a needed to run Zabbix agent.
SQL scripts is provided for creating database schema and inserting the dataset. Zabbix Proxy database needs only the
Schema while Zabbix server database requires also the dataset on top of the schema.
For example:config mysql
shell> mysql-u < username ; -P < password ; Mysql> CREATE database Zabbix character Set UTF8 collate utf8_bin;mysql> quit;shell> mysql-u < use Rname ; -P < password ; Zabbix < database / MySQL / schema.sql # stop here if you is creating database for Zabbix Proxy shell ; mysql-u < username ; -P < password ; Zabbix < database / mysql / images.sql Shell ; mysql-u < username ; -P < password > Zabbix < database / mysql / data.sql
Have created a Zabbix database, proceed to the following steps of compiling Zabbix.
Configure the sources
When configuring the sources for a Zabbix server or proxy, you must specify the database type to be used. Only one database type can is compiled with a server or proxy process at a time.
To see all of the supported configuration options, inside the extracted Zabbix source directory run:
#./configure --help
To configure the sources for a Zabbix server and agent, you could run something like:
#./configure--enable-server--enable-agent--with-mysql--enable-ipv6--with-net-snmp--with-libcurl--with-libxml2
NOTE:–WITH-LIBXML2 configuration option is required to virtual machine monitoring, supported since Zabbix 2.2.0.
To configure-the sources for a Zabbix server (with PostgreSQL etc), your may run:
#./configure--enable-server--with-postgresql--with-net-snmp
To configure the sources for a Zabbix proxies (with SQLite etc), you may run:
#./configure--prefix=/usr--enable-proxy--with-net-snmp--with-sqlite3--with-ssh2
To configure the sources for a Zabbix agent, your may run:
#./configure --enable-agent
Make and install everything
#make install
This step should is run as a user with sufficient permissions (commonly "root", or by using sudo ).
Running'll by make install default install the daemon binaries (zabbix_server, ZABBIX_AGENTD, Zabbix_proxy) in/usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in/usr/local/bin.
To specify a different location than/usr/local, use a --prefix key on the previous step of configuring sources, for example --prefix=/home/zabbix. In this case daemon binaries would be installed Under/sbin, while utilities under/bin. Man pages would be installed Under/share.
Review and edit configuration files
- Edit the Zabbix
agent configuration file/usr/local/etc/zabbix_agentd.conf
You need to configure the This file is every host with ZABBIX_AGENTD installed.
You must specify the Zabbix server IP address in the file. Connections from the other hosts would be denied.
- Edit the Zabbix server configuration file/usr/local/etc/zabbix_server.conf
You must specify the database name, user and password (if using any).
With SQLite the full path to database file must is specified; DB user and password is not required.
The rest of the parameters would suit you and their defaults if you had a small installation (up to ten monitored hosts). You should the default parameters if your want to maximize the performance of Zabbix server (or proxy) though. See the performance Tuning sections for more details.
- If you have installed a Zabbix proxy, edit the proxy configuration file/usr/local/etc/zabbix_proxy.conf
You must specify the server IP address and proxy hostname (must is known to the server), as well as the database name, use R and password (if using any)
With SQLite the full path to database file must is specified; DB user and password is not required.
Start up the Daemons
Run Zabbix_server on the server side.
#zabbix_server
Make sure this your system allows allocation of 36MB (or a bit more) of the shared memory, otherwise the server could not start And you'll see ' cannot allocate shared memory for. ' In the server log file. This could happen on FreeBSD, Solaris 8.
See the ' See also ' section at the bottom of this page to find out how to configure shared memory.
Run zabbix_agentd on all the monitored machines.
#zabbix_agentd
Make sure this your system allows allocation of 2MB of shared memory, otherwise the agent may not be start and you'll see " Cannot allocate shared memory for collector. ' In the agent log file. This could happen on Solaris 8.
If you have installed Zabbix proxy, run Zabbix_proxy.
#zabbix_proxy
Installing Zabbix Web Interface
Copying PHP Files
Zabbix frontend is written-PHP, so-to-run it a PHP supported webserver is needed. Installation is do by simply copying the PHP files from frontends/php to the Webserver HTML documents directory.
#mkdir /var/www/html/zabbix#cd frontends/php# cp -a . /var/www/html/zabbix
Installing Frontend
Step 1
In your browser, open Zabbix URL:http://
You should see the first screen of the Frontend Installation Wizard.
Step 2
Make sure, all software prerequisites is met.
Currentvaluerequiredphpversion5.5. 9-1Ubuntu4.5.3. 0okphp option Memory_limit -M -M okphp Option Post_max_size8M -M failphp Option Upload_max_filesize2M2M okphp Option Max_execution_time - -failphp option Max_input_time - -failphp TimeZone unknown failphp databases support MySQL okphp BcmathOn OK PHP mbstringOn OK PHP socketsOn OK PHP GD2.1. 12.0okphp GD PNG SupportOn OK PHP GD JPEG SupportOn OK PHP GD FreeType SupportOn OK PHP Libxml2.9. 12.6. theokphp XmlWriterOn OK PHP XmlReaderOn OK PHP CTypeOn OK PHP sessionOn OK PHP session auto start off okphp gettextOn OK
Resolve:
#vim /etc/php5/fpm/php.ini...385#max_execution_time = 30386300396#max_input_time = 60397300675#post_max_size = 8M676883 date.timezone ='Asia/Shanghai'
Make sure like this:
Currentvaluerequiredphpversion5.5. 9-1Ubuntu4.5.3. 0okphp option Memory_limit -M -M okphp Option Post_max_size +M -M okphp Option Upload_max_filesize2M2M okphp Option Max_execution_time - -okphp option Max_input_time - -okphp TimeZone Asia/shanghai okphp databases support MySQL okphp BcmathOn OK PHP mbstringOn OK PHP socketsOn OK PHP GD2.1. 12.0okphp GD PNG SupportOn OK PHP GD JPEG SupportOn OK PHP GD FreeType SupportOn OK PHP Libxml2.9. 12.6. theokphp XmlWriterOn OK PHP XmlReaderOn OK PHP CTypeOn OK PHP sessionOn OK PHP session auto start off okphp gettextOn OK
Step 3
Enter details for connecting to the database. Zabbix database must already be created.
Step 4
Enter Zabbix Server details.
Step 5
Review a summary of settings.
Step 6
Download the configuration file and place it under conf/.
Step 7
Finish the installation.
Step 8
Zabbix Frontend is ready! The default user name Admin is, password zabbix .
Issues
Missing Libmysqld-dev
#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2...forlibrary not found
Resolve:
#apt-get-y libmysqld-dev
Missing Libxml2-dev
#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2...forlibrary not found
Resolve:
#apt-get-y libxml2-dev
Missing Libsnmp-dev
#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2...for net-snmp-config... noconfigure: error: Invalid Net-SNMP directory - unable to find net-snmp-config
Resolve:
#apt-get install libsnmp-dev
Missing Libcurl4-openssl-dev
#./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2...forlibrary not found
Resolve:
#apt-get-y libcurl4-openssl-dev
On the dashboard of Zabbix, it ' s display:
isnotnotbe current."
Resolve:
#vim /var/www/html/zabbix/conf/zabbix.conf.php$ZBX_SERVER 'localhost'$ZBX_SERVER '192.168.22.122'#your ip address#
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the deploy Zabbix 2210 on Ubuntu 1404 64bit, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.