MySQL DBA - Tips and Techniques Magazine

11 Nov 2014

Adding MYSQL database to CACTI



IP address =  10.44.xx.yy

username = a

password = a





1)     Create cacti user on the Master machine of the one you want to monitor :


·       Connect to HOST server

·       Mysql –uXXXX -pXXXX

·       GRANT SUPER ON *.* TO cactiuser@'' IDENTIFIED BY 'cactiuserxx';

·       GRANT PROCESS ON *.* TO cactiuser@'' IDENTIFIED BY 'cactiuserxx';

·       flush privileges;


In case of an Issue with the Firewall, do the following grant statement to allow access through the Firewall.



'cactiuser'@'' IDENTIFIED BY BY 'cactiuserxx';


·       flush privileges;






      To enable Cacti graphing for a MYSQL database we first need to make sure       that the Cacti server can connect to the HOST server


·       Connect to CACTI server as your own user

·       Mysql –h[host server] –ucactiuserxx -pcactiuserxx


If you can connect, continue to step 3, if you cannot, you probably have firewall issue.  Solve this before moving on.


3)     Adding new HOST server to Cacti – WEB frontend


·       Go to "http://10.44.xx.xx/cacti/"

·       Login as Admin

·       On left menu – click 'devices'

·       Top right – Click 'add'

·       Fill in information :

o   Description

o   Hostname

o   HOST TEMPLATE – use "teMySql Host

o   All other fields leave as default.

o   Bottom right – Click 'Create'



      Creating graphs for HOST server – straight after step 3


·       On Console tab

·       Select Devices

·       Click on relevant host name

·       Change Host Template to be relevant OS with '/ mysql'

·       Click Save

·       Click – 'Create graphs for this HOST'

·       This list all available items to graphs, click

o   all of Graphs Templates

o   all of Data Query, except

§  Memory Buffers

§  /proc

o   External IP address in Data Query

·       Change Select a graph type to in/Out Unicast Packets

·       Click 'Create'

·       You will need to add username and password for catctiuser for all monitored item, so cut and paste username and password in the form.

·       Click on 'Graph trees' 'mysql' 'Add'

·       Fill out form

o   Tree Item Type – HOST

o   HOST – <name of server>

o   Graph template

·       Click on 'create'



5)     Check the graphs for New HOST server


·       Click on 'Graphs'

·       Click on New HOST server

·       You should now be able to see the new HOST server graph.  Please note that  it takes around 5 minutes to poll.

·       If after 5 minutes the grapsh are empty, refer back to systems team

PERCONA cacti plugins

No comments:

Post a Comment