Hi All,

 

I am using net-snmp5.4.2.  

I extended the subagent and it is running, but after some long time it gives
"No Such Object available on this agent at this OID" 

then I restarted my subagent and it throws "Warning: Failed to connect to
the agentx master agent ([NIL]):"

but when I restarted the snmpd it is working.

 

What is the problem? Please help

 

Here is my config file

Snmpd.conf

===================================

master agentx

syslocation Server Room

syscontact Sysadmin (r...@localhost)

rwcommunity public

===================================

 

Subagent.cpp

===================================

 

static int keep_running;

RETSIGTYPE stop_server(int a) {

    keep_running = 0;

}

 

int main (int argc, char **argv) {

 

    int background = 0;

    int syslog = 0;

 

    snmp_disable_log();

 

    if(syslog)

       snmp_enable_calllog();

    else

       snmp_enable_stderrlog();

 

    netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
1);

 

    if(background && netsnmp_daemonize(1, !syslog))

        exit(1);

 

    /* initialize tcpip, if necessary */

    SOCK_STARTUP;

 

    /* initialize the agent library */

    init_agent("MySubagent");

 

    /* MySubagent will be used to read MySubagent.conf files. */

    init_snmp("MySubagent ");

 

    /* mib code: MySubagent.cpp */

    init_my_subagent();

 

    /* In case we recevie a request to stop (kill -TERM or kill -INT) */

    keep_running = 1;

 

    signal(SIGTERM, stop_server);

    signal(SIGINT, stop_server);

 

    snmp_log(LOG_INFO,"EnTP-Watch is up and running.\n");

 

    while(keep_running) {

 

        agent_check_and_process(1); /* 0 == don't block */

    }

 

    /* at shutdown time */

    snmp_shutdown("MySubagent ");

    SOCK_CLEANUP;

    return 0;

}

===============================================================

 

Regards,

Prakash Raju

 

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to