Changeset - b26808c36efa
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-07-30 11:11:58
hanzz.k@gmail.com
category spectrum2 for muning
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
munin/spectrum2_
Show inline comments
 
@@ -123,49 +123,49 @@ elif suffix == 'messages':
 
elif suffix == 'messages_sec':
 
	stat = { 'messages_from_xmpp': 'from_xmpp', 'messages_to_xmpp': 'to_xmpp' }
 
	title = "Messages send over transport per second"
 
	vlabel = "messages/sec"
 
	info = 'Messages send per second over spectrum transports.'
 
elif suffix == 'memory':
 
	stat = { 'used_memory': None }
 
	title = "Memory usage of transports"
 
	vlabel = "megabytes"
 
	transformer = lambda value: float(value)/1024.0
 
	info = 'Memory usage of spectrum transports.'
 
elif suffix == 'average_memory_per_user':
 
	stat = { 'average_memory_per_user': None }
 
	title = "Average memory usage per user"
 
	vlabel = "kilobytes"
 
	#transformer = lambda value: float(value)/1024.0
 
	info = 'Memory usage of spectrum transports.'
 

	
 
# handle config
 
if len( sys.argv ) > 1 and sys.argv[1] == 'config':
 
	print( """graph_title %s
 
graph_args --base 1000 -l 0
 
graph_scale no
 
graph_vlabel %s
 
graph_category transports
 
graph_category spectrum2
 
graph_info %s""" %(title, vlabel, info) )
 
	for jid in jids:
 
		if len(stat) > 1: 
 
			# plugin monitors more than one field
 
			label = jid + ' total'
 
			fieldname = handle_field( label )
 
			print( '%s.label %s' %(fieldname, label) )
 
			if suffix == 'messages_sec':
 
				print( '%s.type DERIVE' %(fieldname) )
 
				print( '%s.min 0' %(fieldname) )
 

	
 
			# to not print individual fields if verbose is not set:
 
			if not verbose: 
 
				continue
 

	
 
		for name, field_suffix in stat.iteritems():
 
			label = jid
 
			if field_suffix:
 
				label += ' ' + field_suffix
 
			fieldname = handle_field( label )
 
			print( '%s.label %s' %(fieldname, label) )
 
			if suffix == 'messages_sec':
 
				print( '%s.type DERIVE' %(fieldname) )
 
				print( '%s.min 0' %(fieldname) )
0 comments (0 inline, 0 general)