Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and deployment of monitored zabbix + configuration of alerts

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Host environment redhat6.5 64-bit

Experimental environment server 1 ip172.25.25.1 hostname: server1.example.com

Server 2 ip172.25.25.2 hostname: server2.example.com

Install package alert-agent-4.1.3.1-linux-x64.tar.gz

Fping-2.4b2-16.el6.x86_64.rpm

Iksemel-1.4-2.el6.x86_64.rpm

Iksemel-utils-1.4-2.el6.x86_64.rpm

Php-bcmath-5.3.3-26.el6.x86_64.rpm

Php-mbstring-5.3.3-26.el6.x86_64.rpm

Zabbix-2.4.5-1.el6.x86_64.rpm

Zabbix-agent-2.4.5-1.el6.x86_64.rpm

Zabbix-get-2.4.5-1.el6.x86_64.rpm

Zabbix-server-2.4.5-1.el6.x86_64.rpm

Zabbix-server-mysql-2.4.5-1.el6.x86_64.rpm

Zabbix-web-2.4.5-1.el6.noarch.rpm

Zabbix-web-mysql-2.4.5-1.el6.noarch.rpm

Firewall status: off

Selinux status: Disabled

Installation and simple configuration of 1.Zabbix

Server 1

A) install zabbix

[root@sever1 zabbix] # yum install zabbix-2.4.5-1.el6.x86_64.rpmzabbix-agent-2.4.5-1.el6.x86mm 64.rpmzabbix-get-2.4.5-1.el6.x86_64.rpmzabbix-server-2.4.5-1.el6.x86x64.rpmzabbix music server-mysql-2.4.5-1.el6.x86_64.rpmzabbix-web-2.4.5-1.el6.noarch.rpm zabbix- Web-mysql-2.4.5-1.el6.noarch.rpmfping-2.4b2-16.el6.x86_64.rpm iksemel-1.4-2.el6.x86_64.rpm iksemel-utils-1.4-2.el6.x86_64.rpm php-*-y # install zabbix

B) configure the mysql database

[root@server1 ~] # mysql-predhat

Mysql > create database zabbix1 character set utf8 collateutf8_bin

Query OK, 1 row affected (0.00 sec) # create zabbix database

Mysql > grant all privileges on zabbix1.* to zabbix@localhostidentified by 'redhat'

Query OK, 0 rows affected (0.00 sec) # authorizes the zabbix database

Mysql > Ctrl-C-- exit!

[root@server1 ~] # mysql-uzabbix-predhat # log in with the newly created user test

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | zabbix1 |

+-+

2 rows in set (0.00 sec)

Mysql > Ctrl-C-- exit!

[root@server1 mysql] # cd/usr/share/doc/zabbix-server-mysql-2.4.5/create/

[root@server1 create] # ls

Data.sql p_w_picpaths.sql schema.sql

# Import files into the database

[root@server1 create] # mysql-uzabbix-predhat zabbix1 grant select on *. * to wen@localhost identified by'redhat'

Query OK, 0 rows affected (0.00 sec) # create local users and give them permissions

Mysql > Ctrl-C-- exit!

Specify how zabbix agent gets all kinds of information about mysql services in the / etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf file, and create a new ".my.cnf" file in the / var/lib/zabbix directory to specify how zabbix agent logs into the database. The password can be found in the zabbix_server.conf file.

[root@server2 zabbix] # cd zabbix_agentd.d/

[root@server2 zabbix_agentd.d] # mkdir / var/lib/zabbix # create directory

[root@server2 zabbix_agentd.d] # cd / var/lib/zabbix/

[root@server2 zabbix] # vim .my.cnf # write the file as follows

[mysql] host=localhostuser=wen # newly created user password=redhat # password of user wen socket=/var/lib/mysql/ mysql.sock [mysqldadmin] host=localhostuser=wenpassword=redhatsocket=/var/lib/mysql/mysql.sock

[root@server2 zabbix] # / etc/init.d/zabbix-agent restart # restart the service

Shutting down Zabbix agent: [OK]

Starting Zabbix agent: [OK]

B) add template httpd service and mysql service

Click Configuration-> Hosts-> server2.example.com- > Templates to select the template you want to add, as shown below:

Click the Items of server2.example.com, and the http service appears, as shown in the figure

The http service does not have graphics, and mysql can view them.

Click the Graphs of server2.example.com as shown in the figure:

Click in, as shown in the figure:

As shown in the figure:

4.Zabbix 's alarm.

Server 1

A) Email alarm mode

It is recommended to disable the alarm method that is not used. Click Administration- > Media types, as shown in the figure:

Click Email to set it, as shown in the figure:

Click User of Administration-> Users- > Zabbix administrators to enter the Admin Manager Media tab and configure as follows:

test

[root@server2 mnt] # / etc/init.d/httpd stop # stop the http service of server 2

Stopping httpd: [OK]

Due to the experiment done by QQ Mail, server1.example.com has no domain name resolution and will be blocked by QQ Mail, so it is necessary to set up QQ Mail's anti-spam whitelist and add the zabbix@server1example.com sending address to the address whitelist.

B) 110 Cloud alarm method

110Cloud alarm is added to the zabbix alarm. The official document is written in detail and can be configured by referring to the official document.

[root@server1 mnt] # tar zxfalert-agent-4.1.3.1-linux-x64.tar.gz-C / usr/lib/zabbix/alertscripts/ # extract to the specified directory

[root@server1 mnt] # cd / usr/lib/zabbix/alertscripts/

[root@server1 alertscripts] # ls

Alert-agent

[root@server1 alertscripts] # cpalert-agent/plugin/zabbix-plugin/110monitor.

[root@server1 alertscripts] # chown-R zabbix.zabbix * # x modify permission

[root@server1 alertscripts] # ll

Total 8

-rwxr-xr-x 1 zabbix zabbix 559 Nov 1 19:39 110monitor

Drwxr-xr-x 8 zabbix zabbix 4096 May 15 2015 alert-agent

Click Administration-> Media types and click Createmedia type to create a cloud alarm, as shown below:

Click User of Administration-> Users- > Zabbix administrators, and configure it in the Media tab of the Admin user.

Click Configuration-> Actions, click Triggers, and edit the default Report problems to Zabbix administrators, as follows:

To keep the Conditions tab by default, click the Operatins tab.

test

[root@server2 mnt] # / etc/init.d/httpd stop # stop the http service of server 2

Stopping httpd: [OK]

As shown in the figure:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report