Zabbix---client installation and how to add a dynamic monitoring view of a database

Source: Internet
Author: User

Prerequisites: The Zabbix server side is already installed and functioning properly.


1 need to download Zabbix client, install client to open 10050 port

wget http://www.zabbix.com/downloads/2.0.8/zabbix_agents_2.0.8.linux2_6.amd64.tar.gz

Add Zabbix users and groups.

Groupadd Zabbix

Useradd zabbix-g zabbix-s/sbin/nologin

2 Decompression

TAR–XVF zabbix_agents_2.0.8.linux2_6.amd64.tar.gz

Mv zabbix_agents_2.0.8.linux2_6.amd64/usr/local/zabbix_2.0.8

[Root@db-m2-slave-1 zabbix_2.0.8]# LL

Total Dosage 296

Drwxr-xr-x. 2 root root 4096 April 13:06 bin

Drwxr-xr-x. 3 root root 4096 April 15:20 conf

Drwxr-xr-x. 2 root root 4096 April 14:27 sbin

-rw-r--r--. 1 root root 288810 September zabbix_agents_2.0.8.linux2_6_23.amd64.tar.gz

[Root@db-m2-slave-1 zabbix_2.0.8]#

3 Start

[Root@db-m2-slave-1 sbin]# nohup/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start-c & > Zabbix.log

[1] 18785

[Root@db-m2-slave-1 sbin]# nohup: Ignore input and append output to ' nohup.out '


[Root@db-m2-slave-1 sbin]# more Nohup.out

Zabbix_agentd [18584]: Cannot open config file [/usr/local/etc/zabbix_agentd.conf]: [2] No such file or directory

Zabbix_agentd [18785]: zbx_option requires an argument--c

USAGE:ZABBIX_AGENTD [-VHP] [-c <config-file>] [-t <item Key>]

Error cannot load configuration file, establish soft connection

Ln-s/usr/local/zabbix_2.0.8/conf/zabbix_agentd.conf/usr/local/etc/zabbix_agentd.conf


Start again

[Root@db-m2-slave-1 sbin]# nohup/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start & > Zabbix.log

[1] 18920

[Root@db-m2-slave-1 sbin]# nohup: Ignore input and append output to ' nohup.out '


[1]+ done Nohup/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

[Root@db-m2-slave-1 sbin]#

4 Final view of the boot log information, no recent record, indicates that the boot was successful.

[Root@db-m2-slave-1 sbin]# more Nohup.out

Zabbix_agentd [18811]: zbx_option requires an argument--c

USAGE:ZABBIX_AGENTD [-VHP] [-c <config-file>] [-t <item Key>]

Zabbix_agentd [18826]: User Zabbix does not exist

Zabbix_agentd [18826]: cannot run as root!

5 Viewing zabbix_agent starting a background process

[Root@db-m2-slave-1 sbin]# Ps-eaf|grep Zabbix

Zabbix 18922 1 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Zabbix 18923 18922 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Zabbix 18924 18922 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Zabbix 18925 18922 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Zabbix 18926 18922 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Zabbix 18927 18922 0 13:21? 00:00:00/usr/local/zabbix_2.0.8/sbin/zabbix_agentd start

Root 18947 8652 0 13:21 pts/0 00:00:00 grep Zabbix

6 Automatically add startup scripts

Ln-s/usr/local/zabbix_2.0.8/sbin/zabbix_agentd/etc/init.d/zabbix_agentd

chmod 755/etc/init.d/zabbix_agentd

[Root@db-m2-slave-1 sbin]# chkconfig--add zabbix_agentd

ZABBIX_AGENTD service does not support Chkconfig


Chkconfig--level 345 zabbix_agentd on

[Root@db-m2-slave-1 sbin]# chkconfig--level 345 zabbix_agentd on

ZABBIX_AGENTD service does not support Chkconfig

[Root@db-m2-slave-1 sbin]#
VI/ETC/INIT.D/ZABBIX_AGENTD Head Add description can
#!/bin/sh
# chkconfig:345 95 95
# DESCRIPTION:ZABBIX_AGENTD


Failed


7 Closing the ZABBIX_AGENTD process

Killall-9 Zabbix_agentd



8 Adding custom Monitoring

8.1 On the database host, modify the vi/usr/local/etc/zabbix_agentd.conf

Unsafeuserparameters=1 default is 0 (no custom script allowed)

Then add Userparameter=key,command to the back

Key,command for format

The key here is filled in when you create the item


Add the following monitoring items in this area:

Unsafeuserparameters=1

Userparameter=mysql.ping_test[*],mysqladmin-u$1-p$2 Ping|grep Alive|wc–l

8.2 Restart the ZABBIX_AGENTD service.

8.3 Check Service

[Root@cache-2 zabbix]#/usr/local/zabbix/bin/zabbix_get-s 10.254.3.72-k mysql.ping_test[' root ', ']

0

It's always 0, but executing mysqladmin on the database server's machine returns 1.

[Root@db-m2-slave-1 conf]# mysqladmin-uroot ping|grep alive|wc-l

1

[Root@db-m2-slave-1 conf]#


View Zabbix error log information as follows:

[Root@db-m2-slave-1 sbin]# tail-f Zabbix_agentd.log

Tail: Could not open "Zabbix_agentd.log" read data: No file or directory

[Root@db-m2-slave-1 sbin]# tail-f/tmp/zabbix_agentd.log

Sh:mysqladmin:command not found

Sh:mysqladmin:command not found

Sh:mysqladmin:command not found

Reset the full path of the mysqladmin and restart the ZABBIX_AGENTD service, then check the status


[Root@cache-2 zabbix]#/usr/local/zabbix/bin/zabbix_get-s 10.254.3.72-k mysql.ping_test[' root ', ']

1

[Root@cache-2 zabbix]#

9 Server Web site above configuration item

To select a server on the host of the monitored Servers list, open the Items option below, click Enter, then click Create Item in the top right corner.

Click Items-create itmes.
Client installation and how to add a dynamic monitoring view of the database ">
Client installation and how to add a dynamic monitoring view of the database ">


Enter a key value of Mysql.ping_test[root, "]
Client installation and how to add a dynamic monitoring view of the database ">


Click the Save button below to save the input.

Client installation and how to add a dynamic monitoring view of the database ">

10 Configuring Graph

Click Graphs---Create graph, select items at add for Mysql.ping_test--save, and later to plot

Client installation and how to add a dynamic monitoring view of the database ">


11 then go to see the Zabbix interface, you will find that the image can be generated:

Client installation and how to add a dynamic monitoring view of the database ">



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.