forked from mobiletulip/munin-kannel-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkannel_mt_throughput
executable file
·37 lines (30 loc) · 994 Bytes
/
kannel_mt_throughput
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
import urllib2
from xml.etree.ElementTree import XML
import sys
import os
import kannel_util
def print_config():
print "graph_order dlr sms"
print "graph_title Kannel throughput (outgoing traffic)"
print "graph_args --base 1000"
print "graph_vlabel SMS sent (+) / DLRs received (-) per ${graph_period}"
print "graph_category kannel"
print "graph_info This graph shows outbound SMS and inbound DLR throughput"
print "dlr.label DLR rate"
print "dlr.type DERIVE"
print "dlr.graph no"
print "dlr.min 0"
print "sms.label Traffic"
print "sms.type DERIVE"
print "sms.negative dlr"
print "sms.min 0"
def print_data():
status = kannel_util.get_status()
print "dlr.value " + str(status['dlr']['received']['total'])
print "sms.value " + str(status['sms']['sent']['total'])
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "config":
print_config()
else:
print_data()