The MySQL Graph Collection - Version 2.0!

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Mr_Poche
Posts: 11
Joined: Wed Jan 19, 2005 10:15 am

Post by Mr_Poche »

This seems pretty nice, but i cannot get it to work.

Every privileges on my SQL Server is fine, i run the script manually and it works perfectly but the graph is always empty.

im trying to monitor my local MySQL Server.

Any idea?
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

Can't get this to work

Post by drywalldude »

I gotta figure this one out :

at the command line:

[root@linuxserver scripts]# php -q /opt/administration/cacti/scripts/mysql_stats.php handler localhost cactiuser "myhardpsswd" delete:4024 read_first:16901 read_key:197801 read_next:133943 read_prev:0 read_rnd:135120 read_rnd_next:824705 update:1238 write:127007

all permissions working fine this should work??????

Cacti log says :

01/28/2005 08:15:04 AM - SYSTEM STATS: Time: 3.2767 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
01/28/2005 08:15:03 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect
01/28/2005 08:15:03 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect
01/28/2005 08:10:04 AM - SYSTEM STATS: Time: 3.2612 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
01/28/2005 08:10:04 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect
01/28/2005 08:10:03 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect

needless to say graphs are empty :cry:

Graph import went well and I'm using "cactiuser" as apposed to cactiuser@localhost, but tryed both ways.

tryed entering manualy into data template : php -q /opt/administration/cacti/scripts/mysql_stats.php command localhost cactiuser "myhardpswd"

This produced one 5 minute post on graph but then stopped

Don't know what to do next kind of a newb, help to get this work would be appreciated, Thanks
Attachments
mysql_prob.JPG
mysql_prob.JPG (166.15 KiB) Viewed 34332 times
ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

Post by ottob »

hi,

please try to run it from command-line as the webserver-user (not as root) and see what happen...
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

run as webuser

Post by drywalldude »

sorry to ask this but what would the syntax be for this, the system will not let me logout and log back in at the command line as cactiuser????? :-?
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

Figured out the easy stuff

Post by drywalldude »

Figured ou the shell access prob but I honestly did not expect this:

bash-2.05a$ php -q /opt/administration/cacti/scripts/mysql_stats.php handler localhost cactiuser "mypswd"
delete:7586 read_first:25962 read_key:332347 read_next:227497 read_prev:0 read_rnd:237011 read_rnd_next:1143641 update:1964 write:232608

It worked (by the way this is a freh install of 8.6c)

still cluless I''ve given "cactiuser all the privaleges on can give and flushed.
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

Still no luck

Post by drywalldude »

Tryed making the additional user cacti@127.0.0.1 but to no avail :cry:

01/28/2005 07:40:03 PM - SYSTEM STATS: Time: 3.1523 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
01/28/2005 07:40:03 PM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect
ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

Post by ottob »

maybe a stupid question: did you really filled in the right values for username and password inside cacti (at the data source)? note that the fields are sorted unnormal (first password, then username)...

sorry for that question :wink:
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

No problem

Post by drywalldude »

I appreciate your help, yes I did this multiple times reinstalled/templates etc............... :o
drywalldude
Posts: 11
Joined: Fri Jan 28, 2005 9:41 pm
Location: USA
Contact:

Sorry for all the trouble..

Post by drywalldude »

Figured it out I guess upgraded to MySQL 4.0.23 and things seem to be working good. Still have one problem with the querycache graph.
log file reads :
1/29/2005 09:30:05 PM - SYSTEM STATS: Time: 4.1625 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
01/29/2005 09:25:04 PM - SYSTEM STATS: Time: 4.1703 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
01/29/2005 09:20:04 PM - SYSTEM STATS: Time: 4.1569 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 2, Hosts/Process: 2
GOOD
Attachments
query_cache.JPG
query_cache.JPG (185.42 KiB) Viewed 34255 times
zyeclone
Posts: 5
Joined: Sun Jan 30, 2005 1:10 pm

Post by zyeclone »

great script !!

thx for sharing
Attachments
graph.png
graph.png (8.26 KiB) Viewed 34229 times
Mr_Poche
Posts: 11
Joined: Wed Jan 19, 2005 10:15 am

Post by Mr_Poche »

Still trying to get this working, but i cant.

Here is the error of my poller :
01/31/2005 03:08:20 PM - CMDPHP: Poller[0] Host[2] WARNING: Result from CMD not valid. Partial Result:

When i run the script in console :
root@bretserv:/usr/local/apache2/secacti/scripts# php mysql_stat.php command localhost USER PASS
change_db:220122 delete:4499500 insert:4577368 select:4040935 update:314024

As you can see, the script is working, but why in cacti it isnt? I tried with every damn user , even nobody and the script works every time.

Why then i'm getting empty graph?
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

Post by byrons »

Hope this helps someone.

I found, in the Data Input Methods of, for example, "MySQL - Thread statistics", by swopping the <username> and the <password> within the command string it all seems to work.

Example:
<path_php_binary> -q <path_cacti>/scripts/mysql_stats.php thread <hostname> <username> <password>
to
<path_php_binary> -q <path_cacti>/scripts/mysql_stats.php thread <hostname> <password> <username>
Looking at the mysql_stats.php, logically, my way shouldn't work, but it does.

Maybe some explanation from the experts?

Cheers
Byron
cyablo
Posts: 4
Joined: Tue Feb 01, 2005 4:33 pm

Post by cyablo »

Be Sure your hostname of your device is: localhost NOT 127.0.0.1!
For me it was the Problem!

greetz

cyablo
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

Post by byrons »

That's odd, mine is 127.0.0.1 and it's working ok.
ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

Post by ottob »

note that the fields are sorted unnormal (first password, then username)...

sorry for that question
maybe this is the problem? (sorry again) :wink:
Last edited by ottob on Wed Feb 02, 2005 5:16 am, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests