Permalink
Browse files

Make category an instance variable for bug avoidance.

  • Loading branch information...
aouyar committed Oct 1, 2012
1 parent fb0a7fd commit 20d8cbb2e17675b7dc9100f0845a16ee75bddd0c
@@ -84,11 +84,11 @@ def __init__(self, argv=(), env=None, debug=False):
self._password = self.envGet('password')
self._statuspath = self.envGet('statuspath')
self._ssl = self.envCheckFlag('ssl', False)
- category = 'Apache'
+ self._category = 'Apache'
if self.graphEnabled('apache_access'):
graph = MuninGraph('Apache Web Server - Throughput (Requests / sec)',
- category,
+ self._category,
info='Throughput in Requests per second for Apache Web Server.',
args='--base 1000 --lower-limit 0')
graph.addField('reqs', 'reqs', draw='LINE2', type='DERIVE', min=0,
@@ -97,14 +97,14 @@ def __init__(self, argv=(), env=None, debug=False):
if self.graphEnabled('apache_bytes'):
graph = MuninGraph('Apache Web Server - Througput (bytes/sec)',
- category,
+ self._category,
info='Throughput in bytes per second for Apache Web Server.',
args='--base 1024 --lower-limit 0')
graph.addField('bytes', 'bytes', draw='LINE2', type='DERIVE', min=0)
self.appendGraph('apache_bytes', graph)
if self.graphEnabled('apache_workers'):
- graph = MuninGraph('Apache Web Server - Workers', category,
+ graph = MuninGraph('Apache Web Server - Workers', self._category,
info='Worker utilization stats for Apache Web server.',
args='--base 1000 --lower-limit 0')
graph.addField('busy', 'busy', draw='AREASTACK', type='GAUGE',
@@ -108,7 +108,7 @@ def __init__(self, argv=(), env=None, debug=False):
self._amiport = self.envGet('amiport', None, int)
self._amiuser = self.envGet('amiuser')
self._amipass = self.envGet('amipass')
- category = 'Asterisk'
+ self._category = 'Asterisk'
self._ami = AsteriskInfo(self._amihost, self._amiport,
self._amiuser, self._amipass)
@@ -135,7 +135,7 @@ def __init__(self, argv=(), env=None, debug=False):
self._trunkList.append(mobj.groups())
if self.graphEnabled('asterisk_calls'):
- graph = MuninGraph('Asterisk - Call Stats', category,
+ graph = MuninGraph('Asterisk - Call Stats', self._category,
info='Asterisk - Information on Calls.', period='minute',
args='--base 1000 --lower-limit 0')
graph.addField('active_calls', 'active_calls', type='GAUGE',
@@ -145,7 +145,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_calls', graph)
if self.graphEnabled('asterisk_channels'):
- graph = MuninGraph('Asterisk - Active Channels', category,
+ graph = MuninGraph('Asterisk - Active Channels', self._category,
info='Asterisk - Information on Active Channels.',
args='--base 1000 --lower-limit 0')
for field in self._chanList:
@@ -156,7 +156,7 @@ def __init__(self, argv=(), env=None, debug=False):
if (self.graphEnabled('asterisk_peers_sip')
and self._ami.hasChannelType('sip')):
- graph = MuninGraph('Asterisk - VoIP Peers - SIP', category,
+ graph = MuninGraph('Asterisk - VoIP Peers - SIP', self._category,
info='Asterisk - Information on SIP VoIP Peers.',
args='--base 1000 --lower-limit 0')
for field in ('online', 'unmonitored', 'unreachable',
@@ -166,7 +166,7 @@ def __init__(self, argv=(), env=None, debug=False):
if (self.graphEnabled('asterisk_peers_iax2')
and self._ami.hasChannelType('iax2')):
- graph = MuninGraph('Asterisk - VoIP Peers - IAX2', category,
+ graph = MuninGraph('Asterisk - VoIP Peers - IAX2', self._category,
info='Asterisk - Information on IAX2 VoIP Peers.',
args='--base 1000 --lower-limit 0')
for field in ('online', 'unmonitored', 'unreachable',
@@ -178,7 +178,7 @@ def __init__(self, argv=(), env=None, debug=False):
and (self._ami.hasChannelType('sip')
or self._ami.hasChannelType('iax2'))):
graph = MuninGraph('Asterisk - VoIP Codecs for Active Channels',
- category,
+ self._category,
info='Asterisk - Codecs for Active VoIP Channels (SIP/IAX2)',
args='--base 1000 --lower-limit 0')
for field in self._codecList:
@@ -188,7 +188,7 @@ def __init__(self, argv=(), env=None, debug=False):
if (self.graphEnabled('asterisk_conferences')
and self._ami.hasConference()):
- graph = MuninGraph('Asterisk - Conferences', category,
+ graph = MuninGraph('Asterisk - Conferences', self._category,
info='Asterisk - Information on Meetme Conferences',
args='--base 1000 --lower-limit 0')
graph.addField('rooms', 'rooms', type='GAUGE', draw='LINE2',
@@ -199,7 +199,7 @@ def __init__(self, argv=(), env=None, debug=False):
if (self.graphEnabled('asterisk_voicemail')
and self._ami.hasVoicemail()):
- graph = MuninGraph('Asterisk - Voicemail', category,
+ graph = MuninGraph('Asterisk - Voicemail', self._category,
info='Asterisk - Information on Voicemail Accounts',
args='--base 1000 --lower-limit 0')
graph.addField('accounts', 'accounts', type='GAUGE', draw='LINE2',
@@ -213,7 +213,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_voicemail', graph)
if self.graphEnabled('asterisk_trunks') and len(self._trunkList) > 0:
- graph = MuninGraph('Asterisk - Trunks', category,
+ graph = MuninGraph('Asterisk - Trunks', self._category,
info='Asterisk - Active calls on trunks.',
args='--base 1000 --lower-limit 0',
autoFixNames = True)
@@ -241,7 +241,7 @@ def __init__(self, argv=(), env=None, debug=False):
if self._queues is not None and len(self._queue_list) > 0:
if self.graphEnabled('asterisk_queue_len'):
- graph = MuninGraph('Asterisk - Queues - Calls in Queue', category,
+ graph = MuninGraph('Asterisk - Queues - Calls in Queue', self._category,
info='Asterisk - Queues - Number of calls in queues.',
args='--base 1000 --lower-limit 0')
for queue in self._queue_list:
@@ -250,7 +250,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_queue_len', graph)
if self.graphEnabled('asterisk_queue_avg_hold'):
graph = MuninGraph('Asterisk - Queues - Average Hold Time (sec)',
- category,
+ self._category,
info='Asterisk - Queues - Average Hold Time.',
args='--base 1000 --lower-limit 0')
for queue in self._queue_list:
@@ -259,7 +259,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_queue_avg_hold', graph)
if self.graphEnabled('asterisk_queue_avg_talk'):
graph = MuninGraph('Asterisk - Queues - Average Talk Time (sec)',
- category,
+ self._category,
info='Asterisk - Queues - Average Talk Time.).',
args='--base 1000 --lower-limit 0')
for queue in self._queue_list:
@@ -268,7 +268,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_queue_avg_talk', graph)
if self.graphEnabled('asterisk_queue_calls'):
graph = MuninGraph('Asterisk - Queues - Calls per Minute',
- category, period='minute',
+ self._category, period='minute',
info='Asterisk - Queues - Abandoned/Completed Calls per minute.',
args='--base 1000 --lower-limit 0')
graph.addField('abandon', 'abandon', type='DERIVE', draw='AREASTACK',
@@ -278,7 +278,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.appendGraph('asterisk_queue_calls', graph)
if self.graphEnabled('asterisk_queue_abandon_pcent'):
graph = MuninGraph('Asterisk - Queues - Abandoned Calls (%)',
- category,
+ self._category,
info='Asterisk - Queues - Abandoned calls vs, total calls.',
args='--base 1000 --lower-limit 0')
for queue in self._queue_list:
@@ -290,7 +290,7 @@ def __init__(self, argv=(), env=None, debug=False):
if self._ami.hasFax():
if self.graphEnabled('asterisk_fax_attempts'):
graph = MuninGraph('Asterisk - Fax Stats',
- category, period='minute',
+ self._category, period='minute',
info='Asterisk - Fax - Fax Recv / Send Attempts per minute.',
args='--base 1000 --lower-limit 0')
graph.addField('send', 'send', type='DERIVE', draw='AREASTACK',
@@ -73,7 +73,7 @@ def __init__(self, argv=(), env=None, debug=False):
"""
MuninPlugin.__init__(self, argv, env, debug)
- category = 'Disk IO'
+ self._category = 'Disk IO'
self._info = DiskIOinfo()
@@ -147,7 +147,7 @@ def _configDevRequests(self, namestr, titlestr, devlist):
"""
name = 'diskio_%s_requests' % namestr
if self.graphEnabled(name):
- graph = MuninGraph('Disk I/O - %s - Requests' % titlestr, category,
+ graph = MuninGraph('Disk I/O - %s - Requests' % titlestr, self._category,
info='Disk I/O - %s Throughput, Read / write requests per second.'
% titlestr,
args='--base 1000 --lower-limit 0',
@@ -177,7 +177,7 @@ def _configDevBytes(self, namestr, titlestr, devlist):
"""
name = 'diskio_%s_bytes' % namestr
if self.graphEnabled(name):
- graph = MuninGraph('Disk I/O - %s - Throughput' % titlestr, category,
+ graph = MuninGraph('Disk I/O - %s - Throughput' % titlestr, self._category,
info='Disk I/O - %s Throughput, bytes read / written per second.'
% titlestr,
args='--base 1000 --lower-limit 0', printf='%6.1lf',
@@ -208,7 +208,7 @@ def _configDevActive(self, namestr, titlestr, devlist):
name = 'diskio_%s_active' % namestr
if self.graphEnabled(name):
graph = MuninGraph('Disk I/O - %s - Queue Length' % titlestr,
- category,
+ self._category,
info='Disk I/O - Number of I/O Operations in Progress for every %s.'
% titlestr,
args='--base 1000 --lower-limit 0', printf='%6.1lf',
@@ -73,7 +73,7 @@ def __init__(self, argv=(), env=None, debug=False):
self.envRegisterFilter('fspaths', '^[\w\-\/]+$')
self.envRegisterFilter('fstypes', '^\w+$')
- category = 'Disk Usage'
+ self._category = 'Disk Usage'
self._statsSpace = None
self._statsInode = None
@@ -87,7 +87,7 @@ def __init__(self, argv=(), env=None, debug=False):
name = 'diskspace'
if self.graphEnabled(name):
self._statsSpace = self._info.getSpaceUse()
- graph = MuninGraph('Disk Space Usage (%)', category,
+ graph = MuninGraph('Disk Space Usage (%)', self._category,
info='Disk space usage of filesystems.',
args='--base 1000 --lower-limit 0', printf='%6.1lf',
autoFixNames=True)
@@ -103,7 +103,7 @@ def __init__(self, argv=(), env=None, debug=False):
name = 'diskinode'
if self.graphEnabled(name):
self._statsInode = self._info.getInodeUse()
- graph = MuninGraph('Inode Usage (%)', category,
+ graph = MuninGraph('Inode Usage (%)', self._category,
info='Inode usage of filesystems.',
args='--base 1000 --lower-limit 0', printf='%6.1lf',
autoFixNames=True)
@@ -75,10 +75,10 @@ def __init__(self, argv=(), env=None, debug=False):
self._fshost = self.envGet('fshost')
self._fsport = self.envGet('fsport', None, int)
self._fspass = self.envGet('fspass')
- category = 'FreeSwitch'
+ self._category = 'FreeSwitch'
if self.graphEnabled('fs_calls'):
- graph = MuninGraph('FreeSWITCH - Active Calls', category,
+ graph = MuninGraph('FreeSWITCH - Active Calls', self._category,
info = 'FreeSWITCH - Number of Active Calls.',
args = '--base 1000 --lower-limit 0')
graph.addField('calls', 'calls', type='GAUGE',
@@ -84,11 +84,11 @@ def __init__(self, argv=(), env=None, debug=False):
self._password = self.envGet('password')
self._statuspath = self.envGet('statuspath')
self._ssl = self.envCheckFlag('ssl', False)
- category = 'Lighttpd'
+ self._category = 'Lighttpd'
if self.graphEnabled('lighttpd_access'):
graph = MuninGraph('Lighttpd Web Server - Throughput (Requests / sec)',
- category,
+ self._category,
info='Throughput in Requests per second for Lighttpd Web Server.',
args='--base 1000 --lower-limit 0')
graph.addField('reqs', 'reqs', draw='LINE2', type='DERIVE', min=0,
@@ -97,14 +97,14 @@ def __init__(self, argv=(), env=None, debug=False):
if self.graphEnabled('lighttpd_bytes'):
graph = MuninGraph('Lighttpd Web Server - Througput (bytes/sec)',
- category,
+ self._category,
info='Throughput in bytes per second for Lighttpd Web Server.',
args='--base 1024 --lower-limit 0')
graph.addField('bytes', 'bytes', draw='LINE2', type='DERIVE', min=0)
self.appendGraph('lighttpd_bytes', graph)
if self.graphEnabled('lighttpd_servers'):
- graph = MuninGraph('Lighttpd Web Server - Servers', category,
+ graph = MuninGraph('Lighttpd Web Server - Servers', self._category,
info='Server utilization stats for Lighttpd Web server.',
args='--base 1000 --lower-limit 0')
graph.addField('busy', 'busy', draw='AREASTACK', type='GAUGE',
Oops, something went wrong.

0 comments on commit 20d8cbb

Please sign in to comment.