Skip to content

Commit

Permalink
Merge pull request #29 from jmordica/patch-3
Browse files Browse the repository at this point in the history
small update to cope with larger call volume
  • Loading branch information
vfuse authored Feb 7, 2018
2 parents 4dfa3c1 + 6f6d6d7 commit 3ba9555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixstatsagent/plugins/asterisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import plugins
import subprocess

### You need to add `nixstats ALL=(ALL) NOPASSWD: /usr/sbin/asterisk` to /etc/sudoers in order for this to work

class Plugin(plugins.BasePlugin):
__name__ = 'asterisk'

def run(self, *unused):
p = subprocess.Popen("sudo asterisk -rx 'core show calls' | grep 'active' | cut -f1 -d ' '", stdout=subprocess.PIPE, shell=True)
p, err = p.communicate()[0].decode('utf-8')
p = p.communicate()[0].decode('utf-8').replace("\n", "")
p = { "calls": p }
return p

Expand Down

0 comments on commit 3ba9555

Please sign in to comment.