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 whether you accept or reject these cookies being set.

SNMP protocol in Logic Machine
Attached an example for a data type OCTET STRING. It is important to clarify that if you want to send a value, it must be passed from ascii to hexadecimal and separated by two points (Smile. For example, the asci 30 when passed to hexadecimal is 33:30. On the other hand, when writing the type of data to write, you can use the type of data or the number that represents it, according to the documentation of LUA SNMP ( objects.html), whichever of the two is possible.


conn, err ={
  version = snmp.SNMPv1,
  community = 'public',
  peer = '',

assert(conn, err)

if val==true then
vbIn = {
    {oid = "", type=snmp.TYPE_INTEGER, value = "1"},
    {oid = "", type=2, value = "33:30"}
vbOut, err, index = conn:set(vbIn)

vbIn = {
{oid = "", type=snmp.TYPE_INTEGER, value = "0"} 
vbOut, err, index = conn:set(vbIn)


Forum Jump: