diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2015-05-08 12:59:21 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2015-05-08 12:59:21 +0200 |
commit | 020db3676e8571f90b083e4dbbe620080a34950d (patch) | |
tree | 1b7f781bbdaf8305913bbf5ed3fd30fa1e81f90c | |
parent | 80c10810cfcb9225eb68b876bc843ea5204dff3d (diff) |
Add local mibs and a script to fetch mibs
"Oooo, just use OID's instead!"
no.
-rwxr-xr-x | include/nms.pm | 1 | ||||
-rwxr-xr-x | tools/get_mibs.sh | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/nms.pm b/include/nms.pm index c61cec7..4012cc6 100755 --- a/include/nms.pm +++ b/include/nms.pm @@ -25,6 +25,7 @@ BEGIN { # cd /usr/share/mibs/site # wget -O- ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz | sudo tar --strip-components=3 -zxvvf - SNMP::initMib(); + SNMP::addMibDirs("../mibs"); SNMP::loadModules('SNMPv2-MIB'); SNMP::loadModules('ENTITY-MIB'); SNMP::loadModules('IF-MIB'); diff --git a/tools/get_mibs.sh b/tools/get_mibs.sh new file mode 100755 index 0000000..cab9fa3 --- /dev/null +++ b/tools/get_mibs.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +MIBS="SNMPv2 ENTITY IF LLDP IP IP-FORWARD" +ORIGPWD=$PWD +TMP=$(mktemp -d) +set -x +set -e +cd $TMP +wget ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz +tar xvzf v2.tar.gz --strip-components=2 +mkdir -p mibs + +for a in $MIBS; do + cp v2/$a-MIB.my mibs/ +done +mv mibs ${ORIGPWD}/ +cd ${ORIGPWD} +rm -rf ${TMP} |