aboutsummaryrefslogtreecommitdiffstats
path: root/src/monitor.py
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.com>2011-01-16 15:07:55 -0200
committerEugeni Dodonov <eugeni@mandriva.com>2011-01-16 15:07:55 -0200
commitc310f8a59a199b3b1487f5d3c208c265cd269e0b (patch)
treef4d0aa8877478ace0ff1047d90feffb68b2f419a /src/monitor.py
parent94d93f98fa69fcca2b9743bdf43429f22b528a70 (diff)
downloadnet_monitor-c310f8a59a199b3b1487f5d3c208c265cd269e0b.tar
net_monitor-c310f8a59a199b3b1487f5d3c208c265cd269e0b.tar.gz
net_monitor-c310f8a59a199b3b1487f5d3c208c265cd269e0b.tar.bz2
net_monitor-c310f8a59a199b3b1487f5d3c208c265cd269e0b.tar.xz
net_monitor-c310f8a59a199b3b1487f5d3c208c265cd269e0b.zip
move check_network_accounting to monitor.py
Diffstat (limited to 'src/monitor.py')
-rw-r--r--src/monitor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/monitor.py b/src/monitor.py
index 8cf3138..53bfdd0 100644
--- a/src/monitor.py
+++ b/src/monitor.py
@@ -213,6 +213,14 @@ class Monitor:
traceback.print_exc()
return net
+ def check_network_accounting(self, iface):
+ """Checks if network accounting was enabled on interface"""
+ try:
+ os.stat("/var/lib/vnstat/%s" % iface)
+ return True
+ except:
+ return False
+
def get_traffic(self, iface, net=None):
"""Get traffic information"""
device_exists=False