Net-SNMP master/client/subagent question

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
jmnielsen
Posts: 9
Joined: Mon Mar 19, 2012 3:09 pm

Net-SNMP master/client/subagent question

Post by jmnielsen »

Hello,

I am new to utilizing net-snmp in general and I am trying to understand some basic concepts so that I can graph new metrics in Cacti. After reading lots of Net-SNMP documentation I am still confused as how the model of setting up one net-snmp instance on a server and installing your monitoring applications on it (like Cacti or Nagios) differs or relates to having to install net-snmp on other servers (all Linux in my environment) to act as "clients" to be monitored. Basically what distinguishes the master from the client in configuration?

If you install net-snmp on Server A (say it is Red Hat) and set up a basic community string (lets say with full access to the tree) and I also install the same thing on Server B (Red Hat also) with the same configuration they can now respond to one another about metrics of each servers' local Linux settings exposed in the OIDs (from the default/packaged MIBs that come with net-snmp), as I understand it. As such I could install Cacti on either to act as the "master" net-snmp server although in configuration they are peers.

Though I was calling one the "master" that concept does not come into play until you use some kind of master/slave (subagent) protocol like AgentX though, it would seem. If I understand correctly, setting Server A (if it is the one that hosts Cacti) with the configuration "master agentx" in snmpd.conf will make it a master to respond to all subagent traffic (from other machines) directed to it. Can a net-snmp instance on a client be modified to play the subagent role (by adding configuration to Server B's snmpd.conf file) or is the concept of a subagent that it is a stand-alone program (possibly custom or vendor written) outside the scope of net-snmp that implements the net-snmp AgentX API? If so it would have to point (in the subagent implementation) to your AgentX master (which is, infact, implemented within net-snmp itself)? I find that concept confusing if that is the case, why both could not be utilized by the basic out-of-the-package net-snmp. "Why is there not a 'subagent agentx' configuration directive?" is one way of asking it.

My other question is how net-snmp can query any snmp information at all (such as you can do manually with snmpwalk) without having a subagent for anything (such as a Red Hat subagent or Windows subagent)? In Windows you just turn on the SNMP "Windows service", give it the community string, and it just "works". Is that technically a "subagent", or do you only need a subagent for OIDs that don't come defined in the default MIB files packaged with net-snmp? The same can be asked for Red Hat: unless there is a Linux subagent running somewhere by default how can you "out of the box" query basic Linux OIDs? This basically ties into my question of what a subagent really does.

I hope this inquiry makes sense. Any pointers about this would be helpful.

Thanks!
jmnielsen
Posts: 9
Joined: Mon Mar 19, 2012 3:09 pm

Re: Net-SNMP master/client/subagent question

Post by jmnielsen »

Okay, so I think I just realized something that should have been obvious to begin with and that is that the Cacti install does not need the net-snmp snmpd daemon (or any snmp agent/daemon) to be on the host machine that it is on. Cacti has some dependencies on net-snmp but only needs the tools packaged with net-snmp to work and not the snmpd daemon. You only would need snmpd running on the same host machine as Cacti if you were going to also monitor that machine as a client. Cacti's source code simply submits snmp requests using tools like snmpget and snmpwalk and expects something to respond to or catch that request such as an agent (like snmpd), on what ever machine you are monitoring.
Last edited by jmnielsen on Fri Jul 06, 2012 2:33 pm, edited 1 time in total.
jmnielsen
Posts: 9
Joined: Mon Mar 19, 2012 3:09 pm

Re: Net-SNMP master/client/subagent question

Post by jmnielsen »

A lot of my net-snmp questions were answered in this detailed FAQ: http://www.net-snmp.org/FAQ.html. I just had to read it thoroughly and separate the concept of the client tools from the agent daemon (and also realize that MIB files aren't necessary - as it talks about) and then it started making sense.

My Cacti specific questions were answered here: http://forums.cacti.net/viewtopic.php?f=2&t=47653.

I hope that helps someone else for reference as well.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest