04.09.2018, 09:17
(03.09.2018, 13:30)Carlos Padilla Wrote: Good morning, the following message is to tell you that I have a monitor and manage the traps of several UPS and PDU that use the SNMP protocol. I read that with the logic Machine I can do this, but I can not find information about it, if I need some packages, if everything has to be done with Script or has menus like Modbus or other protocols. In addition to the above if I can monitor and also receive the traps of them, because going in a forum here, said that you could not receive traps, but I do not know if with the new version of the lite power firmware (20180822) if can do. Thanks and any information that you can give me, it would be very useful.
Hi, as I know, traps are still not supported
You need packages luasnmp and libnetsnmp
you can download it for imx28 here https://dl.openrb.com/lm-17/pkg
for imx6 here https://dl.openrb.com/lm-17-imx6/pkg/
and here is example script
Code:
-- открытие сессии с snmp
require "snmp"
-- загрузка миб-файла для ибп
local mib, err = snmp.mib.load('/home/ftp/snmp/GESINGLEUPS.mib')
if not mib then
log('Failed to load mib: ' .. err)
end
-- подклчюение к ибп
ups1, err = snmp.open{
version = snmp.SNMPv1,
community = "public",
port = 161,
peer = "10.100.3.21",
}
assert(ups1, err)
-- читаем температуру
vbind, err = ups1:get("upsBatteryTemperaturegen")
grp.write('1/1/7', vbind.value)
-- читаем нагрузку в % по фазам на выходе
vbind, err = ups1:get("upsOutputPercentLoadgen.1")
grp.write('1/1/8', vbind.value)
vbind, err = ups1:get("upsOutputPercentLoadgen.2")
grp.write('1/1/9', vbind.value)
vbind, err = ups1:get("upsOutputPercentLoadgen.3")
grp.write('1/1/10', vbind.value)