net-snmp not reading UDP messages

"Borthakur, Bhaskar" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi 

 

I am new to the SNMP world. I am trying to write a stand alone agent
which services snmpget requests from a client. After initializing the
net-snmp, I am able to send traps but I am not able to receive any
snmpget/walk request. 

 

I see that when I do an snmpget, the udp queue size increases on the
socket where I start my stand-lone agent but the call back I am supposed
to receiver never comes from the net-snmp libraries. 

 

I am using ner-snmp-5.1.2 rpm on a redhat linux AS 4 machine. 

 

Please help.

 

Here is  how I have written code for my own agent

  /**

   * Constructor

   */

  Snmp::Snmp(const string& confFile)

  {

    string agentName = "MyAPP";

 

    // Logs error output from the SNMP agent to the standard error
stream. 

    snmp_enable_stderrlog();

 

    // read the configuration file for the agent, like trap sink etc

    netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,

                                      NETSNMP_DS_LIB_OPTIONALCONFIG,
confFile.data());

    

    // Dont read the snmp.conf file from the default locations

    netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,

                                       NETSNMP_DS_LIB_DONT_READ_CONFIGS,
1);

    

    

    // Initialize the agent library 

    if (init_agent(agentName.c_str()))

    {

      cout << "Failed to initialize the Agent with the toolkit" << endl;

      exit(0);

    }

    

    // Register Master Agent specific token handlers 

    init_vacm_vars();

    

    // initialize snmp,  init_agent must be called before this

    init_snmp(agentName.c_str());

    

    // Initialize the agent as master

    if (init_master_agent() != 0)

    {

      exit(0);

    }

    

    // register the table of interest

    init_system();

 

  }

-------------------------------------------------------------------------
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.