diff --git a/README.md b/README.md index 45cdbd5..bb945e4 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Please adapt these three settings to your environment: * `domain` in `backends.py` should be the domain part of the queues/agents you want to display * `URI` in `queuemon.py` to access `mod_xml_rpc` * `hide_agents` can contain agents that should never be shown +* `hide_queues` can contain queues that should never be shown and it's agent too ## ToDo diff --git a/queuemon.py b/queuemon.py index 45731cb..beea234 100755 --- a/queuemon.py +++ b/queuemon.py @@ -25,12 +25,17 @@ from time import strftime from datetime import datetime import time +import re from backends import CallcenterStatusBackend app = Flask(__name__) backend = CallcenterStatusBackend +hide_queues = ( + 'somequeue@mydomain.example.com', + ) + hide_agents = ( 'someagent@mydomain.example.com', ) @@ -88,6 +93,11 @@ def status(): def status_content(): fs = backend(URI) agents = fs.get_agents() + for b in hide_queues: + b = re.sub('^.*@',"", b) + for a in agents.keys(): + if b in a: + del agents[a] for a in agents.keys(): if a in hide_agents: del agents[a] @@ -96,6 +106,9 @@ def status_content(): 'free': len([a['name'] for a in agents.itervalues() if a['status'] != 'Logged Out' and a.get('callstate') is None]) } queues = fs.get_queues() + for a in queues.keys(): + if a in hide_queues: + del queues[a] clock = strftime('%H:%M') if request.args.get('showclock') and request.args['showclock'] != 0 else None return render_template('status_content.html', agents=agents, agent_stats=agent_stats, queues=queues, clock=clock)