summaryrefslogtreecommitdiffstats
path: root/misc/snmptrap/snmptrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/snmptrap/snmptrap.sh')
-rwxr-xr-xmisc/snmptrap/snmptrap.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/snmptrap/snmptrap.sh b/misc/snmptrap/snmptrap.sh
new file mode 100755
index 00000000..fbbe2f7a
--- /dev/null
+++ b/misc/snmptrap/snmptrap.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+
+read hostname
+read ip
+read uptime
+read oid
+read address
+read community
+read enterprise
+
+oid=`echo $oid|cut -f2 -d' '`
+address=`echo $address|cut -f2 -d' '`
+community=`echo $community|cut -f2 -d' '`
+enterprise=`echo $enterprise|cut -f2 -d' '`
+
+oid=`echo $oid|cut -f11 -d'.'`
+community=`echo $community|cut -f2 -d'"'`
+
+str="$hostname $address $community $enterprise $oid"
+
+#echo $oid >>/tmp/log
+#echo $address >>/tmp/log
+#echo $community >>/tmp/log
+#echo $enterprise >>/tmp/log
+
+>/tmp/log
+echo $str >>/tmp/log