[email protected] wrote on 15/09/2011 13:50:36:
> On 15 September 2011 13:24, <[email protected]> wrote:
> >
> > If so, how do I know what these conditions are so that I can code up
my
> > handler accordingly?
>
> The basic question is which helpers (if any) you are using.
> Most of the mib2c templates use one of these "knowledgeable" table
> helpers, so don't need to worry about GETNEXT. The template
> code that is produced explicitly says this.
> The main exception is probably the raw table template,
> which simply handles the OID index parsing, but not much else.
>
>
> Whether you need to worry about GetNext depends on exactly how your
> module is being registered. Which is one reason why I suggested that
> you post the code.
OK. It looks like I need to know which function is called as a result of
calling the Perl wrapper function 'register' in order to understand how
the agent will behave.
Here is an extract from my perl script that creates the subagent and
registers the call-back handlers with the master agent.
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_X_SOCKET, "tcp:localhost:30000");
# create the subagent
my $agent = new NetSNMP::agent('Name' => 'my_agent_name',
'AgentX' => 1);
# register the handlers
my $root_OID = ".1.3.6.1.4.1.2257.11.1.1";
my $ssaApplication_OID = new NetSNMP::OID($root_OID . ".1");
my $ssaNetwork_OID = new NetSNMP::OID($root_OID . ".2");
my $statusCode;
$statusCode = $agent->register("my_agent_name",
$ssaApplication_OID,
\&SSAApplicationMIB::ssa_application_mib_handler);
$statusCode = $agent->register("my_agent_name",
$ssaNetwork_OID,
\&SSANetworkMIB::ssa_network_mib_handler);
my $running = 1;
while($running)
{
$agent->agent_check_and_process(1);
}
$agent->shutdown();
-----------------------------------------------
This email and any attached files contains company confidential information which may be legally privileged. it is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein. If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies. It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.
In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.