memcached Host Template and Graphs (ver 1.0)

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

Moderators: Developers, Moderators

shadow338
Posts: 2
Joined: Tue Feb 10, 2009 6:59 pm

Memcached running in multiports

Post by shadow338 »

I'm having ots of problems to get this to work, I guess I have tried pure much everything posted in cacti forums. Aparently there's no solution yet in how to create graphs in multi memcached session. If any one knows how to do this your help will very welcomed.

Regards

H.
bitpusher
Posts: 29
Joined: Tue Jan 18, 2005 8:02 pm
Contact:

Re: Memcached running in multiports

Post by bitpusher »

shadow338 wrote:I'm having ots of problems to get this to work, I guess I have tried pure much everything posted in cacti forums. Aparently there's no solution yet in how to create graphs in multi memcached session. If any one knows how to do this your help will very welcomed.

Regards

H.
I'm also in the same situation. Has anybody come up with a goo solution for this?
-------------------
BitPusher, LLC
http://www.bitpusher.com/
1.888.9PUSHER
SeanW
Posts: 26
Joined: Tue Nov 28, 2006 9:17 am
Location: Winnipeg, Canada
Contact:

Re: memcached Host Template and Graphs (ver 1.0)

Post by SeanW »

danbeck wrote: Comments, questions, suggestions and bugs are all welcome. Let me know what you think.
Hi Dan,

I just installed the extensions, and when I run the test, I get:

Code: Select all

# python /var/www/cacti/scripts/memcached.py memcache1
Traceback (most recent call last):
  File "/var/www/cacti/scripts/memcached.py", line 44, in ?
    stats[key] = float(mstat[key])
KeyError: 'rusage_user'
My python-fu is pathetic, so I'm not sure which side of the assignment is even the problem. I did replace line 44 with "1", properly indented, which works (but the two rusage* parameters show 0). I don't think any of the graphs need that value, but I'd still like to get it working for cleanliness' state. Any ideas?

Thanks,

Sean
nnewton
Posts: 1
Joined: Fri Apr 24, 2009 4:17 pm

Re: Memcached running in multiports

Post by nnewton »

bitpusher wrote:
shadow338 wrote:I'm having ots of problems to get this to work, I guess I have tried pure much everything posted in cacti forums. Aparently there's no solution yet in how to create graphs in multi memcached session. If any one knows how to do this your help will very welcomed.

Regards

H.
I'm also in the same situation. Has anybody come up with a goo solution for this?
Yes actually. I had a client recently who was having an issue with multiport memcache templates and hired me to write in support for setting the port field in the graph creation screen. You can get them here: http://tag1consulting.com/node/58
islandsound
Posts: 5
Joined: Tue Apr 08, 2008 3:12 pm

not working

Post by islandsound »

not working for total bytes used
Miles
Posts: 1
Joined: Sat Jul 04, 2009 6:39 pm

Post by Miles »

Weird readings on traffic / request / hit-miss stats: that's caused by an incorrect setting.

Those 3 fields are defined as a COUNTER. If the next value is lower than the last, RRDTOOL assumes it overflowed on a 32/64 bit boundary and adds 2^32 or 2^64 to the value, causing a "massive traffic spike".

Is there any RRDTool expert here who can help fixing it? I'm not sure how to save the already distorted .rrd's, but I'll be changing those fields to a DERIVE field to avoid this happening again.


see: http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html, COUNTER vs DERIVE.

[edit]

Nevermind, dump to xml, edit, import is way too much work, I just removed the rrd's and started new ones.

[edit again]

Ah, I was too pessimistic. Following the steps on http://hints.jeb.be/2008/12/17/counter- ... h-rrdtool/, you can set a sane maximum, dump, restore with range check and fix the files. Just make sure you change the type of existing datasources to DERIVE to avoid trouble in the future after you fixed the templates.
soloslinger
Posts: 32
Joined: Fri Jan 19, 2007 2:11 pm

Re: not working

Post by soloslinger »

islandsound wrote:not working for total bytes used

I had a similar problem to this. But check to make sure that you are not including a 1 minute rra definition when you create the graph. The multiport template appeared to take all my rra definitions including one expected to be updated every minute while the rrd file's step was set to 300 (5 minutes). I recreated my graph without that rra and started seeing appropriate information.

hope this helps
soloslinger
plugin: 2.1
cacti: 0.8.7b
apache 2.0
php: 5.2.5
mysql: 5.1
os: freebsd 6.2
islandsound
Posts: 5
Joined: Tue Apr 08, 2008 3:12 pm

I see this in the logs

Post by islandsound »

This is from the first rev of memcached status:

06/11/2009 11:00:13 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/av-web01_bytes_975.rrd --template bytes:limit_maxbytes 1244743213:1869576932:2147483648

This is from the next release which has the multiport option:

06/11/2009 11:00:12 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/av-web01_bytes_951.rrd --template limit_maxbytes 1244743212:2147483648

I have both running to see what the differences are. I think the fact that it's not spitting out the second column "1869576932" which is the max being used, is causing the graph to fail. Any ideas?
aquel
Posts: 1
Joined: Fri Aug 28, 2009 8:06 am

Graphs are not showing up

Post by aquel »

Hi guys,

I tried to implement the memcache monitoring. I followed your installation tutorial but graphs are not showing up.
I think the RRDtool command fails

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1251377869 \
--end=1251464269 \
--title="Localhost - Memcached Bytes Used" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 27/08/2009 14\:57\:49 To 28/08/2009 14\:57\:49\c" \
COMMENT:"  \n" \
--vertical-label="bytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
AREA:#EAAF00FF:"Used"  \
GPRINT::LAST:"         Current\:%8.2lf %s"  \
GPRINT::AVERAGE:"Average\:%8.2lf %s"  \
GPRINT::MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:#000000FF:"Max Available"  \
GPRINT::LAST:"Current\:%8.2lf %s"  \
GPRINT::AVERAGE:"Average\:%8.2lf %s"  \
GPRINT::MAX:"Maximum\:%8.2lf %s" 
If I run it in my terminal I get as an output:

Code: Select all

ERROR: parameter '#EAAF00FF' does not represent a number in line AREA:#EAAF00FF:Used
Any idea would be helpful. Thanks for your work.

Axel
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

There is a set of memcached templates on http://code.google.com/p/mysql-cacti-templates/ that offers some improvements over the dealnews.com templates posted in this forum. Brian Moon from dealnews.com told me they have switched to use these instead of their own templates!

Full details and screenshots are on http://code.google.com/p/mysql-cacti-te ... dTemplates
cspenpen
Cacti User
Posts: 67
Joined: Tue Dec 05, 2006 5:10 am

Re:

Post by cspenpen »

pollervarchar.PNG
pollervarchar.PNG (3.85 KiB) Viewed 6113 times
I use boost server and the type of poller_output table is varchar(50).
So it just only can put 50 bytes.(see the output field in the graph)

when use command to get the value, it returns over 50 bytes

Code: Select all

[root@cacti3 scripts]# python memcached.py 172.25.7.1
total_items:470465905 get_hits:6584599018 uptime:25423301 cmd_get:6856899228 time:1286295184 bytes:6020901575 curr_connections:3 connection_structures:5888 bytes_written:3406868598252 limit_maxbytes:7340032000 cmd_set:470719054 curr_items:2850221 rusage_user:43026.825928 get_misses:272300210 rusage_system:83375.008072 bytes_read:1826075013654 total_connections:354580893
that's why some graph has problem, you just change the poller_output(poller_output_boost) table to fit the length.
but too long length with boost server will waste space, maybe need change another template.
gde
Posts: 13
Joined: Tue Oct 12, 2010 7:19 am

Re: memcached Host Template and Graphs (ver 1.0)

Post by gde »

There is a set of memcached templates on http://code.google.com/p/mysql-cacti-templates/ that offers some improvements over the dealnews.com templates posted in this forum. Brian Moon from dealnews.com told me they have switched to use these instead of their own templates!
Hello,

I would have liked to use these graphs, unfortunately they require a ssh connection, A luxury I don't have.
I might be able to push this template to my managers for the 'addition and evection' graph, but I need someone to tell me what it really graphs and how it's generated; especially the evictions. Are they gotten simply from the stats command or is it counted in a certain timeframe (like calculate the difference of total evictions from now and 5 minutes ago) ?

I've looked at the ss_get_by_ssh.php script but I'm no php developper and couldn't find the answer by myself unfortunatly.

Thank's for the help !

gde
|Cacti Version - 0.8.7g||Plugin Architecture - 2.8||Poller Type - Spine|
|os - Debian 5.0.6 | |Web Server - Apache/2.2.11 )|
|PHP - 5.2.6| |MySQL - 5.0.67| |RRDTool - 1.3.1|
picolo
Posts: 3
Joined: Sat Sep 18, 2010 3:56 pm

Re: memcached Host Template and Graphs (ver 1.0)

Post by picolo »

I am having problems making memcached.py work .Could some have a look at the the poller.php below (debug)

11/06/2010 04:52:45 PM - SYSTEM STATS: Time:8.7094 Method:cmd.php Processes:10 Threads:N/A Hosts:3 HostsPerProcess:1 DataSources:8 RRDsProcessed:6
11/06/2010 04:52:45 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/astaro__cpu_60.rrd --template cpu 1289062360:5
11/06/2010 04:52:44 PM - CMDPHP: Poller[0] Time: 5.6038 s, Theads: N/A, Hosts: 1
11/06/2010 04:52:44 PM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
11/06/2010 04:52:44 PM - CMDPHP: Poller[0] Host[6] DS[60] SERVER: /share/HDA_DATA/Qweb/cacti/scripts/ss_host_cpu.php ss_host_cpu 192.168.2.100 6 2:161:500:3:10:oHlQSDD9Nw1RE7iNYv66:::::: get usage 1, output: 5
11/06/2010 04:52:44 PM - PHPSVR: Poller[0] DEBUG: PID[9914] CTR[1] RESPONSE:''
11/06/2010 04:52:44 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/astaro__cpu_59.rrd --template cpu 1289062360:7
11/06/2010 04:52:44 PM - PHPSVR: Poller[0] DEBUG: PID[9914] CTR[1] INC: 'ss_host_cpu.php' FUNC: 'ss_host_cpu' PARMS: '192.168.2.100 6 2:161:500:3:10:oHlQSDD9Nw1RE7iNYv66:::::: get usage 1'
11/06/2010 04:52:44 PM - CMDPHP: Poller[0] Host[6] DS[59] SERVER: /share/HDA_DATA/Qweb/cacti/scripts/ss_host_cpu.php ss_host_cpu 192.168.2.100 6 2:161:500:3:10:oHlQSDD9Nw1RE7iNYv66:::::: get usage 0, output: 7
11/06/2010 04:52:44 PM - PHPSVR: Poller[0] DEBUG: PID[9914] CTR[0] RESPONSE:''
11/06/2010 04:52:43 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/astaro__traffic_in_51.rrd --template traffic_out:traffic_in 1289062360:2801413371:351424587
11/06/2010 04:52:43 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/astaro__traffic_in_52.rrd --template traffic_in:traffic_out 1289062360:451636552:505568168
11/06/2010 04:52:43 PM - PHPSVR: Poller[0] DEBUG: PID[9914] CTR[0] INC: 'ss_host_cpu.php' FUNC: 'ss_host_cpu' PARMS: '192.168.2.100 6 2:161:500:3:10:oHlQSDD9Nw1RE7iNYv66:::::: get usage 0'
11/06/2010 04:52:43 PM - CMDPHP: Poller[0] Host[6] DS[52] SNMP: v2: 192.168.2.100, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.4, output: 451636552
11/06/2010 04:52:42 PM - CMDPHP: Poller[0] Host[6] DS[52] SNMP: v2: 192.168.2.100, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.4, output: 505568168
11/06/2010 04:52:42 PM - CMDPHP: Poller[0] Host[6] DS[51] SNMP: v2: 192.168.2.100, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.3, output: 2801413371
11/06/2010 04:52:42 PM - CMDPHP: Poller[0] Host[6] DS[51] SNMP: v2: 192.168.2.100, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.3, output: 351424587
11/06/2010 04:52:42 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/nas_curr_connections_70.rrd --template 1289062359:U
11/06/2010 04:52:42 PM - POLLER: Poller[0] CACTI2RRD: /opt/bin/rrdtool update /share/HDA_DATA/Qweb/cacti/rra/nas_cmd_get_71.rrd --template 1289062359:U
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Time: 2.6076 s, Theads: N/A, Hosts: 1
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[10] DS[71] CMD: python /share/Qweb/cacti/scripts/memcached.py 192.168.2.4, output: U
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[10] DS[71] WARNING: Result from CMD not valid. Partial Result: U
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[10] DS[70] CMD: python /share/Qweb/cacti/scripts/memcached.py 192.168.2.4, output: U
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[10] DS[70] WARNING: Result from CMD not valid. Partial Result: U

11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[6] RECACHE DQ[1]: OID .1.3.6.1.2.1.2.1.0
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[6] RECACHE: Processing 1 items in the auto reindex cache for '192.168.2.100'.
11/06/2010 04:52:41 PM - CMDPHP: Poller[0] Host[6] SNMP: Host responded to SNMP
11/06/2010 04:52:40 PM - CMDPHP: Poller[0] PHP Script Server Started Properly
11/06/2010 04:52:40 PM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
11/06/2010 04:52:40 PM - PHPSVR: Poller[0] DEBUG: FILENM: /share/HDA_DATA/Qweb/cacti/script_server.php
11/06/2010 04:52:40 PM - PHPSVR: Poller[0] DEBUG: DIRNAM: /share/HDA_DATA/Qweb/cacti
11/06/2010 04:52:40 PM - PHPSVR: Poller[0] DEBUG: GETCWD: /share/HDA_DATA/Qweb/cacti
11/06/2010 04:52:40 PM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
11/06/2010 04:52:40 PM - CMDPHP: Poller[0] Host[10] RECACHE DQ[1]: OID .1.3.6.1.2.1.2.1.0
11/06/2010 04:52:40 PM - CMDPHP: Poller[0] Host[10] RECACHE: Processing 1 items in the auto reindex cache for '192.168.2.4'.
11/06/2010 04:52:40 PM - CMDPHP: Poller[0] Host[10] SNMP: Host responded to SNMP
11/06/2010 04:52:38 PM - POLLER: Poller[0] NOTE: There are no items in your poller for this polling cycle!
11/06/2010 04:52:37 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /opt/bin/php, ARGS: -q "/share/HDA_DATA/Qweb/cacti/cmd.php" 10 10]
11/06/2010 04:52:36 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /opt/bin/php, ARGS: -q "/share/HDA_DATA/Qweb/cacti/cmd.php" 6 6]
11/06/2010 04:52:36 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /opt/bin/php, ARGS: -q "/share/HDA_DATA/Qweb/cacti/cmd.php" 0 0]
11/06/2010 04:52:36 PM - POLLER: Poller[0] NOTE: Poller Int: '60', Cron Int: '300', Time Since Last: '115', Max Runtime '298', Poller Runs: '5'


I am also getting

Code: Select all

PHP Notice:  Trying to get property of non-object in /share/HDA_DATA/Qweb/cacti/lib/database.php on line 226
PHP Fatal error:  Call to a member function close() on a non-object in /share/HDA_DATA/Qweb/cacti/lib/database.php on line 231
Appreciate the help
y3rff3j
Posts: 4
Joined: Mon Mar 28, 2011 9:10 pm

Re: memcached Host Template and Graphs (ver 1.0)

Post by y3rff3j »

For the folks asking about monitoring a memcached server with multiple instances...

I had to tweak the data input method for the "Memcached - Statistics".

Input String:
(before) python <path_cacti>/scripts/memcached.py <hostname>
(after) python <path_cacti>/scripts/memcached.py -p <port> <hostname>

Input Fields:
Name: port
Friendly Name: Port to query for memcached statistics.
Regular Expression Match: (empty)
Allow Empty Input: unchecked
Special type Code: (empty)

For the all the Memcached Data Templates, you'll notice a new row under 'Custom Data [data input: Memcached - Statistics]'. Place a check mark on "Port to query for memcached statistics.". The input box should remain empty.

When you add a new device, select Memcached Server under Host Template. Create graphs for the host and select the memcached graphs. After clicking on create, it will prompt for the port number memcached is running on. Repeat this step for every instance you have. Just make sure you use a different description for the host each time. In my case, hostname (11211), hostname (11212), hostname (1121,) ..etc

Hope this helps you avoid creating a new data input method, data templates and graph templates for each instance. (just like i initially did)
specki
Posts: 32
Joined: Thu Jun 09, 2011 5:49 am
Location: Cologne, Germany

Re: memcached Host Template and Graphs (ver 1.0)

Post by specki »

hallo,
When i start the command on the consol then came:

Code: Select all

 python /usr/share/cacti/scripts/memcached.py ip
Traceback (most recent call last):
  File "/usr/share/cacti/scripts/memcached.py", line 4, in <module>
    import memcache
ImportError: No module named memcache
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests