06.05.2020, 14:46
(This post was last modified: 06.05.2020, 15:12 by spapantoniou85.)
Hello to all,
I have been working in the last period to integrate a series of UPS of APC using the snmp protocol.
The version required is v3.
I have used this site: http://luasnmp.luaforge.net/objects.html to get information for the parameters of snmp.
On security level when I am using noAuthNoPriv or authNoPriv everything is working correctly. When I use authPriv adding all the parameters correctly (cross-checked with other 3rd party software) I have problem with the communication.
The log message I got was:
This error arrives even when the parameters I have inserted are wrong. Google searching:"synch request id is 0" I have found the error on the source code but no explanation why this is happening.https://github.com/hleuwer/luasnmp/blob/.../nm_snmp.c
Has anybody else found a similar problem? How can I solve this issue?
Thank you
Sotiris
I have been working in the last period to integrate a series of UPS of APC using the snmp protocol.
The version required is v3.
I have used this site: http://luasnmp.luaforge.net/objects.html to get information for the parameters of snmp.
Code:
ups1, err = snmp.open{
version = snmp.SNMPv3,
community = "public",
port = 161,
peer = "IP address",
user = "Sotirios",
authPassphrase = "Papantoniou1",
privPassphrase = "Papantoniou2",
authType = "MD5",
privType = "AES",
timeout = 2,
securityLevel = "authNoPriv",--"noAuthNoPriv",
}
assert(ups1, err)
log(ups1)
log(err)
local OID_NAS3 = {
{'Varname',"1.3.6.1.4.1.935.1.1.1.1.1.1.0"},--NEW
}
for _, item in ipairs(OID_NAS3) do
vbind, err = ups1:get(item[2])
if vbind then
log(vbind.value)
else
log('error reading from snmp: ' .. tostring(err))
--grp.checkwrite('EL_UPS_communication_KO',true)
end
end
On security level when I am using noAuthNoPriv or authNoPriv everything is working correctly. When I use authPriv adding all the parameters correctly (cross-checked with other 3rd party software) I have problem with the communication.
The log message I got was:
Code:
error reading from snmp: snmp: internal error - synch request id is 0
This error arrives even when the parameters I have inserted are wrong. Google searching:"synch request id is 0" I have found the error on the source code but no explanation why this is happening.https://github.com/hleuwer/luasnmp/blob/.../nm_snmp.c
Has anybody else found a similar problem? How can I solve this issue?
Thank you
Sotiris