Showing posts with label Zabbix. Show all posts
Showing posts with label Zabbix. Show all posts

Nov 21, 2023

[UPDATE] Zabbix : Installation and Configuration

Latest Zabbix v.6.4, installation and configuration in Ubuntu Server v.22.04.3 LTS.


1. Install Ubuntu Server v.22.04.3 LTS and configure the basic configurations.


$ sudo apt update && sudo apt upgrade -y

$ sudo timedatectl set-timezone Asia/Kuala_Lumpur

$ sudo touch /etc/cloud/cloud-init.disabled
 
 
2. Install Pre-requisites packages.


$ sudo apt install wget git mysql-server php apache2 -y


3. Install Zabbix Repository and update.


$ sudo wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

$ sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

$ sudo apt update


4. Install Zabbix Packages that includes the Server, Frontend and Agent.


$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent


5. Ensure that MySQL Server is up and running before proceeding this steps. You will be prompted to create a password, proceed to create the password.


$ sudo mysql -uroot -p
password

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;

mysql> create user zabbix@localhost identified by 'password';

mysql> grant all privileges on zabbix.* to zabbix@localhost;

mysql> set global log_bin_trust_function_creators = 1;

mysql> quit;


6. Import the Zabbix database schema into MySQL database. You will be prompted to key-in MySQL password. Depending on your system, it may a while to complete.


$ sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix


7. Once completed, disabled back the log_bin_trust_function option.


$ sudo mysql -uroot -p
password

mysql> set global log_bin_trust_function_creators = 0;

mysql> quit;


8. Configure Zabbix server to access the database.


$ sudo nano /etc/zabbix/zabbix_server.conf

DBPassword=password


9. Restart and Enabled both Zabbix and Apache2 services.


$ sudo systemctl restart zabbix-server zabbix-agent apache2

$ sudo systemctl enable zabbix-server zabbix-agent apache2


10. Now, at another computer and browse to --> http://[Zabbix server]/zabbix

You need to perform some basic configuration on the Zabbix server before first use. This may includes the following :-

  • DB Type = MySQL
  • DB Name = zabbix
  • DB User = zabbix
  • DB Password = password
11. The standard Zabbix login credentials as below (case sensitive) :-

  • Username = Admin
  • Password = zabbix

!!! HAPPY COMPUTING !!!


Aug 27, 2022

Zabbix Server : Installation (Part 1)

 Zabbix Monitoring Server is an Open Source software suitable for Personal and Commercial use. This installation guide is based on Ubuntu Server v.22.04 LTS 64-bit thus I will not be going thru the OS installation steps but will highlight some important steps prior to installing Zabbix.

As of writing the current Zabbix Server v.6.2, more information is available at (https://www.zabbix.com/)

After completed installing Ubuntu Server, you will need to do the following :-

1. sudo timedatectl set-timezone Asia/Kuala_Lumpur

2. sudo apt update && sudo apt upgrade -y

3. sudo apt install nano net-tools wget git -y

4. sudo apt install mysql-server php apache2 -y

5. sudo reboot

6. sudo apt install php-gd php-bcmath php-ctype php-xml php-xmlreader php-xmlwriter php-net-socket php-mbstring php-ldap -y

7. sudo apt install php-session -y

8. sudo apt install php-gettext -y

9. sudo reboot

10. sudo apt update

11. sudo wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2+ubuntu22.04_all.deb

12. sudo dpkg -i zabbix-release_6.2+ubuntu22.04_all.deb

13. sudo apt update

14. sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

15. sudo reboot

16. sudo mysql -uroot -p    (key-in 'password' when prompted)

17. Under MYSQL prompt :-

  • create database zabbix character set utf8mb4 collate utf8mb4_bin;
  • create user zabbix@localhost identified by 'password';
  • grant all privileges on zabbix.* to zabbix@localhost;
  • set global log_bin_trust_function_creators = 1;
  • quit;
18. sudo zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix        (key-in 'password' when prompted)

19. sudo mysql -uroot -p        (key-in 'password' when prompted)

20. Under MYSQL prompt :-

  • set global log_bin_trust_function_creators = 0;
  • quit;
21. sudo nano /etc/zabbix/zabbix_server.conf
  • DBPassword=password
22. sudo systemctl restart zabbix-server zabbix-agent apache2

23. sudo systemctl enable zabbix-server zabbix-agent apache2

24. sudo reboot

25. At another computer, open browser --> http://[Zabbix's IP Address]/zabbix
  • DB Type = MySQL
  • DB Name = zabbix
  • DB User = zabbix
  • DB Password = password
  • Zabbix Server Name = [Any Name]
  • Time Zone = (UTF+08:00) Asia/Kuala_Lumpur
26. Default Zabbix Login :-
  • Username = Admin          (case sensitive)
  • Password = zabbix          (case sensitive)

!!! HAPPY COMPUTING !!!

Apr 29, 2022

Zabbix : Install Zabbix-Agent in CentOS

 1. sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-agent-6.0.3-1.el17.x86_64.rpm

* Check for latest version in https://repo.zabbix.com/zabbix.

2. sudo yum update

3. sudo yum install zabbix-agent -y

4. sudo nano /etc/zabbix/zabbix-agentd.conf

        --> Server = [Zabbix Server IP Address]

        --> Hostname = [CentOS hostname]

5. sudo iptables -A INPUT -p tcp -s [Zabbix server IP address] --dport 10050 -m state --state NEW,ESTABLISEHD -j ACCEPT

* If "firewalld" was install, add port 10050 into exception list.

6. sudo systemctl restart zabbix-agent

7. sudo systemctl enable zabbix-agent

8. sudo systemctl status zabbix-agent

9. Continue to add client host into Zabbix server via browser, select --> CentOS with Zabbix Agent


Zabbix : Install Zabbix-Agent in Ubuntu

 1. sudo wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb

* Visit https://repo.zabbix.com/zabbix for latest version.


2. sudo dpkg -i zabbix-release_6.0-1+ubuntu20.04_all.deb

3. sudo apt-get update

4. sudo apt-get install zabbix-agent -y

5. sudo nano /etc/zabbix/zabbix-agentd.conf

        --> Server = [Zabbix Server IP Address]

        --> ServerActive = [Zabbix Server IP Address]

        --> Hostname = [Ubuntu Client Hostname]


6. sudo systemctl restart zabbix-agent

7. sudo systemctl enable zabbix-agent

8. sudo systemctl status zabbix-agent

9. sudo ufw allow 10050/tcp          * check status --> sudo ufw status

OR --> sudo iptables -A INPUT -p tcp -s [Zabbix server IP address] --dport 10050 -m state --state NEW,ESTABLISEHD -j ACCEPT

* Some firewall may block or NAT the address, thus instead of using the Zabbix server IP address, use the firewall IP address.


10. Use another PC to browse the zabbix server (eg. http://[Zabbix Server IP Address]/zabbix) and login using your admin's credentials.

11. Continue to add the client into the monitoring --> Configuration --> Hosts --> Create Host

        --> Add --> Agent --> Linux with Zabbix Agent