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.

SNMP protocol in Logic Machine
#12
(11.09.2018, 16:19)Carlos Padilla Wrote: Okay. Thank you for your cooperation. Effectively change the final name of the route to the one of the OID and it is working for me, in the group addresses the requested OIDs are being written. It is important to clarify that despite the fact that the file is loading, I still get the message:

SNMP Mikrotik 11.09.2018 10:06:57
* string: Failed to load mib: mib: can not add mib

The only way that this message does not appear is to put in comments the part of the code that requests the file loaded by ftp. Based on the above, would the SNMP communication serve me without having to load the MIB file?, Only loading the 2 necessary libraries and making the script so that the information that the OIDs have is written in the group addresses. On the other hand, I currently have 40 OID per ups and are in total 4 ups that I must monitor the variables, to avoid problems, I can place the first Script to make requests every 2 seconds, the second script every 3 seconds, the third script at 5 and 7 respectively to avoid communication problems or I can place all the scripts to run every 2 seconds and I would not have problems with the communication and acquisition of the information.

I attach the code that works for me at the moment:

Code:
--Abrir una sesión con snmp
require "snmp"

--local mib, err = snmp.mib.load('/home/ftp/snmp/Mikrotik.mib')
--if not mib then
  --log('Failed to load mib: ' .. err)
--end


ups1, err = snmp.open{
 version = snmp.SNMPv1,
 community = "ZennioCo",
 port = 161,
 peer = "192.168.0.192",
}
assert(ups1, err)

--Lee los OID del Mib
vbind, err = ups1:get("1.3.6.1.4.1.14988.1.1.3.8.0")
grp.write('8/0/0', vbind.value)
vbind, err = ups1:get("1.3.6.1.4.1.14988.1.1.3.10.0")
grp.write('8/0/1', vbind.value)
vbind, err = ups1:get("1.3.6.1.4.1.14988.1.1.1.3.1.9.16.0")
grp.write('8/0/2', vbind.value)

On the other hand, admin, if I want to implement the traps, you have information or the form of how to do it, what to do, some example or a base to start. For these UPS, it is not necessary the traps but in other devices if they are and I would like to have a complete solution with the logic machine. Thank you and I will be attentive to your comments.

Ready, I respond to one of the previous questions, it is only necessary that the 2 packages are downloaded and installed, the resident script is set to run and the ip and the community are well configured, the communication will work. I even try changing from v1 to v2 of SNMP and it works for me without any problem. My doubt in the code is that if I want to write in an OID, some teams ask for a community of reading and writing, it is necessary to configure the same name for both communities in the team or in the script I can indicate the writing community, What name does the variable receive ?. On the other hand if I want to make the communication using SNMP Version 3, it is necessary to use a user name, an authentication code, a privacy code and the protocol of these (MD5, SHA, DES, AES). Where and with what name do I specify the above in the resident code?

Thank you for your cooperation.
Reply


Messages In This Thread
RE: SNMP protocol in Logic Machine - by AEK - 04.09.2018, 09:17
RE: SNMP protocol in Logic Machine - by AEK - 06.09.2018, 06:59
RE: SNMP protocol in Logic Machine - by admin - 06.09.2018, 07:57
RE: SNMP protocol in Logic Machine - by admin - 07.09.2018, 07:00
RE: SNMP protocol in Logic Machine - by admin - 11.09.2018, 06:41
RE: SNMP protocol in Logic Machine - by AEK - 11.09.2018, 09:26
RE: SNMP protocol in Logic Machine - by Carlos Padilla - 11.09.2018, 20:39
RE: SNMP protocol in Logic Machine - by admin - 12.09.2018, 05:58
RE: SNMP protocol in Logic Machine - by admin - 15.10.2018, 18:10
RE: SNMP protocol in Logic Machine - by admin - 16.10.2018, 10:30
RE: SNMP protocol in Logic Machine - by admin - 16.10.2018, 17:50
RE: SNMP protocol in Logic Machine - by admin - 11.04.2019, 09:52
RE: SNMP protocol in Logic Machine - by admin - 17.06.2019, 07:34
RE: SNMP protocol in Logic Machine - by admin - 17.06.2019, 08:34
RE: SNMP protocol in Logic Machine - by admin - 18.06.2019, 08:05
RE: SNMP protocol in Logic Machine - by admin - 11.07.2019, 08:48
RE: SNMP protocol in Logic Machine - by admin - 12.07.2019, 06:15
RE: SNMP protocol in Logic Machine - by admin - 04.11.2019, 12:12
RE: SNMP protocol in Logic Machine - by admin - 21.02.2020, 08:22
RE: SNMP protocol in Logic Machine - by admin - 06.03.2020, 12:26
RE: SNMP protocol in Logic Machine - by admin - 06.03.2020, 18:47
RE: SNMP protocol in Logic Machine - by admin - 07.03.2020, 13:20
RE: SNMP protocol in Logic Machine - by admin - 09.03.2020, 09:21
RE: SNMP protocol in Logic Machine - by admin - 28.03.2020, 15:06
RE: SNMP protocol in Logic Machine - by admin - 12.04.2020, 12:12
RE: SNMP protocol in Logic Machine - by admin - 15.04.2020, 06:08
RE: SNMP protocol in Logic Machine - by admin - 09.12.2020, 07:07
RE: SNMP protocol in Logic Machine - by admin - 11.03.2021, 13:15
RE: SNMP protocol in Logic Machine - by admin - 11.03.2021, 13:34
RE: SNMP protocol in Logic Machine - by admin - 11.03.2021, 14:22
RE: SNMP protocol in Logic Machine - by admin - 19.09.2022, 13:00

Forum Jump: