From c310f8a59a199b3b1487f5d3c208c265cd269e0b Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Sun, 16 Jan 2011 15:07:55 -0200 Subject: move check_network_accounting to monitor.py --- src/monitor.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/monitor.py') 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 -- cgit v1.2.1