Hi

I am new to net-snmp and trying to incorporate master snmp-agent into my 
application using application mib.( Niobe.mib)
During system powerup, I got the following messages:                    (See 
below for the snmpd.conf and snmp.conf files)
Created directory: /var/lib/snmp
Created directory: /var/lib/snmp/mib_indexes
snmpd: create_trap_session:
snmpd: create_trap_session:
/etc/snmp/snmpd.conf: line 10: Error: cannot create trapsink: public
/etc/snmp/snmpd.conf: line 10: Error: cannot create trapsink: public
net-snmp: 1 error(s) in config file(s)
net-snmp: 1 error(s) in config file(s)
Error opening specified endpoint "-"
Server Exiting with code 1
While running my application, I got different types of errors:      (See below 
for the application main())
No support for any checked transport domain
Error opening specified endpoint ""
NIOBE-MIB::interfacesMib = No Such Object available on this agent at this OID
interfacesMibi.networkInterfaceAddress.0: Unknown Object Identifier (Sub-id not 
found: (top) -> interfacesMibi)
Any idea what I have done wrong?
Thanks YYY
--------------------------------------------------------------------------------------------
In /etc/snmp/  I have two conf files: snmp.conf and snmpd.conf

Here is the contents of snmp.conf
-------------------------------------------------------------------------------
# cat snmp.conf
mibdirs /mnt/mmc/sys0/mb/usr/local/net-snmp/share/snmp/mibs
mibs ALL
showMibErrors yes
doDebugging 1
defCommunity public
defVersion 2c
#
===================================================================

Here is the contents of snmpd.conf
-------------------------------------------------------------------------------
# cat snmpd.conf
group ReadWrite v1 snmphost
group ReadWrite v2c snmphost
group ReadOnly v1 world
group ReadOnly v2c world
view all included .1 80
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.1.4.1.1166.1.624
rocommunity public
rwcommunity public
trapsink public
#
--------------------------------------------------------------------
During the device powerup, I got the following messages:
Created directory: /var/lib/snmp
Created directory: /var/lib/snmp/mib_indexes
snmpd: create_trap_session:
snmpd: create_trap_session:
/etc/snmp/snmpd.conf: line 10: Error: cannot create trapsink: public
/etc/snmp/snmpd.conf: line 10: Error: cannot create trapsink: public
net-snmp: 1 error(s) in config file(s)
net-snmp: 1 error(s) in config file(s)
Error opening specified endpoint "-"
Server Exiting with code 1

Here is the output of my application:

#
# snmp
startSnmpApp
startShell
start SNMP agent
[SNMP] -> init_system
init_statusMib
init_networkInterfaceTable
init_trapReceiverTable
init_unitAddressTable
No support for any checked transport domain
Error opening specified endpoint ""
calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget -v 1 -c public 
localhost system.sysUpTime.0
SNMPv2-MIB::sysUpTime.0 = Timeticks: (315688) 0:52:36.88

calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpwalk -v 2c -c public 
localhost interfacesMib
NIOBE-MIB::interfacesMib = No Such Object available on this agent at this OID

calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget  -v 2c -c public 
localhost interfacesMib.networkInterfaceAddress.0

interfacesMib.networkInterfaceAddress.0: Unknown Object Identifier (Sub-id not 
found: interfacesMib -> networkInterfaceAddress)
--------------------------------------------------------------------------------------------
Here is the main():

main(int argc, char **)
{
    int running = 1;

    printf("startSnmpApp\n");
    startSnmpApp();
    printf("startShell\n");
    startShell();
    printf("start SNMP agent\n");
    startSnmpAgent();

    printf("calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget -v 1 -c 
public localhost system.sysUpTime.0\n");
    system("/mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget -v 1 -c public 
localhost system.sysUpTime.0");
    printf("\n");
    // printf("calling snmpwalk\n\n");
    // system("/mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpwalk -v 2c -c public 
localhost");
    printf("calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpwalk -v 2c -c 
public localhost interfacesMib\n");
    system("/mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpwalk -v 2c -c public 
localhost interfacesMib");
    printf("\n");
    printf("calling /mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget  -v 2c -c 
public localhost interfacesMib.networkInterfaceAddress.0\n\n");
    system("/mnt/mmc/sys0/mb/usr/local/net-snmp/bin/snmpget -v 2c -c public 
localhost interfacesMib.networkInterfaceAddress.0");

    while (running) {
      agent_check_and_process(0); /* 0 == don't block */
      sleep(2);
    }

    snmp_shutdown("yourappname");
    return(0);
}
-----------------------------------------------------------------------------------------------
void startSnmpAgent()
{
    int agentx_subagent = 0;  /* for master agent.  */

    snmp_enable_stderrlog();
    // init_agent("snmp");

    /*  Initialize your MIB code here.  */
    // init_my_mib_code();
    init_system();
    init_statusMib();
    init_networkInterfaceTable();
    init_trapReceiverTable();
    init_unitAddressTable();

    /*  `yourappname' will be used to read yourappname.conf files.  */
    // init_snmp("snmp");

    /*  If we're going to be a SNMP master agent...  */
    if (!agentx_subagent) init_master_agent();  /*  Listen on default port 
(161).  */
    init_traps();
}





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to