LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-24-2017, 03:56 PM   #1
zvivered
Member
 
Registered: Sep 2007
Posts: 172

Rep: Reputation: 23
Developing SNMP agent


Hello,

I have to develop an SNMP agent for an Ethernet switch.

It seems modifying net-snmp is not a trivial task.

I failed to get any help in the user mail list of net-snmp.

Is there a good alternative for net-snmp ?

If not, can you tell where can I get support ?

I'm not using any distro. I'm running vanilla 3.18.4 from kernel.org + busybox 1.25.1

The hardware is an Intel's switch: FM10000 managed by an ATOM SBC via PCIe.

I want to manage\monitor with switch with SNMP agent.

Using mib2c I tried to create ifTable folder from scratch. Is this the right way ?

The problem: I do not want to use sub agent but to erase the original code in mibgroup/ifTable and use the code created with:

mib2c -c mib2c.mfd.conf ifTable

This code is using an array called: oid ifSpecific

I do not know how to set this array and what is its role.

Thank you,
Z.V

Last edited by zvivered; 03-25-2017 at 10:27 PM.
 
Old 03-24-2017, 05:08 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,327

Rep: Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471Reputation: 4471
Quote:
Originally Posted by zvivered View Post
Hello,
I have to develop an SNMP agent for an Ethernet switch. It seems modifying net-snmp is not a trivial task.
No, it isn't
Quote:
I failed to get any help in the user mail list of net-snmp. Is there a good alternative for net-snmp ? If not, can you tell where can I get support ?
Since you tell us absolutely NOTHING about the version/distro of Linux, what you've done/tried, problem(s) you're having, hardware, etc., how can we possibly give you an answer?? You've been here ten years now...you should be well familiar with the LQ Rules and Question Guidelines.

Provide details, tell us what your actual GOAL(s) are, what you've done, questions you've asked, etc., and we can try to help. But what you've posted is impossible to answer.
 
Old 03-28-2017, 08:00 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,980
Blog Entries: 12

Rep: Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044
Hi zvivered,

Sorry but your question is very disorganized.

Have you visited the Net-SNMP page and also tried their downloads page where they have their source? There's also a documentation section.

SNMP is very old, there are at least three versions, v1, v2, and v3. There is tons of documentation on the web about the protocol. You can either find source to start with, or get the specification and write your own code from scratch.

While this is not trivial, you seemed to have understood this when you started your question.

What concerns me about your question is that you ask how to get support and there is support here, you ask if there are alternatives to the package Net-SNMP, you then have experimented with some utilities and you're next asking about structures and arrays common to the SNMP protocol as if you have no understanding about how it works.

Therefore I suggest you familiarize yourself with what SNMP is, what a MIB is and a MIB table, as well as OIDs, and understand how to manage a device using SNMP.

You ask if there are alternatives. I don't know if you mean to ask if there are device and network management alternatives to using SNMP or if there are alternatives to the product Net-SNMP, therefore you need to clarify that question.

When you cite that you have failed to get help from their mailing list, I suspect it is for similar reasons, where you have a number of questions which are related to the topic, but not well organized.

Please take the time to review the protocol specifications in more detail and review the source code to help yourself organize your questions more clearly.
 
Old 03-29-2017, 01:50 PM   #4
zvivered
Member
 
Registered: Sep 2007
Posts: 172

Original Poster
Rep: Reputation: 23
Hi rtmistler,

I want to write an SNMP agent from scratch (not to modify snmpd, which is very hard), can I use the library supplied with NET-SNMP ?

How ? Is there a sample source code ?

The sample code I found concerns only to the client side.

In my opinion, the documentation of how to do what I want is inefficient.

Thank you,
Z.V
 
Old 03-29-2017, 02:02 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,980
Blog Entries: 12

Rep: Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044Reputation: 2044
There's plenty of documentation about snmpv1/2/3 out there, and therefore you can create an agent project by designing it and writing the code. I'd suggest you search the web for snmp agent code, however it sounds as if you already have. I do agree that it is a large task, and therefore not one I would undertake without giving it some study and serious consideration. The way I would proceed is to derive a functional spec for the snmp agent, and then proceed with more detailed design for a software architecture, confirm it would satisfy the functional requirements, verify that I had not missed any requirements, and then begin implementing and testing it. I'd probably break the effort down into functional blocks to test and verify each step so that I could be efficient as well as incremental in how I constructed the architecture.

That's about the best suggestions I can offer towards your project.
 
Old 03-29-2017, 05:03 PM   #6
zvivered
Member
 
Registered: Sep 2007
Posts: 172

Original Poster
Rep: Reputation: 23
Hi rtmistler,

Attached the file ifTable_data_access.c created with:
mib2c -c mib2c.mfd.conf ifTable

Line 490
rowreq_ctx->data.ifSpecific_len =
ifSpecific_len * sizeof(ifSpecific[0]);
memcpy(rowreq_ctx->data.ifSpecific, ifSpecific,
ifSpecific_len * sizeof(ifSpecific[0]));

The variables ifSpecific_len, ifSpecific are not declared.
What do those variables mean ?

According to the IF-MIB.txt definition:
Code:
ifSpecific OBJECT-TYPE
              SYNTAX  OBJECT IDENTIFIER
              ACCESS  read-only
              STATUS  mandatory
              DESCRIPTION
                      "A reference to MIB definitions specific to the
                      particular media being used to realize the
                      interface.  For example, if the interface is
                      realized by an ethernet, then the value of this
                      object refers to a document defining objects
                      specific to ethernet.  If this information is not
                      present, its value should be set to the OBJECT
                      IDENTIFIER { 0 0 }, which is a syntatically valid
                      object identifier, and any conformant
                      implementation of ASN.1 and BER must be able to
                      generate and recognize this value."
              ::= { ifEntry 22 }
Same question for ifOutQLen.

Code:
ifOutQLen OBJECT-TYPE
    SYNTAX      Gauge32
    MAX-ACCESS  read-only
    STATUS      deprecated
    DESCRIPTION
            "The length of the output packet queue (in packets)."
    ::= { ifEntry 21 }
Thank you,
Z.V
Attached Files
File Type: txt ifTable_data_access.c.txt (22.5 KB, 6 views)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SNMP Agent and MIBs Joaquin Linux - Networking 1 03-09-2013 09:14 AM
How to associate SNMP OID with specific parameter under SNMP agent? m4rtin Linux - Server 1 09-16-2011 10:04 AM
snmp agent netcrunch Nielsrohrig Linux - Networking 0 07-28-2009 03:16 AM
SNMP v3 Agent For Linux LinuxGeek Linux - Networking 1 06-18-2006 03:58 PM
snmp agent trap sending bluejob Programming 0 02-15-2005 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 12:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration