Script Server Version of teMySQL stats and Host Template

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

Moderators: Moderators, Developers

Author
Message
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Script Server Version of teMySQL stats and Host Template

#1 Post by mahuani » Tue Oct 10, 2006 12:49 pm

The Witness has converted the teMySQL stats script and host template to Script Server for us!

The modified php script can be found here

And, the host template can be found here

Many thanks to everyone who contributed to this script/template. Especially The Witness who converted it to Script Server, after I failed miserably.

Be sure to rebuild your poller's cache after you import it. The template is setup for a 5 minute polling interval. I have a 30 second interval template if anyone is interested. Some of the graphs are still logarithmic (edit the graph template and uncheck the box to change it)

After the conversion the load on my cacti box has dropped considerably.

Enjoy!

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#2 Post by TheWitness » Tue Oct 10, 2006 6:35 pm

Do you have some before and after snapshots on load average?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

#3 Post by sizulku » Wed Oct 11, 2006 10:05 am

I'm having problem when importing cacti_host_template_temysql_host.xml to my cacti. Any help would be great. Thanks.
Attachments
cacti-error.jpg
cacti-error.jpg (94.57 KiB) Viewed 22064 times

User avatar
NHDave
Cacti User
Posts: 61
Joined: Sun Mar 20, 2005 9:14 am
Contact:

#4 Post by NHDave » Wed Oct 11, 2006 11:29 am

Looks like the template was exported in the new "i" version. Upgraded mine and it imported fine.

User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

#5 Post by mahuani » Wed Oct 11, 2006 1:37 pm

I had that problem too, but I figured it was a good time to upgrade anyway. The upgrade went fine, so I was happy. :D

User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

#6 Post by gilles » Wed Oct 11, 2006 3:07 pm

i have problems with this

Code: Select all

10/11/2006 09:10:36 PM - PHPSVR: Poller[0] DEBUG: INC: 'E:/www/cacti/scripts/ss_mysql_stats.php' FUNC: 'ss_mysql_stats' PARMS: 'command 127.0.0.1rootxxx'
10/11/2006 09:10:36 PM - CMDPHP: Poller[0] ERROR: MySQL Stats - Parameters Missing, can not continue
10/11/2006 09:10:36 PM - CMDPHP: Poller[0] ERROR: MySQL Stats - Connect failed. Check MySQL parameters (host/login/password)
10/11/2006 09:10:36 PM - CACTID: Poller[0] Host[69] DS[778] SS[0] WARNING: Result from SERVER not valid.  Partial Result: ...
10/11/2006 09:10:36 PM - CACTID: Poller[0] Host[69] DS[778] SS[0] SERVER: E:/www/cacti/scripts/ss_mysql_stats.php ss_mysql_stats command 127.0.0.1rootxxx, output: U
10/11/2006 09:10:37 PM - PHPSVR: Poller[0] DEBUG: INC: 'E:/www/cacti/scripts/ss_mysql_stats.php' FUNC: 'ss_mysql_stats' PARMS: 'handler 127.0.0.1rootxxx'
10/11/2006 09:10:37 PM - CMDPHP: Poller[0] ERROR: MySQL Stats - Parameters Missing, can not continue
10/11/2006 09:10:37 PM - CMDPHP: Poller[0] ERROR: MySQL Stats - Connect failed. Check MySQL parameters (host/login/password)
at the cli, it works

i don't understand why i don't have space between hostname, username and password

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#7 Post by TheWitness » Wed Oct 11, 2006 7:23 pm

Yea, this must be an issue with the template export. We need to submit a bug reports on this.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

#8 Post by mahuani » Thu Oct 12, 2006 11:20 am

gilles

Code: Select all

10/11/2006 09:10:36 PM - PHPSVR: Poller[0] DEBUG: INC: 'E:/www/cacti/scripts/ss_mysql_stats.php' FUNC: 'ss_mysql_stats' PARMS: 'command 127.0.0.1rootxxx' 


I had this problem too, but when I looked at the xml, the spaces were there. Edit the Data Inupt Method -> Input String and add the spaces. You'll probably have to do it to all the DIMs untill we can figure out what the problem is.

~Jonathan

User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

#9 Post by mahuani » Thu Oct 12, 2006 11:52 am

Something else I'm having problems with.

Image

This is happening to all my MySQL graphs with out any consistency. Sould I up the timeout value for the scripts?

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#10 Post by TheWitness » Thu Oct 12, 2006 5:31 pm

Review your Cacti log for odd messages. Also, confirm in the script the error level is set to '0'. It should be one of the first lines in the script.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

n00b
Posts: 6
Joined: Wed Sep 28, 2005 4:21 am

#11 Post by n00b » Fri Oct 13, 2006 3:26 am

10/13/2006 10:20:14 AM - CMDPHP: Poller[0] Host[4] DS[90] WARNING: Result from SERVER not valid. Partial Result: U
10/13/2006 10:20:14 AM - CMDPHP: Poller[0] ERROR: MySQL Stats - Connect failed. Check MySQL parameters (host/login/password)
10/13/2006 10:20:14 AM - CMDPHP: Poller[0] ERROR: MySQL Stats - Parameters Missing, can not continue
I just upgraded to cacti 086i, and imported the server script, and i got this error ...

Any clue ?

Logs is quite empty, and if I run the script from a command line I have a "U" as output ...

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#12 Post by TheWitness » Fri Oct 13, 2006 5:47 am

mahuani,

Can you edit your posted XML file and add the spaces.

gilles,

You know I'm after you about Manage 4.3. Are you planning on responding to my e-mails?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

#13 Post by mahuani » Sun Oct 15, 2006 9:17 pm

Here are some before and after screenshots of the load avg on one of my boxes.

Before:

Image

After:
Image

The after shot also includes a upgrade of rrdtool and cacti

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#14 Post by TheWitness » Mon Oct 16, 2006 6:29 am

Cut in half, that's good.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

pookey
Posts: 5
Joined: Wed Nov 15, 2006 4:40 pm

#15 Post by pookey » Wed Nov 15, 2006 4:55 pm

I'm getting an error of 'ERROR: invalid y-grid format

I edited the graph template, putting " " arround the y-grid title, but still the same problem

Thanks!

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Local MySQL Server - teMySQL - Old Handler Stats" \
--base=1000 \
--height=150 \
--width=600 \
--alt-autoscale-max \
--lower-limit=1 \
--y-grid=access units \
--vertical-label="" \
--slope-mode \
DEF:a="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_rnd_next:AVERAGE \
DEF:b="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_first:AVERAGE \
DEF:c="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_key:AVERAGE \
DEF:d="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_next:AVERAGE \
DEF:e="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_prev:AVERAGE \
DEF:f="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":read_rnd:AVERAGE \
DEF:g="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":delete:AVERAGE \
DEF:h="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":update:AVERAGE \
DEF:i="/var/www//htdocs/cacti/rra/local_mysql_server_write_73.rrd":write:AVERAGE \
AREA:a#FFD660:"Read Rnd Next"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MIN:"Min\:%8.2lf %s"  \
GPRINT:a:MAX:"Max\:%8.2lf %s\n"  \
LINE1:b#FF4105:"Read First"  \
GPRINT:b:LAST:"   Current\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MIN:"Min\:%8.2lf %s"  \
GPRINT:b:MAX:"Max\:%8.2lf %s\n"  \
LINE1:c#623465:"Read Key"  \
GPRINT:c:LAST:"     Current\:%8.2lf %s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:c:MIN:"Min\:%8.2lf %s"  \
GPRINT:c:MAX:"Max\:%8.2lf %s\n"  \
LINE1:d#9FA4EE:"Read Next"  \
GPRINT:d:LAST:"    Current\:%8.2lf %s"  \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:d:MIN:"Min\:%8.2lf %s"  \
GPRINT:d:MAX:"Max\:%8.2lf %s\n"  \
LINE1:e#7EE600:"Read Prev"  \
GPRINT:e:LAST:"    Current\:%8.2lf %s"  \
GPRINT:e:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:e:MIN:"Min\:%8.2lf %s"  \
GPRINT:e:MAX:"Max\:%8.2lf %s\n"  \
LINE1:f#4444FF:"Read Rnd"  \
GPRINT:f:LAST:"     Current\:%8.2lf %s"  \
GPRINT:f:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:f:MIN:"Min\:%8.2lf %s"  \
GPRINT:f:MAX:"Max\:%8.2lf %s\n"  \
LINE1:g#797C6E:"Delete"  \
GPRINT:g:LAST:"       Current\:%8.2lf %s"  \
GPRINT:g:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:g:MIN:"Min\:%8.2lf %s"  \
GPRINT:g:MAX:"Max\:%8.2lf %s\n"  \
LINE1:h#005D57:"Update\:"  \
GPRINT:h:LAST:"      Current\:%8.2lf %s"  \
GPRINT:h:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:h:MIN:"Min\:%8.2lf %s"  \
GPRINT:h:MAX:"Max\:%8.2lf %s\n"  \
LINE1:i#005199:"write\:"  \
GPRINT:i:LAST:"       Current\:%8.2lf %s"  \
GPRINT:i:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:i:MIN:"Min\:%8.2lf %s"  \
GPRINT:i:MAX:"Max\:%8.2lf %s\n" 

RRDTool Says:

ERROR: invalid y-grid format

Post Reply