memcached Host Template and Graphs (ver 1.0)

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

Moderators: Moderators, Developers

Author
Message
danbeck
Posts: 30
Joined: Tue Jun 20, 2006 12:08 pm
Location: Huntsville, Alabama
Contact:

memcached Host Template and Graphs (ver 1.0)

#1 Post by danbeck » Tue Jul 04, 2006 12:04 am

Hi all,

For some time now I've been wanting to release some of the custom templates that I've created for various devices on our network. This will be the first release of several that I hope others will find useful.

ANNOUNCING:

The Cacti memcached template - Version 1.0

This template provides a host template and associated graphs for graphing the output of the memcached stats command on individual memcached installations.

Graphs are provided for Bytes Used with total capacity, Cache Hits and Misses per second, Current Connections, Items Cached, Inbound and Outbound Network Traffic (bits per second), and Requests per Second for both the get and set commands.

The latest version and installation instructions can be found at http://dealnews.com/developers/cacti/memcached.html.

SCREENSHOTS:

Image Image ImageImage Image Image

Comments, questions, suggestions and bugs are all welcome. Let me know what you think.
Last edited by danbeck on Tue Jul 04, 2006 10:58 am, edited 1 time in total.
-Daniel

[url=http://dealnews.com/developers/cacti/memcached.html]memcached Template[/url] - Version 1.0

[url=http://dealnews.com/developers/]dealnews.com/developers[/url] - Useful scripts and Cacti templates.
[url=http://dealnews.com/]dealnews.com[/url] - How to go broke saving money.

User avatar
twelzy
Cacti User
Posts: 80
Joined: Wed Mar 30, 2005 6:48 pm
Location: BRAZIL/Brasilia

#2 Post by twelzy » Tue Jul 04, 2006 9:04 am

Hi danbeck,

I'm considering install memcached to improve the overall Cacti system performance.
Does Cacti need to be modified in some way in order to use memcached?!

Thanks in advance!
(And sorry for my poor English...)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)

danbeck
Posts: 30
Joined: Tue Jun 20, 2006 12:08 pm
Location: Huntsville, Alabama
Contact:

#3 Post by danbeck » Tue Jul 04, 2006 11:04 am

twelzy wrote:I'm considering install memcached to improve the overall Cacti system performance.
Does Cacti need to be modified in some way in order to use memcached?!
I honestly have no idea if Cacti could even make use of a caching mechanism like memcached and if it did, whether it would even make much of a difference, would be arguable.

In any case, for an application to make use of memcached, it has to be written to do so. Memcached is not a drop in replacement for any common caching or storage system on any operating system.

(What does this have to do with my memcached template above, anyway?)
-Daniel

[url=http://dealnews.com/developers/cacti/memcached.html]memcached Template[/url] - Version 1.0

[url=http://dealnews.com/developers/]dealnews.com/developers[/url] - Useful scripts and Cacti templates.
[url=http://dealnews.com/]dealnews.com[/url] - How to go broke saving money.

suse
Posts: 23
Joined: Sun Nov 13, 2005 1:05 am

#4 Post by suse » Sat Aug 26, 2006 8:20 pm

I installed it , but graph is empty
here is my poller log

Code: Select all

08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[48] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[48] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[47] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[47] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[43] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[43] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
but manal running that cat get data

Code: Select all

python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233
total_items:628109404 get_hits:682553365 uptime:1978185 cmd_get:740226642 time:1156640901 bytes:609012366 curr_connections:306 connection_structures:4544 bytes_written:144079881093 limit_maxbytes:1073741824 cmd_set:628109136 curr_items:7854323 rusage_user:16269.967588 get_misses:57673277 rusage_system:36313.105568 bytes_read:80539007152 total_connections:55513236

jeffand
Posts: 1
Joined: Wed May 24, 2006 1:46 pm
Contact:

Help with additional memcache regions on different ports

#5 Post by jeffand » Mon Dec 11, 2006 5:42 pm

Thanks for this plugin it's excellent. However I have a server that runs multiple memcache regions at different ports and I'd like to have a template that takes the port number in addition to the hostname as arguments so I can plot graphs for them too. Is this possible at all?

Thanks,
--jeff
--Jeff

stijink
Posts: 1
Joined: Mon Jan 22, 2007 4:47 pm

Strange Behaivour

#6 Post by stijink » Mon Jan 22, 2007 4:54 pm

Hi,

i installed your plugin a couple of days ago. Works fine so far. But I have a some strange numbers on a couple of graph's. The maximum number is extraordinary high sometimes. Have you seen this kind of behaivour before, or is is a thing of our software ?

See attached file.

Greetz,
Stephan
Attachments
graph_image.gif
cacti graph
graph_image.gif (17.68 KiB) Viewed 57195 times

TECK
Posts: 16
Joined: Sun May 27, 2007 2:13 am
Contact:

#7 Post by TECK » Sun May 27, 2007 8:15 pm

Excellent job. :)
I even built an RPM for it because I don't keep the scripts into:
/var/www/html/stats/scripts

Very happy with the new memcached stats.
[b][url=http://www.yqed.com/]yqed.com[/url] (why queued) - my blog[/b]

Colosus
Posts: 13
Joined: Wed May 16, 2007 4:58 am

#8 Post by Colosus » Thu Jun 07, 2007 1:32 pm

I have this same problem. Has anyone found a fix or identified the cause?
suse wrote:I installed it , but graph is empty
here is my poller log

Code: Select all

08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[48] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[48] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[47] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[47] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DEBUG: The POPEN returned the following File Descriptor 8
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] ERROR: Empty result [192.168.10.233]: 'python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233'
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[43] WARNING: Result from SCRIPT not valid. Partial Result: ...
08/26/2006 09:20:03 PM - CACTID: Poller[0] Host[3] DS[43] SCRIPT: python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233, output: U
but manal running that cat get data

Code: Select all

python /home/httpd/htdocs/cacti/scripts/memcached.py 192.168.10.233
total_items:628109404 get_hits:682553365 uptime:1978185 cmd_get:740226642 time:1156640901 bytes:609012366 curr_connections:306 connection_structures:4544 bytes_written:144079881093 limit_maxbytes:1073741824 cmd_set:628109136 curr_items:7854323 rusage_user:16269.967588 get_misses:57673277 rusage_system:36313.105568 bytes_read:80539007152 total_connections:55513236

Colosus
Posts: 13
Joined: Wed May 16, 2007 4:58 am

#9 Post by Colosus » Thu Jun 07, 2007 11:01 pm

Figured it out. I had to add the full path to python in the Data Input template. Everything works now. Thanks.

decals74
Posts: 6
Joined: Sat Jun 09, 2007 4:37 pm

#10 Post by decals74 » Sat Jun 09, 2007 5:14 pm

Works great right out the box. Thanks!

nohau
Posts: 1
Joined: Tue Jun 19, 2007 4:02 pm

Question

#11 Post by nohau » Tue Jun 19, 2007 4:05 pm

I have multiple memcached services running on a single server on different ports . What would be the best method graph them individually ? Can this be done. I see where you can the -p flag but that is for just that one. Is there a way we enable a port function so people who have multiple instances of the daemon running can get stats from them all?

TECK
Posts: 16
Joined: Sun May 27, 2007 2:13 am
Contact:

#12 Post by TECK » Thu Jun 21, 2007 9:33 pm

nohau, this is very easy.
Simply create a new python_11212.py file and edit there the lines:

Code: Select all

parser.set_defaults(port = "11211")
parser.add_option("-p", "--port", dest="port", metavar="PORT",
                  help="default memcached port [default: 11211]")
Replace the port with your specific value.
Then, point your cacti template path to the new file you just created. Simple, eh? :)
[b][url=http://www.yqed.com/]yqed.com[/url] (why queued) - my blog[/b]

shock
Posts: 5
Joined: Thu Jul 19, 2007 11:01 am

#13 Post by shock » Thu Jul 19, 2007 11:13 am

Hello,

while trying to run against memcached 1.1.11 I noticed that rusage_user and rusage_system both return a ":" instead of a suspected "."

Attached is a patch to fix this.

Regards
Attachments
memcached.py_rusage.patch.txt
(887 Bytes) Downloaded 1257 times

shock
Posts: 5
Joined: Thu Jul 19, 2007 11:01 am

Re: Strange Behaivour

#14 Post by shock » Fri Jul 20, 2007 3:32 am

stijink wrote:Hi,

i installed your plugin a couple of days ago. Works fine so far. But I have a some strange numbers on a couple of graph's. The maximum number is extraordinary high sometimes. Have you seen this kind of behaivour before, or is is a thing of our software ?

See attached file.

Greetz,
Stephan
We have exactly the same issue right now here. Any hints?

Regards

mdecandia
Posts: 1
Joined: Wed Jul 25, 2007 7:50 am

Memcached Polling frequency

#15 Post by mdecandia » Wed Jul 25, 2007 7:55 am

Hi all,
I want to increase polling frequency for memcached server because I need more detailed memcached performance statistics: at least 1 request every minute.

Any idea?
Thanks,
Michele

Post Reply