From 4f6d983ffa7ab621a4abef4ba043b42d14026ecb Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Mon, 1 Mar 2010 17:05:36 -0300 Subject: Added scripts for network uptime accounting --- scripts/netmonitor_down | 11 +++++++++++ scripts/netmonitor_up | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100755 scripts/netmonitor_down create mode 100755 scripts/netmonitor_up (limited to 'scripts') diff --git a/scripts/netmonitor_down b/scripts/netmonitor_down new file mode 100755 index 0000000..6ce6064 --- /dev/null +++ b/scripts/netmonitor_down @@ -0,0 +1,11 @@ +#!/bin/sh +# +# simple log the time when connection was started +# + +if [ -r /etc/sysconfig/network-scripts/ifcfg-$1 ]; then + . /etc/sysconfig/network-scripts/ifcfg-$1 + if [ "a$ACCOUNTING" = "ayes" ]; then + echo $1:DOWN:$(date +%s) >> /var/log/net_monitor + fi +fi diff --git a/scripts/netmonitor_up b/scripts/netmonitor_up new file mode 100755 index 0000000..a0cba3f --- /dev/null +++ b/scripts/netmonitor_up @@ -0,0 +1,11 @@ +#!/bin/sh +# +# simple log the time when connection was started +# + +if [ -r /etc/sysconfig/network-scripts/ifcfg-$1 ]; then + . /etc/sysconfig/network-scripts/ifcfg-$1 + if [ "a$ACCOUNTING" = "ayes" ]; then + echo $1:UP:$(date +%s) >> /var/log/net_monitor + fi +fi -- cgit v1.2.1