summaryrefslogtreecommitdiffstats
path: root/misc/snmptrap
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-26 18:26:42 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-01-26 18:26:42 +0000
commitdad437dd175d0aa13e1f52efc7f151ebda57feaa (patch)
treeb6a063d01ab1d2abad2975fb96c1650e00da41e2 /misc/snmptrap
parentde03b9ce1601c2ec461ab2d58b23e32ebc3e399b (diff)
downloadzabbix-dad437dd175d0aa13e1f52efc7f151ebda57feaa.tar.gz
zabbix-dad437dd175d0aa13e1f52efc7f151ebda57feaa.tar.xz
zabbix-dad437dd175d0aa13e1f52efc7f151ebda57feaa.zip
- added misc/snmptrap/snmptrap.sh (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@672 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'misc/snmptrap')
-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