Script Server Version of teMySQL stats and Host Template

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

Moderators: Developers, Moderators

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

Post by mahuani »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
sizulku
Cacti User
Posts: 110
Joined: Mon Nov 04, 2002 9:15 am
Location: ACEH
Contact:

Post by sizulku »

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 23293 times
User avatar
NHDave
Cacti User
Posts: 61
Joined: Sun Mar 20, 2005 9:14 am
Contact:

Post by NHDave »

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:

Post by mahuani »

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

Post by gilles »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

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:

Post by mahuani »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
n00b
Posts: 6
Joined: Wed Sep 28, 2005 4:21 am

Post by n00b »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
pookey
Posts: 5
Joined: Wed Nov 15, 2006 4:40 pm

Post by pookey »

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

Who is online

Users browsing this forum: No registered users and 2 guests