so if i have a host that is running 3 instances (11211,11212,11213) and if i created 2 more xxx.py files and edited the port, how does this solve the graphing? as the graph template looks at the data template and its looking at a ceretain data input method, wouldnt the be global if i pointed the data template to a new data input? i edited the template with a line telling me which port, but each time i import, the templates get over written. is there way for the template not to get over written each time i try to upload a modified memcache template?TECK wrote:nohau, this is very easy.
Simply create a new python_11212.py file and edit there the lines:Replace the port with your specific value.Code: Select all
parser.set_defaults(port = "11211") parser.add_option("-p", "--port", dest="port", metavar="PORT", help="default memcached port [default: 11211]")
Then, point your cacti template path to the new file you just created. Simple, eh?
memcached Host Template and Graphs (ver 1.0)
Moderators: Developers, Moderators
-
- Posts: 5
- Joined: Wed Sep 12, 2007 4:34 pm
Client API won't install
Followed the instructions for installing the client API and I get:
Traceback (most recent call last):
File "setup.py", line 3, in ?
from setuptools import setup
ImportError: No module named setuptools
What am I missing? Trying to install on Centos 4.5 with python 2.3.4.
Traceback (most recent call last):
File "setup.py", line 3, in ?
from setuptools import setup
ImportError: No module named setuptools
What am I missing? Trying to install on Centos 4.5 with python 2.3.4.
xml import screws with RRA settings
I love the script and the graphs, but I'd like to point out a major annoyance with the setup procedure. This is perhaps a Cacti problem rather than a problem with this script but I thought I'd point it out anyway.
The XML import file (cacti_memcached_host_template.xml) includes RRA settings which Cacti blithely imports. These are GLOBAL settings and a single data query should not be messing around with them. I had to go back and fix this after the import.
The XML import file (cacti_memcached_host_template.xml) includes RRA settings which Cacti blithely imports. These are GLOBAL settings and a single data query should not be messing around with them. I had to go back and fix this after the import.
usage on multiple ports
I was wondering if anyone can assist with this.
I'm going to ask a question that appeared to be answered above, but the above answer doesn't quite work:
I have multiple memcache instances running on different ports, and I would like to monitor these different ports.
The problem is that I can't add modify the xml templates to include these different ports.
I tried modifiying the cacti template, changing all of the name and title fields to include the port number (so they would be unique)
but when I import the individual xml files, they overwrite each other, and I'm only left with one single data template (usually the last one i import)
So, I thought that if I modified the hash_ xml fields, replacing hash_ with hash_port again, to make them unique across all the xml templates that it would fix it. No such luck, in fact it won't even load the xml.
so, how can I fix this? Ideally I would love to be able to add the memcache data element multiple times to my custom device template, and pass a port value to them, but I'm willing to do whatever is neccesary to get this to work.
thanks in advance!
I'm going to ask a question that appeared to be answered above, but the above answer doesn't quite work:
I have multiple memcache instances running on different ports, and I would like to monitor these different ports.
The problem is that I can't add modify the xml templates to include these different ports.
I tried modifiying the cacti template, changing all of the name and title fields to include the port number (so they would be unique)
but when I import the individual xml files, they overwrite each other, and I'm only left with one single data template (usually the last one i import)
So, I thought that if I modified the hash_ xml fields, replacing hash_ with hash_port again, to make them unique across all the xml templates that it would fix it. No such luck, in fact it won't even load the xml.
so, how can I fix this? Ideally I would love to be able to add the memcache data element multiple times to my custom device template, and pass a port value to them, but I'm willing to do whatever is neccesary to get this to work.
thanks in advance!
usage on multiple ports
When displaying memcache graphs for multiple ports and multiple servers, did you also try adding the multiple Graph Templates ( each for a different port) in the Host Template. Do this in the 'console' tab and under 'Associated Graph Templates' ...
-
- Posts: 5
- Joined: Tue Apr 08, 2008 3:12 pm
-
- Posts: 8
- Joined: Sun Mar 16, 2008 9:20 pm
Abnormal memcached graph result
Hi all,
I had imported the memcached template, everything seemed fine. All the graphs could show successfully.
However, I found an unexpected behaviour. Please refer to the attached photo.
My question is: if the memcahced get is larger than set, why memcached write is greater than read? the ratio is extremely abnormal> 16M : 800k, how come???
Can anyone help me explain this situation??? Thanks
Victor
I had imported the memcached template, everything seemed fine. All the graphs could show successfully.
However, I found an unexpected behaviour. Please refer to the attached photo.
My question is: if the memcahced get is larger than set, why memcached write is greater than read? the ratio is extremely abnormal> 16M : 800k, how come???
Can anyone help me explain this situation??? Thanks
Victor
- Attachments
-
- memcached
- memcached.JPG (75.69 KiB) Viewed 11832 times
-
- Posts: 8
- Joined: Sun Mar 16, 2008 9:20 pm
Memcached is correct
Hi all,
According to the defintion,
http://code.sixapart.com/svn/memcached/ ... otocol.txt
bytes_read > Total number of bytes read by this server from network
bytes_written > Total number of bytes sent by this server to network
If it is the case, we achieve our purpose. The memcached is correct, thanks.
According to the defintion,
http://code.sixapart.com/svn/memcached/ ... otocol.txt
bytes_read > Total number of bytes read by this server from network
bytes_written > Total number of bytes sent by this server to network
If it is the case, we achieve our purpose. The memcached is correct, thanks.
-
- Posts: 12
- Joined: Fri Sep 05, 2008 9:14 am
- Location: Bosnia
- Contact:
I have same problem. I need monitoring 3 instances. I create Data Input Methods, Data Templates and Graph Templates but not working.anson wrote:so if i have a host that is running 3 instances (11211,11212,11213) and if i created 2 more xxx.py files and edited the port, how does this solve the graphing? as the graph template looks at the data template and its looking at a ceretain data input method, wouldnt the be global if i pointed the data template to a new data input? i edited the template with a line telling me which port, but each time i import, the templates get over written. is there way for the template not to get over written each time i try to upload a modified memcache template?TECK wrote:nohau, this is very easy.
Simply create a new python_11212.py file and edit there the lines:Replace the port with your specific value.Code: Select all
parser.set_defaults(port = "11211") parser.add_option("-p", "--port", dest="port", metavar="PORT", help="default memcached port [default: 11211]")
Then, point your cacti template path to the new file you just created. Simple, eh?
Any ideia??
Thanks!!
Small modification memcached.py to work with fuelpump
"total_items" is not in the response from fuelpump, this takes care of that by defaulting to values to zero.
[/code]
Code: Select all
#!/usr/bin/python
import sys
import memcache
from optparse import OptionParser
stats = {'total_items': 0, 'bytes_written': 0, 'uptime': 0, 'bytes': 0,
'cmd_get': 0, 'curr_items': 0, 'curr_connections': 0, 'connection_structures': 0,
'limit_maxbytes': 0, 'rusage_user': 0.0, 'total_connections': 0, 'cmd_set': 0,
'time': 0, 'get_misses': 0, 'bytes_read': 0, 'rusage_system': 0.0, 'get_hits': 0}
parser = OptionParser(usage="usage: %prog [-h] [-p PORT] HOSTNAME1 HOSTNAME2 ...\nTotals will be returned for multiple HOSTNAME arguments.")
parser.set_defaults(port = "11211")
parser.add_option("-p", "--port", dest="port", metavar="PORT",
help="default memcached port [default: 11211]")
(options, args) = parser.parse_args()
hosts = []
if (args):
for host in args:
hosts.append("%s:%s" % (host, options.port));
else:
parser.error("At least one HOSTNAME is required.")
sys.exit(1)
mc = memcache.Client(hosts, debug=0)
mem_stats = mc.get_stats()
if (not mem_stats):
sys.exit()
if (len(mem_stats) > 1):
for mstat in mem_stats:
for key, val in stats.iteritems():
if (key == 'rusage_user' or key == 'rusage_system'):
stats[key] += float(mstat[1][key])
else:
stats[key] += int(mstat[1].get(key,0))
else:
mstat = mem_stats[0][1];
for key, val in stats.iteritems():
if (key == 'rusage_user' or key == 'rusage_system'):
stats[key] = float(mstat[key])
else:
stats[key] = int(mstat.get(key,0))
for stat, count in stats.iteritems():
print "%s:%s" % (stat, count),
Who is online
Users browsing this forum: No registered users and 0 guests