Hi, I'm newbie regarding SNMP topics, I've started my study about 1 week ago... Please forgive me my dummies questions!
I'd like to build a system, lets say an embedded system able to "talk" using SNMP: |--------------| |----------------------| |-----------------------------| | PC | RS-232 | UC Board | uc I/O | 2*16 Chars Display | |--------------| |----------------------| |-----------------------------| SNMP is running on the PC (linux). PC is able to talk with micro controller board using a standard RS232 interface. I want to be able to change the text to be displayed using SNMP. In order to achieve this I wrote some basic functions: (PC, using a basic text protocol) int displayWrite(int lineNr, char *buff) //lineNr -- line to update: // 0 --> First line // 1 --> Second Line //*buff -- Null terminated buffer, it contains the text to be affixed. // //Returns 0 if Ok. //Returns -1 if something is wrong. // int displayRead(int lineNr, char *buff) //lineNr -- line to read. // //*buff -- Null terminated buffer, contains text currentlly afixed. // //Returns 0 if Ok. //Returns -1 if something is wrong. // SNMP data will be placed in the micro controller board, so any snmpget should call displayRead. Any snmpset should call displayWrite. I'm able to implement this approach using scalar data using "mib2c -c mib2c.scalar.conf myNode", i used the approach pointed by: http://uuu.enseirb-matmeca.fr/~kadionik/embedded/snmp/english/net-snmp_english.html http://uuu.enseirb-matmeca.fr/~kadionik/embedded/snmp/annexe.html My troubles started with tabular data, I tried several mib2c commands: mib2c -c mib2c.iterate.conf display mib2c -c mib2c.array-user.conf display But none of them give me a interface like mib2c -c mib2c.scalar.conf does for scalar values. Can you help me? Thanks in advance, Márcio My MIB file: /**************************************************************************************/ MARCIO-MIB DEFINITIONS ::= BEGIN -- MARCIO MIB Tests -- This MIB File is for tests only IMPORTS enterprises FROM SNMPv2-SMI, MODULE-IDENTITY FROM SNMPv2-SMI MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF; -- -- A brief description and update information about this mib. -- display MODULE-IDENTITY LAST-UPDATED "2004100000Z" -- 20 Apr 2010 ORGANIZATION "MPDISPLAYS" CONTACT-INFO " Author: Marcio Correia Portugal email: [email protected] phone: " DESCRIPTION " Display MIB Control definition" ::= { enterprises 9362 } tests OBJECT IDENTIFIER ::= { display 5 } displayConfig OBJECT IDENTIFIER ::= { display 6 } -- Define the sections of the mib them selves: -- test0 OBJECT-TYPE SYNTAX Integer32 (0..1) MAX-ACCESS read-write STATUS current DESCRIPTION "Simple Integer Value" DEFVAL { 0 } ::= { tests 1 } -- test1 OBJECT-TYPE SYNTAX Integer32 (0..1) MAX-ACCESS read-write STATUS current DESCRIPTION "Simple Integer Value" DEFVAL { 0 } ::= { tests 2} -- This Node is used to group displayed messages. messageTable OBJECT-TYPE SYNTAX SEQUENCE OF MessageTableEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "This table holds the currently displayed messaged" ::= {displayConfig 1} messageTableEntry OBJECT-TYPE SYNTAX MessageTableEntry ACCESS not-accessible STATUS mandatory DESCRIPTION "parameters of the Message List Table" INDEX {messageLineID} ::= {messageTable 1} MessageTableEntry ::= SEQUENCE { messageLineID INTEGER, displayText OCTET STRING} messageLineID OBJECT-TYPE SYNTAX INTEGER (0..100) ACCESS read-write STATUS mandatory DESCRIPTION "Indicates the line number of the Message to display" ::= {messageTableEntry 1} displayText OBJECT-TYPE SYNTAX OCTET STRING (SIZE(0..100)) ACCESS read-write STATUS mandatory DESCRIPTION "The contents of the line to be displayed. If a new display request is recieved by the display (and it is valid) the previous message is to be cleared from the table and the the display display will be updated accordingly" ::= {messageTableEntry 2} END ------------------------------------------------------------------------------ _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
