This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

snmpv3 authPriv issue
#1
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.

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
Reply
#2
Current version of SNMP library does not have encryption support. We'll try to update it for the next FW release.
Reply
#3
(07.05.2020, 07:46)admin Wrote: Current version of SNMP library does not have encryption support. We'll try to update it for the next FW release.

Hello admin,

thank you for the answer. Do you have an estimation on when the next FW release will be? 

Thank you

Sotiris
Reply
#4
Hi, i'm testing 2 identical UPS like the post above ( one with a new network card and one with old model )

After get function with old network card everything is working and the log of the variable vbind is:

* table:
["oid"]
  * string: 1.3.6.1.4.1.935.1.1.1.8.6.1.0
["type"]
  * number: 3
["value"]
  * number: 16

with the new network card and new oid the log is:

* table:
["oid"]
  * string: 1.3.6.1.4.1.318.1.1.1.9.2.2.1.4
["type"]
  * number: 129

i don't have the row value... any idea?

From PC and MibBrowser everithing is ok, the only thing is when i load the MIB file of the UPS the software ask me to load also SNMP-FRAMEWORK-MIB.mib
Reply
#5
Are you sure that OID is correct? 129 is No such instance exception.
Reply
#6
Now i try another OID, this is the result:

table:
["oid"]
  * string: 1.3.6.1.4.1.318.1.1.1.1.2.9
["type"]
  * number: 129

attached the same OID from MibBrowser

Attached Files Thumbnail(s)
   
Reply
#7
i'm working with SL 2.8.0 + libnetsnmp_5.4.4-1_imx6.ipk + luasnmp_1.0.6-2-4_imx6.ipk
Reply
#8
Try running walk on higher OID levels like "1.3.6.1.4.1.318.1.1.1.1": https://forum.logicmachine.net/showthrea...k#pid15779
Reply
#9
(31.10.2024, 10:53)admin Wrote: Try running walk on higher OID levels like "1.3.6.1.4.1.318.1.1.1.1": https://forum.logicmachine.net/showthrea...k#pid15779

ok i will try in the afternoom, it works also with SNMPv3 ?
Reply
#10
ok, from oid '1.3.6.1.4.1.318.1.1.1.1' i'm reading something:

* table:
["1.3.6.1.4.1.318.1.1.1.1.2.3.0"]
* string: 9E2234T15816
["1.3.6.1.4.1.318.1.1.1.1.2.9.0"]
* string: 10000
["1.3.6.1.4.1.318.1.1.1.1.2.1.0"]
* string: V55.006.044/V55.006.040
["1.3.6.1.4.1.318.1.1.1.1.2.5.0"]
* string: 10KH
["1.3.6.1.4.1.318.1.1.1.1.1.1.0"]
* string: Easy UPS 3S 10K
Reply
#11
This means that instead of 1.3.6.1.4.1.318.1.1.1.1.2.9 you should use 1.3.6.1.4.1.318.1.1.1.1.2.9.0 (.0 added at the end)
Reply


Forum Jump: