09.04.2019, 18:29
Hi,
I have a problem with snmp conection.
I have this script:
When I play resident script (5s) it work fine, but later, i get the following error:
Resident script:18: netsnmp: Unknown host (192.168.2.201)
stack traceback:
[C]: in function 'assert'
Can you help me?
Thanks
I have a problem with snmp conection.
I have this script:
Code:
require "snmp"
ups1, err = snmp.open{
version = snmp.SNMPv2,
community = "public",
port = 161,
peer = "192.168.2.201",
}
assert(ups1, err)
vbind, err = ups1:get(".1.3.6.1.4.1.24681.1.2.1.0") --Uso de la CP
grp.update('38/2/1', vbind.value)
vbind, err = ups1:get(".1.3.6.1.4.1.24681.1.2.2.0") --Memoria total del sistema
grp.update('38/2/2', vbind.value)
vbind, err = ups1:get(".1.3.6.1.4.1.24681.1.2.3.0") --Memoria libre
grp.update('38/2/3', vbind.value)
vbind, err = ups1:get(".1.3.6.1.4.1.24681.1.2.4.0") --Tiempo en linea
grp.update('38/2/4', vbind.value)
ups1.close()
When I play resident script (5s) it work fine, but later, i get the following error:
Resident script:18: netsnmp: Unknown host (192.168.2.201)
stack traceback:
[C]: in function 'assert'
Can you help me?
Thanks