First Production Ubuntu Server 14.04 running:
- MariaDB (Mysql)
- Nginx
- Php5-fpm
- Zabbix 2.2.*
hostname zabbix.mydomain.vn && echo ‘zabbix.mydomain.vn ‘ > /etc/hostname
Note:
- datetime: sync your server to your NTP server.
- Notice your mysql password
sudo apt-get update && apt-get -y dist-upgrade
sudo apt-get install mariadb-server nginx php5-fpm php5-mysql snmp libnet-snmp-perl snmp-mibs-downloader
sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
MariaDB Mysql
mysql -u root -p
Enter password: your root password at MariaDB installation
create user ‘zabbix’@’localhost’ identified by ‘Zabbix_DB_Passwd’;
create database zabbix;
grant all privileges on zabbix.* to ‘zabbix’@’localhost’;
flush privileges;
exit;
Php5-fpm
[PHP]
…..
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
……
[Date]
date.timezone = Asia/Ho_Chi_Minh
[www]
user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
#### It depend on my server hardware, you can leave it as default ^^ #####
pm = dynamic
pm.max_children = 24
pm.start_servers = 8
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 50000
chdir = /
sudo service php5-fpm restart
Nginx
server {
listen 80 default_server;
root /usr/share/zabbix;
index index.php index.html index.htm;
server_name zabbix.mydomain.vn;
location / {
try_files $uri $uri/ =404;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
sudo service nginx restart
Zabbix-server
cd /usr/share/zabbix-server-mysql/
mysql -u zabbix -p zabbix < schema.sql
mysql -u zabbix -p zabbix < images.sql
mysql -u zabbix -p zabbix < data.sql
sudo cp /usr/share/doc/zabbix-frontend-php/examples/zabbix.conf.php.example /etc/zabbix/zabbix.conf.php
Edit /etc/zabbix/zabbix.conf.php
$DB[‘TYPE’] = ‘MYSQL’;
$DB[‘SERVER’] = ‘localhost’;
$DB[‘PORT’] = ‘0’;
$DB[‘DATABASE’] = ‘zabbix’;
$DB[‘USER’] = ‘zabbix’;
$DB[‘PASSWORD’] = ‘Zabbix_DB_Passwd’;
$ZBX_SERVER = ‘zabbix.mydomain.vn’;
$ZBX_SERVER_PORT = ‘10051’;
START=yes
CONFIG_FILE=”/etc/zabbix/zabbix_server.conf”
LogFile=/var/log/zabbix-server/zabbix_server.log
PidFile=/var/run/zabbix/zabbix_server.pid
DBName=zabbix
DBUser=zabbix
DBPassword=Zabbix_DB_Passwd
AlertScriptsPath=/etc/zabbix/alert.d/
FpingLocation=/usr/bin/fping
Start up Zabbix monster
service zabbix-sever restart
Zabbix-agent
Hostname is very important. It must be same with Hostname in Host Configuration in Zabbix Dashboard.
I disable ServerActive => My Zabbix agent will run in Passive mode (Server directive). The Server will open a port and then visit his Agent port 10050 and ask for his money 😀
Edit /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix-agent/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1 #Address of Zabbix Server
Hostname=zabbix.ssis.edu.vn #FQDN of monitored host
Restart Zabbix-agent
sudo service zabbix-agent restart
Zabbix Dashboard
Go to Zabbix web dashboard: http://zabbix.mydomain.vn
Defaut username: Admin
Default password: zabbix
Add host monitoring will be on next Part
I am truly pleased to read this website posts which carries lots of helpful data, thanks for providing these kinds of statistics.
Historical Options Data
when I install zabbix-frontend with command : sudo apt-get install zabbix-frontend-php, it show the error:
Reading package lists… Done
Building dependency tree
Reading state information… Done
zabbix-frontend-php is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 231 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up zabbix-frontend-php (1:2.4.4-1+trusty) …
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
env: apache2ctl: No such file or directory
invoke-rc.d: initscript apache2, action "restart" failed.
dpkg: error processing package zabbix-frontend-php (–configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
zabbix-frontend-php
E: Sub-process /usr/bin/dpkg returned an error code (1)
env: ubuntu 14.04; nginx and zabbix 2.4.
Do you have any suggestion ?
I also followed the Kodai Terashima's comment in https://support.zabbix.com/browse/ZBX-6941 but it is no luck.
Hi Linh,
make sure you remove Apache if you don't want it mess up with your Nginx