Can't get mysql script to work with graphs

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
duderuud
Posts: 2
Joined: Mon Mar 22, 2004 6:10 pm

Can't get mysql script to work with graphs

Post by duderuud »

Hello all,

First of all...I'm new to Cacti, and not very familiar with monitoring.
Cacti now runs well on my machine, but the only thing that's not working, are the mysql-stats.
I use the mysql-file posted on this board, and it also gives a nice output:

Code: Select all

php mysql_monitoring.php
Questions:13673478 Slow_queries:22 Qcache_queries_in_cache:6964 Qcache_inserts:2183967 Qcache_hits:3860586 Qcache_lowmem_prunes:40335 Qcache_not_cached:111314 Qcache_free_memory:23567408 Qcache_free_blocks:5275 Qcache_total_blocks:19404
That works fine....but how can I make nice graphs with it? I read the manual, and followed all the steps in the example, but the grids of the graph stay empty...
Can someone post a step-by-step howto for converting phpscript output to graphs? I would be very grateful!
Guest

Post by Guest »

Nobody? Pls help...
Guest

Post by Guest »

Nobody??
User avatar
dieter
Cacti User
Posts: 164
Joined: Fri Feb 20, 2004 3:08 pm

Post by dieter »

Nobody!
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Re: Can't get mysql script to work with graphs

Post by Morgan »

duderuud wrote:Hello all,

First of all...I'm new to Cacti, and not very familiar with monitoring.
Cacti now runs well on my machine, but the only thing that's not working, are the mysql-stats.
I use the mysql-file posted on this board, and it also gives a nice output:

Code: Select all

php mysql_monitoring.php
Questions:13673478 Slow_queries:22 Qcache_queries_in_cache:6964 Qcache_inserts:2183967 Qcache_hits:3860586 Qcache_lowmem_prunes:40335 Qcache_not_cached:111314 Qcache_free_memory:23567408 Qcache_free_blocks:5275 Qcache_total_blocks:19404
That works fine....but how can I make nice graphs with it? I read the manual, and followed all the steps in the example, but the grids of the graph stay empty...
Can someone post a step-by-step howto for converting phpscript output to graphs? I would be very grateful!
i can but monday from work.
or u can look for my bind 8 graphs, and use those as an example for the data template especially.
User avatar
dieter
Cacti User
Posts: 164
Joined: Fri Feb 20, 2004 3:08 pm

Post by dieter »

@ work you should be working :P
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

1-

createa a data input method.

Name: choose a name
Input Type: script/command
Input string: /usr/local/bin/perl <path_cacti>/scripts/myscript name
(since ur using php, replace the FULL path to perl, with your full path to php

Input fields:
things like ip address or community or whatever it is u need to pass to your script as argument, if anything

Output Fields:
(choose your own friendly names, and mark update RRA)
CASE MUST MATCH EXACTLY. (upper and lower case)

Questions
Slow_queries
Qcache_queries_in_cache
Qcache_inserts


(etc. you get the idea. use the same name as what's displayed in your script, just remove all the : )


Same your data input method.
Create a new data TEMPLATE

Choose a name for it
Data source

Name: |host_description| -whateverhere
data input method. Select the data input method created above.
Data source active must be checked.


Data source Item:

create one data source item PER value being returned by your script.
for example, if your script returns 10 diff values, create 10 data source items.
i use the Output field name_STATS name for each of my data sources to keep them straight. example: Questions_STATS Slow_queries_STATS
etc
choose the appropriate min and max value, the type of data source, counter gauge etc, and then the output field.

then you do the same with a graph template and you carry on.
If you want an example on how i did the same thing, look at

http://www.raxnet.net/board/viewtopic.php?t=3361

i did the same thing for my bind 8 stats. it's basically the same principle.

hope this helps.
User avatar
Morgan
Cacti User
Posts: 187
Joined: Wed Feb 25, 2004 3:38 am

Post by Morgan »

dieter wrote:@ work you should be working :P
i try not to work every sunday if i can avoid it.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests