|
Howdy:
Having a problem. I need to use snmpset in lua, so I use the luasnmp module.
I just want to perform remote pings via snmpset (get snmpd to respond to DISMAN-PING-MIB
requests). However, I am having issue after issue with lua which is very frustrating. OK, by going
through a lot of aggravation searching stuff out on the web and reading code, I have a sort of
working snmp and a script that works.
My present problem is that when I perform this script to snmpset a cisco device it works well, but failed on a h3c(chinese company) device
and get one error message that say : " snmp: timeout ". But it is ok by using net-snmp snmpset with bash shell.
Has someone who can handle it for me?
Or give me any experience (or advice / where I
should look) with this ? Thanks!
Here is part of
the script:
local snmp = require "snmp"
hub1, err = snmp.open{
peer = "destinationip",
community = "private",
}
assert(hub1, err)
vbIn = {
{oid = ".1.3.6.1.4.1.9.9.16.1.1.1.16.333", type = snmp.TYPE_INTEGER, value = 6 },
-- CISCO-PING-MIB works fine on a cisco
device
--
{oid = ".1.3.6.1.2.1.80.1.2.1.23.4.116.101.115.116.1.50", type = snmp.TYPE_INTEGER, value = 4 },
-- DISMAN-PING-MIB don't work on a
h3c device
}
vbOut, err = assert(hub1:set(vbIn))
But it works
well when I enter this command in bash
shell:
snmpset -v 2c -c private destinationip .1.3.6.1.2.1.80.1.2.1.23.4.116.101.115.116.1.50 i 4
then return this "
SNMPv2-SMI::mib-2.80.1.2.1.23.4.116.101.115.116.1.50 = INTEGER: 4
"
--------------
ms2008vip
2012-10-26 |