def __init__(self, argv=(), env=None, debug=False):
MuninPlugin.__init__(self, argv, env, debug)<EOL>self.envRegisterFilter('<STR_LIT>', '<STR_LIT>')<EOL>self._amihost = self.envGet('<STR_LIT>')<EOL>self._amiport = self.envGet('<STR_LIT>', None, int)<EOL>self._amiuser = self.envGet('<STR_LIT>')<EOL>self._amipass = self.envGet('<STR_LIT>')<EOL>self._category = '<STR_LIT>'<EOL>self._ami = AsteriskInfo(self._amihost, self._amiport, <EOL>self._amiuser, self._amipass)<EOL>self._codecList = (self.envGetList('<STR_LIT>') <EOL>or ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL>self._chanList = []<EOL>for chanstr in (self.envGetList('<STR_LIT>') <EOL>or ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']):<EOL><INDENT>chan = chanstr.lower()<EOL>if self._ami.hasChannelType(chan):<EOL><INDENT>if chan in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if '<STR_LIT>' not in self._chanList:<EOL><INDENT>self._chanList.append('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._chanList.append(chan)<EOL><DEDENT><DEDENT><DEDENT>self._trunkList = []<EOL>for trunk_entry in self.envGetList('<STR_LIT>', None):<EOL><INDENT>mobj = (re.match('<STR_LIT>',  trunk_entry, re.IGNORECASE) <EOL>or re.match('<STR_LIT>',  trunk_entry,  re.IGNORECASE))<EOL>if mobj:<EOL><INDENT>self._trunkList.append(mobj.groups())<EOL><DEDENT><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>', period='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>',<EOL>draw='<STR_LIT>',info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>','<STR_LIT>', type='<STR_LIT>', min=<NUM_LIT:0>,<EOL>draw='<STR_LIT>', info='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for field in self._chanList:<EOL><INDENT>graph.addField(field, field, type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in self._chanList:<EOL><INDENT>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if (self.graphEnabled('<STR_LIT>') <EOL>and self._ami.hasChannelType('<STR_LIT>')):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for field in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', <EOL>'<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>graph.addField(field, field, type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if (self.graphEnabled('<STR_LIT>') <EOL>and self._ami.hasChannelType('<STR_LIT>')):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for field in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', <EOL>'<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>graph.addField(field, field, type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if (self.graphEnabled('<STR_LIT>') <EOL>and (self._ami.hasChannelType('<STR_LIT>') <EOL>or self._ami.hasChannelType('<STR_LIT>'))):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for field in self._codecList:<EOL><INDENT>graph.addField(field, field, type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if (self.graphEnabled('<STR_LIT>') <EOL>and self._ami.hasConference()):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>', <EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>', <EOL>info='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if (self.graphEnabled('<STR_LIT>')<EOL>and self._ami.hasVoicemail()):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>') and len(self._trunkList) > <NUM_LIT:0>:<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>',<EOL>autoFixNames = True)<EOL>for trunk in self._trunkList:<EOL><INDENT>graph.addField(trunk[<NUM_LIT:0>], trunk[<NUM_LIT:0>], type='<STR_LIT>', draw='<STR_LIT>')<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>self._queues = None<EOL>self._queue_list = None<EOL>if ((self.graphEnabled('<STR_LIT>')<EOL>or self.graphEnabled('<STR_LIT>')<EOL>or self.graphEnabled('<STR_LIT>')<EOL>or self.graphEnabled('<STR_LIT>')<EOL>or self.graphEnabled('<STR_LIT>'))<EOL>and self._ami.hasQueue()):<EOL><INDENT>self._queues = self._ami.getQueueStats()<EOL>self._queue_list = [queue for queue in self._queues.keys()<EOL>if self.envCheckFilter('<STR_LIT>', queue)]<EOL>self._queue_list.sort()<EOL>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>self._queues_prev = self.restoreState()<EOL>if self._queues_prev is None:<EOL><INDENT>self._queues_prev = self._queues<EOL><DEDENT>self.saveState(self._queues)<EOL><DEDENT><DEDENT>if self._queues is not None and len(self._queue_list) > <NUM_LIT:0>:<EOL><INDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for queue in self._queue_list:<EOL><INDENT>graph.addField(queue, queue, type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>' % queue)<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for queue in self._queue_list:<EOL><INDENT>graph.addField(queue, queue, type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>' % queue)<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for queue in self._queue_list:<EOL><INDENT>graph.addField(queue, queue, type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>' % queue)<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category, period='<STR_LIT>',<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category,<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>for queue in self._queue_list:<EOL><INDENT>graph.addField(queue, queue, type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>' <EOL>% queue)<EOL><DEDENT>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT><DEDENT>if self._ami.hasFax():<EOL><INDENT>if self.graphEnabled('<STR_LIT>'):<EOL><INDENT>graph = MuninGraph('<STR_LIT>', <EOL>self._category, period='<STR_LIT>',<EOL>info='<STR_LIT>',<EOL>args='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>graph.addField('<STR_LIT>', '<STR_LIT>', type='<STR_LIT>', draw='<STR_LIT>',<EOL>info='<STR_LIT>')<EOL>self.appendGraph('<STR_LIT>', graph)<EOL><DEDENT><DEDENT>
Populate Munin Plugin with MuninGraph instances.

        @param argv:  List of command line arguments.
        @param env:   Dictionary of environment variables.
        @param debug: Print debugging messages if True. (Default: False)