aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xscripts/netmonitor_down11
-rwxr-xr-xscripts/netmonitor_up11
3 files changed, 24 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8b1430d..5d0b2a2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
Mandriva network monitoring tool -- History of user-visible changes
Copyright (C) 2009, Mandriva
+- added ifup.d and ifdown.d scripts for account network uptime
+
0.06:
- support selecting default monitoring interface from command line
- display interface icons when available
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