Module: check_mk
Branch: master
Commit: f8790053ef39a7b2d0c167ec87230c109736e816
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f8790053ef39a7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 16 12:04:24 2011 +0200
AIX agent now simulates <<<netctr>>> output (by Jörg Linge)
---
ChangeLog | 1 +
agents/check_mk_agent.aix | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 516e448..47ef037 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
Checks & Agents:
* brocade_port: check for Brocade FC ports has been rewritten with
lots of new features.
+ * AIX agent now simulates <<<netctr>>> output (by Jörg Linge)
Multisite:
* Introduced basic infrastructure for multilanguage support in Multisite
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 2da06e9..7a5576e 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -68,6 +68,24 @@ procs=`vmstat|grep lcpu|sed -e 's;.* lcpu=\([[:digit:]]\{1,2\}\)
.*;\1;'`
echo $load 1/$ps $$ $procs
+# The following section has been contributed by Joerg Linge
+echo "<<<netctr>>>"
+date +%s
+for ent in $(ifconfig -a | grep '^en' | cut -d ":" -f 1)
+do
+ bytes=$(entstat $ent | grep ^Bytes: | awk '{printf "%s %s", $2,
$4}')
+ bytes_rx=$(echo $bytes | awk '{print $2'})
+ bytes_tx=$(echo $bytes | awk '{print $1'})
+ packets=$(entstat $ent | grep ^Packets: | awk '{printf "%s %s", $2,
$4}')
+ packets_rx=$(echo $packets | awk '{print $2'})
+ packets_tx=$(echo $packets | awk '{print $1'})
+ errors_tx=$(entstat $ent | grep 'Transmit Errors:' | awk '{print
$3'})
+ errors_rx=$(entstat $ent | grep 'Receive Errors:' | awk '{print
$6'})
+ echo "$ent $bytes_rx $packets_rx $errors_rx 0 0 0 0 0 $bytes_tx $packets_tx
$errors_tx 0 0 0 0 0"
+done
+
+
+
if cd $PLUGINSDIR 2>/dev/null
then
for skript in $(ls)