Question

I am new to SNMP, thank you for bearing with me.... I have an existing Perl script for a sub-agent and the following issue came up when trying to run it: The agent seems to connect to the "default" snmpd deamon which is configured as a master agent (the line "master agentx" is present in the snmpd.conf). At this point the script assigns some values to the objects in my MIB. However, when I then perform a snmpwalk or snmpget on the master-agent, I get (for a v1 query) "End of MIB". When I perform a query on the system OID it works....something must be broken.

The MIB is registered correctly (I can do a snmptranslate) and uses the "enterprises" OID where the company this is for registered their own enterprise OID.

I have been looking around to see what the issue can be and it believe I am missing the configuration file for the sub-agent: On this site they add this comment with the sub-agent registration:

    my $agent = new NetSNMP::agent(
        # **makes the agent read a my_agent_name.conf file**
        'Name' => "my_agent_name",
        'AgentX' => 1
        );
    }

My setup (which I did not write myself but should be fully functional) does not have a file "my-agent_name.conf". I do have the correct snmpd.conf (for the master-agent) and the sub-agent seems to connect (If I remove the line "master agentx" from snmpd.conf the agent reports a connection failure).

Is the issue the missing sub-agent configuration file and if so, what should I put in there? I simply cannot find anything more on the subject and my knowledge of SNMP is too limited to figure this out using man-pages.

I am using Ubuntu/Xubuntu for testing.

Thanks

Was it helpful?

Solution

It seems there was an issue with my setup and the typical "Windows" solution did the trick: reboot. After the reboot the agent connected properly. I debugged through the use of the syslog file "/var/logs/syslog" which would fail to show AgentX notifications. Additionally, you can add debug flags on the commandline of any of the net-snmp applications "-DALL" gives you all debugging output.

It is great there is an opensource snmp like net-snmp, but man....it has a steep learning curve. Examples are mostly out of date or incomplete. The website is full of junk and incomplete articles. I had the hardest time finding a simple example of how to build a simple agent. If you are new and you happen to stumble on this post: try the "ifTable" example which helped me a lot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top