Cacti monitoring MySQL database server implementation process

Source: Internet
Author: User
Tags snmp snmp error snmpwalk

Introduction: Cacti Server-side installation Please refer to:http://blog.csdn.net/mchdba/article/details/27120605


1 Install MySQL template on cacti server side first

wget https://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.8.tar.gz

TAR–XVF better-cacti-templates-1.1.8.tar.gz

CD better-cacti-templates-1.1.8

The script that will be better-cacti-templates-1.1.8\scripts under ss_get_mysql_stats. PHP needs to be placed on the server of cacti.

For example, cacti is deployed under the/var/www/html directory, then CP to/var/www/html/cacti/scripts/

Cp

/root/better-cacti-templates-1.1.8/scripts/ss_get_mysql_stats.php/var/www/html/cacti/scripts/

Modify the 30th line of the ss_get_mysql_stats.php file

$mysql _user = ' cacti_user ';
$mysql _pass = ' cacti ';
$cache _dir = "/xok.la/cacti/cache/";

Grant Apache account operation privileges

Chown-r apache.apache/var/www/html/cacti/scripts

Chmod-r 755/var/www/html/cacti/scripts

To access the Cacti host import using http:

/root/better-cacti-templates-1.1.8/templates/cacti_host_template_x_mysql_server_ht_0.8.6i-sver1.1.8.xml

2. Build MySQL Account

To establish a database cacti account on the monitored MySQL server, you need process, SUPER, REPLICATION client permissions, SQL as follows:

GRANT PROCESS, SUPER, REPLICATION CLIENT on*.* to ' cacti ' @ '% ' identified by ';

3. Add a host above cacti:

3.1 Views Create devices

3.2 Go in and then click the Add button to add the host

3.3 Enter the descriptor and hostname or IP address, click the Create button in the lower right corner.

3.4 Interface error is as follows:

See the error "SNMP error" when adding a monitoring host in cacti, generally there are 2 ways to handle it:

(1) to determine Cacti all the hosts can Ping monitored by the host; Ping Check the network configuration and the monitored host IP is set correctly.

[[email protected] templates]# Ping 10.xxx.3.xx

PING 10.254.3.72 (10.254.3.72) bytesof data.

Bytes from 10.xx.3.xx:icmp_seq=1 ttl=64time=0.427 ms

Bytes from 10.xx.3.xx:icmp_seq=2 ttl=64time=0.389 ms

Bytes from 10.xx.3.xx:icmp_seq=3 ttl=64time=0.402 ms

Bytes from 10.xx.3.xx:icmp_seq=4 ttl=64time=0.415 ms

Can ping pass, prove not network failure.

(2) to verify that the monitored Host is enabled snmpd Service:

[Email protected] ~]# Ps-eaf|grep snmpd

Root 4540 27133 0 17:15 pts/0 00:00:00 grep snmpd

[Email protected] ~]#

[[Email protected] ~]# service SNMPD start

SNMPD: Unrecognized service

[Email protected] ~]#

The monitored host needs to install the SNMPD service and install the SNMPD service using YUM-Y installation snmpd.

[[Email protected] ~]# service Snmpdrestart

SNMPD: Unrecognized service

[Email protected] ~]#

[[email protected] ~]# yum-y Install SNMP

Loaded Plugins:fastestmirror, security

Loading mirror speeds from cached hostfile

*base:mirror.neu.edu.cn

*extras:mirror.neu.edu.cn

*updates:mirror.neu.edu.cn

Setting up Install Process

No Package SNMP available.

Error:nothing to do

Yum can't install, try it. Yum install-y net-snmp , the installation succeeds:

[email protected] ~]# Yum INSTALL-YNET-SNMP

Loaded Plugins:fastestmirror, security

Loading mirror speeds from cached hostfile

*base:mirror.neu.edu.cn

*extras:mirror.neu.edu.cn

*updates:mirror.neu.edu.cn

Setting up Install Process

Resolving Dependencies

--Running Transaction check

---> Package net-snmp.x86_641:5.5-49.el6_5.1 'll be installed

--processing dependency:net-snmp-libs= 1:5.5-49.el6_5.1 for package:1:net-snmp-5.5-49.el6_5.1.x86_64

--processing dependency:libsensors.so.4 () (64bit) for package:1:net-snmp-5.5-49.el6_5.1.x86_64

--processing dependency:libnetsnmptrapd.so.20 () (64bit) for package:1:net-snmp-5.5-49.el6_5.1.x86_64

--processing dependency:libnetsnmpmibs.so.20 () (64bit) for package:1:net-snmp-5.5-49.el6_5.1.x86_64

[[Email protected] ~]# service Snmpdrestart

Stop SNMPD: [ failed ]

Starting snmpd: [ OK ]

[Email protected] ~]#

You can also reload with the service snmpd reload command.

(3) , this time to see the host State, is recovering:

You can then go to the cacti server and run Snmpwalk to check under:

Snmpwalk-c public-v 2c 10.xxx.1.xx # (this ip10.xxx.1.xx is the IP address of the monitored host)

If the data information of the monitored machine can be received, the SNMP configuration of the monitored host is complete without errors.

4, continue to add the monitor host's paint, add graphs:

On the right side of the console interface, click the createdevices connection as shown:

Then click the host hostname to connect, as follows:


Then click Create Graphs for this Host connection in the upper right corner



5. Add Host Group

Add the tree below the graphs, click Console, select the graphs Trees in the left column, click the Add button on the right,

Enter the trees name, select the sort type natural ordering, and click the Create button.


After choosing to create a good graphs trees, click on the Add button to add the database host to the trees, added complete such as:


Then click on the top graphs and it will appear

"To be continued in editing"


Reference: http://blog.csdn.net/hw_libo/article/details/6881480

Related Article

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.