aboutsummaryrefslogtreecommitdiffstats
path: root/collect.d
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2010-01-21 13:44:46 +0000
committerPetter Reinholdtsen <pere@hungry.com>2010-01-21 13:44:46 +0000
commitf0f8937a52565ba021e02970260ff1fe518e9145 (patch)
treecc13db041556a699a48effa72c5cdfa43a865ee1 /collect.d
parent719414b5a7604ab762c21aff015f7dccc2c83973 (diff)
downloadsitesummary-f0f8937a52565ba021e02970260ff1fe518e9145.tar.gz
sitesummary-f0f8937a52565ba021e02970260ff1fe518e9145.tar.bz2
sitesummary-f0f8937a52565ba021e02970260ff1fe518e9145.tar.xz
Collect switch port information using CPD when cdpr is installed.
Recommend cdpr to increase the chance of finding cdpr.
Diffstat (limited to 'collect.d')
-rw-r--r--collect.d/system13
1 files changed, 13 insertions, 0 deletions
diff --git a/collect.d/system b/collect.d/system
index 4ec5438..71c2f38 100644
--- a/collect.d/system
+++ b/collect.d/system
@@ -63,3 +63,16 @@ done
if [ -f /etc/X11/xorg.conf ]; then
cp /etc/X11/xorg.conf .
fi
+
+# Collect Cisco Discover Protocol information from all interfaces, in
+# parallell.
+if type cdpr >/dev/null 2>&1; then
+ childs=""
+ for if in $(ip link show up|awk '/^[0-9]+:/ {print $2}' | cut -d: -f1) ; do
+ cdpr -d $if -t 61 > cdpr.$if &
+ childs="$childs $!"
+ done
+ for pid in $childs ; do
+ wait $pid
+ done
+fi