Friday 2 September 2016

Debian – Zabbix

Debian – Zabbix:
Installing the Zabbix Server:
1. vim /etc/apt/sources.list
# Zabbix Application PPA
deb http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
deb-src http://ppa.launchpad.net/tbfr/zabbix/ubuntu precise main
2. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C407E17D5F76A32B
# add the PPA's key so that apt-get trusts the source
3. apt-get update
    apt-get install zabbix-server-mysql php5-mysql zabbix-frontend-php











* password = zabbix123
Configuring the Zabbix Server:
4. vim /etc/zabbix/zabbix_server.conf
DBPassword=Your.Password.Here
MySQL Configuration:
5. cd /usr/share/zabbix-server-mysql/
    gunzip *.gz
6. mysql -u root -p
    create user 'zabbix'@'localhost' identified by 'zabbix123';
    create database zabbix;
    grant all privileges on zabbix.* to 'zabbix'@'localhost';
    flush privileges;
    exit;
7. mysql -u zabbix -p zabbix < schema.sql
    # import the files that Zabbix needs to function.
    # Enter the password for the user "zabbix" that you configured when prompted
    mysql -u zabbix -p zabbix < images.sql
    mysql -u zabbix -p zabbix < data.sql
PHP Configuration:
8. vim /etc/php5/apache2/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Kuala_Lumpur
9. cp /usr/share/doc/zabbix-frontend-php/examples/zabbix.conf.php.example /etc/zabbix/zabbix.conf.php
# copy the Zabbix-specific php file into the configuration directory
10. vim /etc/zabbix/zabbix.conf.php
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'zabbix123'
Configuring Additional Files:
11. cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf-available/zabbix.conf
      a2enconf zabbix.conf
      service apache2 restart
12. vim /etc/default/zabbix-server
START=yes
13. service zabbix-server start
Installing and Configuring Zabbix Agent:
14. apt-get update
      apt-get install zabbix-agent
15. vim /etc/zabbix/zabbix_agentd.conf
 Server=Zabbix.Server.IP.Address
# For the agent configuration on the Zabbix server, you can use "127.0.0.1"
Hostname=Hostname_Of_Current_Machine
# Adjust the "Hostname" property to reflect the hostname of the machine being monitored.
16. service zabbix-agent restart
Logging In for the First Time:
17. Your.Zabbix.IP.Address/zabbix2










Username = admin
Password = zabbix
# default credentials
17a. After logged in, click on the "Configuration" button, and then "Hosts" in the top navigation bar.
17b. Click on the name of the server (by default, this should be "Zabbix server"). This will open the host configuration page.
17c. Adjust the Hostname to reflect the hostname of your Zabbix server (this should be the same hostname you entered in the agent configuration for the server machine).
17d. At the bottom, change the "Status" property to "Monitored". Click save.




18a. You will be dopped back to the Hosts configuration page. Re-click on the hostname again.

18b. This time, click on the "Clone" button at the bottom of the page.
18c. We will configure this to reflect the settings of the client machine. Change the hostname and the IP address to reflect the correct information from the client agent file.





















18d. In the "groups" section, select "Zabbix servers" and click the right arrow icon to remove that group. Select the "Linux servers" and click the left arrow icon to add that group setting.






18e. Click "Save" at the bottom.
19a. After a few minutes, you should be able to see both computers by going to "Monitoring" and then clicking on "Latest data".
19b. There should be information for both the server and client machines populating.

















19c. If you click on the arrows next to an item, you can see the collected information.
19d. If you click "Graph" you will see a graphical representation of the data points that have been collected.

Configure Email Alert:
20. Profile > Media > Add

















21. Administration > Media types > Email