Fist, let's spin up a new 14.04 instance in EC2.
Once connected there are some default things to get in order prior to get started on installing Zabbix.
sudo su echo "zabbix" > /etc/hostname hostname -F /etc/hostname exit sudo apt-get update sudo apt-get upgrade sudo apt-get install fail2ban build-essential
Update /etc/hosts to have it reflect the hostname you just set;
127.0.0.1 localhost.localdomain localhost your_internal_ip_address_here zabbix.mycomain.com zabbix
Next, let's install Zabbix 3.
wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb sudo dpkg -i zabbix-release_3.0-1+trusty_all.deb sudo apt-get update
Install Zabbix server and required packages.
sudo apt-get install zabbix-server-mysql php5-mysql zabbix-frontend-php
Memorize the MySQL root password you have chosen, you'll need it later. Next edit the Zabbix configuration.
sudo nano /etc/zabbix/zabbix_server.conf
Look for the line to configure the database credentials you would like to use for Zabbix to connect, it are the following:
DBName=zabbix DBUser=zabbix DBPassword=your_chosen_password_here
Also take note of the values specified here, you'll need them later. Note. You will make up a password for the zabbix MySQL user you'll create in a later step. You won't paste your root MySQL password here you just made up while installing MySQL.
Login to MySql using the root password you chose when you installed MySQL;
mysql -u root -p
Create a user for Zabbix (and a database) that matches the information we entered in the "/etc/zabbix/zabbix_server.conf" file.
create user 'zabbix'@'localhost' identified by 'your_chosen_password_here'; create database zabbix; grant all privileges on zabbix.* to 'zabbix'@'localhost'; flush privileges; exit;
Zabbix needs a database to work with, you'll need to import it.
Unzip the mysql data for importing them into the database you'll create in the next step.
cd /usr/share/doc/zabbix-server-mysql sudo gunzip *.gz cat create.sql | mysql -uroot zabbix -p
Start the Zabbix server
sudo service zabbix-server start
Edit the PHP settings for Zabbix:
sudo nano /etc/apache2/conf-enabled/zabbix.conf
And make sure you'll at least set the timezone like for example like the last line below;
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Europe/Amsterdam
Then go to the url of the server you created like: http://zabbix.mydomain.com/zabbix
Login with the default credentials zabbix/admin and get started with the latest part of the setup.
You'll need to specify the password you made up and configured for the Zabbix user for connecting to your Zabbix MySQL tables.
For Zabbix server details I entered the hostname like this: zabbix.mydomain.com and left the rest as default.
If you have logged in, please change your admin password first.
Ok, so to have the Zabbix server get some data from another host you would like to monitor, we're going to install the Zabbix agent on another host. (An ubuntu 16.04 server in this case.)
sudo apt-get install zabbix-agent
Then edit the config file:
sudo nano /etc/zabbix/zabbix_agentd.conf
And configure the value for: Server= and thange the value (probably 127.0.0.1) to the IP address of Zabbix server you just installed. Save the file and restart the agent:
sudo service zabbix-agent restart
Next head over to your Zabbix server, login and navigate to: 'configuration' -> 'hosts'.
Click 'create host' and fill out the hostname and ip address of the server on which you just installed the Zabbix agent.
Next, while editing the server you are adding, click the 'Templates' tab and add the template 'Template OS Linux' template. Making sure you use the 'add' button once it is listed and clicking 'update' once you've added the template. (Note, only searching for it isn't enough, you really need to add the template.)
Make sure your Zabbix server can talk to port 10050 (TCP) to the server it monitors.