johnyhv / arduino-snmp Goto Github PK
View Code? Open in Web Editor NEWAgentuino - Arduino SNMP Get, Set, Response, Trap
Agentuino - Arduino SNMP Get, Set, Response, Trap
Usage code https://code.google.com/p/agentuino/ Implemented SNMP trap functions from Enmyerp http://forum.arduino.cc/index.php?topic=50848.60 @EDIT M. Pivovarsky <[email protected]> Extended version - with memory library Simple version - without memory library -------------------------------------------------------------------------------------------------------------------------------------------------------------------- SNMP v1 PDU Types GET-Request SET-Request Response Trap Syntax Types Null Boolean Bits (WIP) Octet-String Object-Identifier (WIP) Integer and Integer32 Counter and Counter64 Gauge Time-Ticks IP-Address Opaque Network-Service-Access-Point (NSAP) Address Limitations Agentuino's limitation is dependent on the amount of SRAM available. Maximum Community Names (Get/Set) Length: 20 bytes Maximum Object-Identifier Length: 64 bytes Maximum Value Length: 64 bytes Maximum Packet Length: 153 bytes -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Net-Snmp Get-Request snmpget -v 1 -r 1 -c public 192.168.2.64 sysUpTime.0 Net-Snmp Set snmpset -v 1 -r 1 -c private 192.168.2.64 sysName.0 s NewName snmpget -v 1 -r 1 -c public 192.168.2.64 sysName.0
Hi there,
Can someone tell me how can I easily pool Values from other devices with Arduino, I have the host, community and the OID too.
Thank you! ;)
Arudino CPU is slow
too much ineffective code
snmptrap fucntion
strlen(Message) to a const var
Hello sir...
I am working on a small project and when I set the IP as DHCP by using only this-ethernet.begin(mac);,
Then I am getting the Traps over the other network also(having different gateway!
But once I set the device on Static IP with the default gateway and Subnet mask then I am getting trap over the the same gateway ips i.e. same IP pool but not on other network!
please help me as I am not having much networking knowledge.
It has worng asn header with length > 128
asn length field may be 2, 3 or 4 bytes. It needs to be adaptive.
Type_and_leng[1] = sizeof (Version) / sizeof (Version[0]) + sizeof (Comunity_string) / sizeof (Comunity_string[0])
^^^^^^^^^^^
+ sizeof (PDU_type_and_leng) / sizeof (PDU_type_and_leng[0]) + sizeof (OID) / sizeof (OID[0])
+ sizeof (IP_definition) / sizeof (IP_definition[0]) + sizeof (my_IP_address) / sizeof (my_IP_address[0])
+ sizeof (Type_Trap) / sizeof ( Type_Trap[0]) + sizeof (extra_OID) / sizeof ( extra_OID[0])
+ sizeof (Type_time_stick) / sizeof ( Type_time_stick[0]) + sizeof (hexadecimalNumber) / sizeof ( hexadecimalNumber[0])
+ sizeof (Var_Bind) / sizeof ( Var_Bind[0]) + sizeof (Var_Bind1) / sizeof ( Var_Bind1[0])
+ sizeof (OID1) / sizeof ( OID1[0]) + sizeof (Value1) / sizeof (Value1[0]) + strlen(Message);
^^^^^^^^^^^^^^^^^^^^^
Message also requires adjustment.
This library is useful for small message but not for complex environment.
from net-snmp code
if (length < 0x80) {
if (*datalength < 1) {
snprintf(ebuf, sizeof(ebuf),
"%s: bad length < 1 :%lu, %lu", errpre,
(unsigned long)*datalength, (unsigned long)length);
ebuf[ sizeof(ebuf)-1 ] = 0;
ERROR_MSG(ebuf);
return NULL;
}
*data++ = (u_char) length;
} else if (length <= 0xFF) {
if (*datalength < 2) {
snprintf(ebuf, sizeof(ebuf),
"%s: bad length < 2 :%lu, %lu", errpre,
(unsigned long)*datalength, (unsigned long)length);
ebuf[ sizeof(ebuf)-1 ] = 0;
ERROR_MSG(ebuf);
return NULL;
}
*data++ = (u_char) (0x01 | ASN_LONG_LEN);
data++ = (u_char) length;
} else { / 0xFF < length <= 0xFFFF */
if (*datalength < 3) {
snprintf(ebuf, sizeof(ebuf),
"%s: bad length < 3 :%lu, %lu", errpre,
(unsigned long)*datalength, (unsigned long)length);
ebuf[ sizeof(ebuf)-1 ] = 0;
ERROR_MSG(ebuf);
return NULL;
}
*data++ = (u_char) (0x02 | ASN_LONG_LEN);
*data++ = (u_char) ((length >> 8) & 0xFF);
*data++ = (u_char) (length & 0xFF);
}
I'm using the Agent.ino already provided by the library and it doesn't work. It doesn't send any trap. It spams "Send Trap" but the trap wasn't sent.
Hi, i get:
Error: 13 INTERNAL: Library install failed: moving extracted archive to destination dir: library not valid
When trying to install this as zip file on IDE 2.0.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.