Cacti monitoring MySQL implementation of problems encountered during the solution summary

Source: Internet
Author: User
Tags rrd rrdtool snmp snmpwalk fully qualified domain name

Introduction: Cacti monitoring MySQL server about 50 graphs have been out, also out of the map, which encountered some problems, the impression of a more profound record as follows:

(i): Add IO Monitoring


Click Create Graphs for the This Host to enter the image of the IO, resulting in an error

This data query returned 0 rows, perhaps there is a problem executing this data query. You can run the this data query in the debug mode to get more information.


Enter *turn on Graph Debug mode, with the following error:

RRDTool Command:

/usr/bin/rrdtool Graph-\

--imgformat=png \

--start=-86400 \

--END=-300 \

--title= ' db-m2-slave-1-traffic ' \

--rigid \

--base=1000 \

--HEIGHT=120 \

--WIDTH=500 \

--alt-autoscale-max \

--lower-limit= ' 0 ' \

--vertical-label= ' bits per second ' \

--slope-mode \

--font title:10: \

--font axis:7: \

--font Legend:8: \

--font Unit:7: \

Cdef:cdefa= ' a,8,* ' \

AREA:CDEFA#00CF00FF: ' Inbound ' \

GPRINT:cdefa:LAST: ' current\:%8.2lf%s ' \

GPRINT:cdefa:AVERAGE: ' average\:%8.2lf%s ' \

GPRINT:cdefa:MAX: ' Maximum\:%8.2lf%s\n ' \

LINE1:CDEFA#002A97FF: ' Outbound ' \

GPRINT:cdefa:LAST: ' current\:%8.2lf%s ' \

GPRINT:cdefa:AVERAGE: ' average\:%8.2lf%s ' \

GPRINT:cdefa:MAX: ' Maximum\:%8.2lf%s\n '

RRDTool Says:

Error:invalid RPN expression in:a,8,*, as shown

Edit the/etc/snmp/snmpd.conf file under the Linux host
Found: com2sec notconfiguser default public
Modified to: com2sec Notconfiguser all public
Found: Access Notconfiggroup "" Any noauth exact systemview none None
Modified to: Access Notconfiggroup "" Any noauth exact none none
Found: #view all included. 1 80 Remove the # of the line,
Found: #view mib2 included. Iso.org.dod.internet.mgmt.mib-2 FC remove the diverted #,
Re-starting SNMPD:/ETC/INIT.D/SNMPD restart


(b):MySQL Add host out of the map

[Email protected] test]# service httpd restart

Stop httpd: [OK]

Starting httpd:httpd:Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Determine

1) Enter the configuration file directory

cd/etc/httpd/conf/

2) Edit the httpd.conf file, search for "#ServerName", add ServerName localhost:80
[[email protected] conf]# ls
Extra httpd.conf Magic Mime.types Original
[Email protected] conf]# VI httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
3) Restart Apache again.

(c): Start error

[Email protected] error]# tail-f/var/log/httpd/error_log

[Sat 31 22:49:02 2014] [Notice] caught SIGTERM, shutting down

[Sat 31 22:49:02 2014] [Notice] SELinux policy enabled; HTTPD Running as context Unconfined_u:system_r:httpd_t:s0

[Sat 31 22:49:02 2014] [Notice] suexec mechanism enabled (wrapper:/usr/sbin/suexec)

[Sat 31 22:49:02 2014] [Notice] Digest:generating Secret for Digest authentication ...

[Sat 31 22:49:02 2014] [Notice] Digest:done

[Sat 31 22:49:02 2014] [Notice] apache/2.2.15 (Unix) DAV/2 php/5.3.3 configured--Resuming normal operations

Workaround: Direct shutdown of selinux and firewalls  


(d): MySQL monitoring item out ungrateful error

[Sat 31 23:20:10 2014] [ERROR] [Client 192.168.171.71] PHP Fatal error:allowed Memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in/var/www/html/cacti /lib/adodb/adodb.inc.php on line 833

need to import Cacti.sql file

Mysql-u root-p Cacti </var/www/html/cacti/cacti.sql

(v): Snmp–interface statistics Error

Create Snmp–interface statistics error, as follows:

Created graph:db-m2-slave-2-Traffic-|query_ifname|

Error:no Data Source associated. Check Template

[Email protected] html]# Snmpwalk-c public-v 2c 10.254.3.73 Ifhcinoctets

If-mib::ifhcinoctets = No More variables left in this MIB View (It is past the MIB tree)

[Email protected] html]#

[Email protected] html]# Snmpwalk-c public-v 2c 10.254.3.73 If

if-mib::iftable = No Such Object available on the This agent in this OID

Then modify the snmpd.conf again and restart the SNMPD
Access Notconfiggroup "" Any Noauth exact systemview none none-->
Access Notconfiggroup "" Any noauth exact None None

[Email protected] ~]# service snmpd restart

Stop snmpd: [OK]

Starting snmpd: [OK]

[Email protected] ~]#

[Email protected] html]# Snmpwalk-c public-v 2c 10.254.3.73 If

if-mib::iftable = No More variables left in this MIB View (It is past the MIB tree)

"To resolve

In the snmpd.conf configuration file, look for the following fields: [/color]

# # INCL/EXCL Subtree Mask

#view all included. 1 80

Remove the "#" in front of the line.

Then restart the SNMPD service to resolve.

Error (VI):

Removing an error diagram


Go in consoleà Graph Management àhost(choose the wrong host address), search (keyword used Space for error searches), You will find error errors in the graph Title column, tick the right of the full box, click the Go button to remove the invalid diagram, as shown in:

Then in the new prompt interface, click the Continue button to delete.

(vii): Memory free value is Nan

Analysis: memery Free no data, Reason: RRDtool the upper memory limit is 10G .

[Email protected] local]# Find/-name *MEM*.RRD

/var/www/html/cacti/rra/db-m2-slave-1_mem_buffers_189.rrd

/var/www/html/cacti/rra/db-master-2_mem_free_156.rrd

/var/www/html/cacti/rra/db-m2-slave-1_lock_system_memory_20.rrd

/var/www/html/cacti/rra/db-m2-slave-2_total_mem_alloc_74.rrd

/var/www/html/cacti/rra/db-m2-slave-1_total_mem_alloc_23.rrd

/var/www/html/cacti/rra/db-m2-slave-2_lock_system_memory_71.rrd

/var/www/html/cacti/rra/localhost_mem_swap_4.rrd

/var/www/html/cacti/rra/db-master-2_total_mem_alloc_117.rrd

/var/www/html/cacti/rra/db-master-2_mem_cache_155.rrd

/var/www/html/cacti/rra/db-master-2_mem_buffers_154.rrd

/var/www/html/cacti/rra/db-m2-slave-1_mem_free_191.rrd

/var/www/html/cacti/rra/localhost_mem_buffers_3.rrd

/var/www/html/cacti/rra/db-m2-slave-2_mem_free_164.rrd

/var/www/html/cacti/rra/db-m2-slave-2_mem_buffers_162.rrd

/var/www/html/cacti/rra/db-m2-slave-1_mem_buffers_54.rrd

/var/www/html/cacti/rra/db-m2-slave-1_mem_swap_55.rrd

/var/www/html/cacti/rra/db-master-2_lock_system_memory_114.rrd

/var/www/html/cacti/rra/db-m2-slave-2_mem_cache_163.rrd

/var/www/html/cacti/rra/db-m2-slave-1_mem_cache_190.rrd

/var/www/html/cacti/rra/db-master-2_mem_free_146.rrd

[Email protected] local]#

[Email protected] local]# RRDtool info/var/www/html/cacti/rra/db-m2-slave-1_mem_free_191.rrd |grep mem_free

filename = "/VAR/WWW/HTML/CACTI/RRA/DB-M2-SLAVE-1_MEM_FREE_191.RRD"

Ds[mem_free].type = "GAUGE"

Ds[mem_free].minimal_heartbeat = 120

Ds[mem_free].min = 0.0000000000e+00

Ds[mem_free].max = 1.0000000000e+07

Ds[mem_free].last_ds = "34166500"

Ds[mem_free].value = NaN

Ds[mem_free].unknown_sec = 2

[Email protected] local]#

Note: The maximum value of Ds[mem_free].max = 1.0000000000e+07 data is set to 10G

See how RRDtool can be modified to perform-help viewing:

[Email protected] local]# RRDtool--help

RRDtool 1.3.8 Copyright 1997-2009 by Tobias oetiker <[email protected]>

Compiled 21 2010 10:57:18

usage:rrdtool [Options] Command command_options

Valid commands:create, Update, Updatev, graph, GRAPHV, dump, restore,

Last, Lastupdate, first, info, fetch, tune,

Resize, xport

RRDtool is distributed under the Terms of the GNU general

Public License Version 2. (www.gnu.org/copyleft/gpl.html)

For more information read the RRD manpages

[Email protected] local]#

Modify with the tune command parameter:

[Email protected] rra]# RRDtool tune *_MEM_FREE_*.RRD mem_free:100000000

Ds[mem_free] Typ:gauge hbt:120 min:0.0000 max:10000000.0000

[Email protected] rra]#

There is a message, the table name tune failed, the original is less than a parameter, re-modify the following:

[Email protected] rra]# RRDtool tune *_mem_cache_*.rrd-a mem_cache:3000000000

[Email protected] rra]# RRDtool tune *_mem_free_*.rrd-a mem_free:3000000000

[Email protected] rra]# RRDtool tune *_mem_buffers_*.rrd-a mem_buffers:3000000000

[Email protected] rra]#

found here RRDtool after execution, there is only one Host of the host nan become a number, the other host has not changed, the reason is because rrdtool Tune * -a ... command only one . RRD the file works and the rest needs to be manually executed again and again RRDtool Tune command.

To simplify the operation, an SSH script was specifically written as follows:

Vim/root/rrdtool_increate_mem.shcd/var/www/html/cacti/rrals *_mem_free_*.rrd-1 >a_mem_free.txtfor i in ' Cat A_mem _free.txt ' Dorrdtool tune $i-a mem_free:300000000;done;ls *_mem_cache_*.rrd-1 >a_mem_cache.txtfor i in ' Cat A_MEM_CAC He.txt ' Dorrdtool tune $i-a mem_cache:300000000;done;ls *_mem_buffers_*.rrd-1 >a_mem_buffers.txtfor i in ' Cat A_mem_b Uffers.txt ' Dorrdtool tune $i-a mem_buffers:300000000;done;

directly sh/root/rrdtool_increate_mem.sh can be.


Added

To debug a cacti graph, proceed as follows:

(1) Console , then enter graph Manager , then enter, select the Host, search Memory, select the map you want, click the link, for example, I am here Memory Usage, as shown in:

(2) Click on the Memory Usage link and click Debug mode in the upper right corner:

(3) You will see the following debug interface, you can slowly observe the RRDTool command commands, why is the -nan value.

(eight): Dual NIC Traffic network card traffic problem

For example, EM1 and em2 all point to an IP address, but EM1 does not take effect, em2 effective, but the IP address on the EM1, does not appear in the EM2 column.

So, on the graph graph, there is no data, all-nan-values, as follows:

in the Cacti Server above execution Check :

[Email protected] rra]# snmpwalk-v 2c-c public 10.254.3.72 IF-MIB::IFDESCR

If-mib::ifdescr.1 = String:lo

If-mib::ifdescr.2 = String:em1

IF-MIB::IFDESCR.3 = string:em2

IF-MIB::IFDESCR.4 = String:em3

IF-MIB::IFDESCR.5 = String:em4

[Email protected] rra]#

Indeed there are 4 network card information records, these are OK, normal, after careful investigation found the main reason in the dropdown box to choose interface–traffic (bits/sec), do not choose interface–traffic ( BYTES/SEC)as shown in:

When Interface–traffic (bits/sec) is selected, graph will show the data.


(ix): InnoDB active/locked transactions

RRDTool Says:

Error:opening '/var/www/html/cacti/rra/db-m1-slave-1_locked_transactions_215.rrd ': No such file or directory

The reason is that the MySQL database account that has cacti access on the MySQL server is not created, the MySQL account is created, and the problem is resolved.

(10): Tomcat-connection Rate

RRDTool Says:

Error:invalid Y-grid Format

Enter console-->graph templates->tomcat-connection rate->unit Grid Value (--unit/--y-grid)
The default value of 1 changes to 0.




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.