Re: Requests not passed to the handler

Mateus Interciso <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Tue, 04 Sep 2007 15:48:39 +0200, Milan_Tvarozek wrote:

> Hello all,
> 
> I am experiencing a strange problem. I have written a simple common
> handler for MOD_GET a MOD_GETNEXT.
> 
> The handler seems to work fine but certain SNMP requests are not passed
> to the handler.
> 
> Example:
> 
> snmpget -v 1 -c public localhost .1.3.6.1.2.1.1.1.1    is passed.
> 
> snmpget -v 1 -c public localhost .1.3.6.1.2.1.4.1.1    is NOT passed.
> 
> The handler is registered for 1.3.6.
> 
> It does not matter if I run the agent as main agent or subagent,
> behaviour is the same.
> 
> Would somebody give me a hint what I am doing wrong? Obviously, I am
> missing something.
> 
> Thanks for your help.
> 
> Milan
> 
> 
>     int agentx_subagent = 0;
> 
>     static oid root_oid[] =   { 1, 3, 6 };
> 
>     /* we're an agentx subagent? */
>     if (agentx_subagent) {
>         /* make us a agentx client. */
>         netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
> NETSNMP_DS_AGENT_ROLE, 1);
>     }
> 
>     /* initialize tcpip, if necessary */
>     SOCK_STARTUP;
> 
>     /* initialize the agent library */
>     init_agent("ippc_agent");
> 
>     /* ippc agent will be used to read ippc_agent.conf files. */
>     init_snmp("ippc_agent");
> 
>     /* If we're going to be a snmp master agent, initial the ports */ if
>     (!agentx_subagent) {
>         init_master_agent();  /* open the port to listen on (defaults to
> udp:161) */
>     }
> 
>     netsnmp_mib_handler *handler =
> netsnmp_create_handler("common_handler", &common_handler );
> 
>     handler_reg = netsnmp_handler_registration_create( "common_handler",
>                                                handler,
>                                                root_oid,
>                                                OID_LENGTH(root_oid),
>                                                0);
> 
>     netsnmp_register_handler(handler_reg);
> 
> 
> 
> 
> 
> 
> 
> 
> 
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Still grepping through
> log files to find problems?  Stop. Now Search log events and
> configuration files using AJAX and a browser. Download your FREE copy of
> Splunk now >>  http://get.splunk.com/
> _______________________________________________ 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

Argh, now that I've saw it, I downloaded the net-snmp from the yum 
repository (I'm using CentOS), since when I tryed to make the net-snmp, 
it gave me this error:

mibgroup/utilities/iquery.c: In function `netsnmp_iquery_session':
mibgroup/utilities/iquery.c:156: warning: passing arg 1 of `memdup' from 
incompatible pointer type
snmp_perl.c: In function `xs_init':
snmp_perl.c:20: warning: passing arg 3 of `Perl_newXS' from incompatible 
pointer type
snmp_perl.c: In function `maybe_source_perl_startup':
snmp_perl.c:50: warning: passing arg 2 of `perl_parse' from incompatible 
pointer type
agent/extend.c: In function `_extend_find_entry':
agent/extend.c:1239: warning: passing arg 2 of `snmp_set_var_value' from 
incompatible pointer type
disman/event/mteObjects.c: In function `_init_default_mteObject':
disman/event/mteObjects.c:50: warning: passing arg 2 of 
`mteObjects_addOID' discards qualifiers from pointer target type
disman/event/mteObjects.c:50: warning: passing arg 4 of 
`mteObjects_addOID' discards qualifiers from pointer target type
host/hr_device.c: In function `var_hrdevice':
host/hr_device.c:246: warning: assignment discards qualifiers from 
pointer target type
util_funcs.c: In function `restart_doit':
util_funcs.c:698: warning: `sigsetmask' is deprecated (declared at /usr/
include/signal.h:184)
if-mib/data_access/interface.c: In function `_free_interface_config':
if-mib/data_access/interface.c:756: warning: passing arg 1 of `free' 
discards qualifiers from pointer target type
snmpd.c: In function `main':
snmpd.c:944: warning: assignment discards qualifiers from pointer target 
type
if.c:52:1: warning: "__USE_XOPEN" redefined
In file included from /usr/include/stdio.h:28,
                 from ../../include/net-snmp/net-snmp-includes.h:14,
                 from if.c:44:
/usr/include/features.h:215:1: warning: this is the location of the 
previous definition
if.c:53:1: warning: "__USE_XOPEN_EXTENDED" redefined
/usr/include/features.h:217:1: warning: this is the location of the 
previous definition
snmptrapd_log.c: In function `realloc_handle_ent_fmt':
snmptrapd_log.c:876: warning: passing arg 5 of `sprint_realloc_objid' 
from incompatible pointer type
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/default_store/../../snmplib/.libs
Warning: -L../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/perl/
default_store/../../snmplib/
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/ASN/../../snmplib/.libs
Warning: -L../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/perl/
ASN/../../snmplib/
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/OID/../../snmplib/.libs
Warning: -L../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/perl/
OID/../../snmplib/
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/agent/../../snmplib/.libs
Warning: -L../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/perl/
agent/../../snmplib/
Warning: -L../../agent/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/agent/../../agent/.libs
Warning: -L../../agent/ changed to -L/root/programs/net-snmp-5.4.1/perl/
agent/../../agent/
Warning: -L../../agent/helpers/.libs changed to -L/root/programs/net-
snmp-5.4.1/perl/agent/../../agent/helpers/.libs
Warning: -L../../agent/helpers/ changed to -L/root/programs/net-
snmp-5.4.1/perl/agent/../../agent/helpers/
Warning: -L../../../snmplib/.libs changed to -L/root/programs/net-
snmp-5.4.1/perl/agent/default_store/../../../snmplib/.libs
Warning: -L../../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/
perl/agent/default_store/../../../snmplib/
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/SNMP/../../snmplib/.libs
Warning: -L../../snmplib/ changed to -L/root/programs/net-snmp-5.4.1/perl/
SNMP/../../snmplib/
Warning: -L../../apps/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/TrapReceiver/../../apps/.libs
Warning: -L../../apps changed to -L/root/programs/net-snmp-5.4.1/perl/
TrapReceiver/../../apps
Warning: -L../../agent/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/TrapReceiver/../../agent/.libs
Warning: -L../../agent changed to -L/root/programs/net-snmp-5.4.1/perl/
TrapReceiver/../../agent
Warning: -L../../agent/helpers/.libs changed to -L/root/programs/net-
snmp-5.4.1/perl/TrapReceiver/../../agent/helpers/.libs
Warning: -L../../agent/helpers changed to -L/root/programs/net-snmp-5.4.1/
perl/TrapReceiver/../../agent/helpers
Warning: -L../../snmplib/.libs changed to -L/root/programs/net-snmp-5.4.1/
perl/TrapReceiver/../../snmplib/.libs
Warning: -L../../snmplib changed to -L/root/programs/net-snmp-5.4.1/perl/
TrapReceiver/../../snmplib
In file included from TrapReceiver.xs:6:
ppport.h:227:1: warning: "PERL_UNUSED_DECL" redefined
In file included from TrapReceiver.xs:3:
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/perl.h:163:1: warning: 
this is the location of the previous definition

Is there any other way to see if ucd-snmp/disk was compiled within?

Mateus


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
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.