[AGENT++] Hi, I met a problem when add LLDP-MIB
cheng wan
wancheng82 at gmail.com
Tue Mar 16 11:14:06 CET 2010
I had integrated some MIB modules with agent++.
I had already add RFC1213-MIB, IF-MIB, BRIDGE-MIB,and it worked OK.
The steps were just like the examples in agent++.
1) In function "void init", I added the new MIB modules.
void init(Mib& mib)
{
......
......
mib.add(new rfc1213_mib());
mib.add(new if_mib());
.......
......
mib.add(new lldp_mib());
......
}
2) Took ifNumber in RFC1213 for example.
I added printf("HERE") to ifNumber::get_request, and it could
print out "HERE" when I used snmpget tools.
Also I could get the value.
rwan at pica8:~/snmpagent/agentgen.pro/pica8mibs$ snmpwalk -c public
-v 2c localhost 1.3.6.1.2.1.2.1
IF-MIB::ifNumber.0 = INTEGER: 30
void ifNumber::get_request(Request* req, int ind)
{
//--AgentGen BEGIN=ifNumber::get_request
//--AgentGen END
MibLeaf::get_request(req, ind);
printf("HERE"):
}
3) But lldpMessageTxInterval in LLDP-MIB could not print out "THERE"
when I used snmpget tools to get this value.
Also I could not get the value.
rwan at pica8:~/snmpagent/agentgen.pro/pica8mibs$ snmpwalk -c public
-v 2c localhost 1.0.8802.1.1.2.1.1.1.0
iso.0.8802.1.1.2.1.1.1.0 = No Such Object available on this agent
at this OID
void lldpMessageTxInterval::get_request(Request* req, int ind)
{
//--AgentGen BEGIN=lldpMessageTxInterval::get_request
//--AgentGen END
MibLeaf::get_request(req, ind);
printf("THERE"):
}
The only difference is that LLDP-MIB''s OID is not as other MIBS, it
starts from iso(1).std(0).iso8802(8802).ieee802dot1(1).ieee802dot1mibs(1).lldpMIB(2).
I did not know how to add these kind MIBS.
Attachemnt are the MIB files, and stub code generated by agenpro.
Thank you.
Robin
More information about the AGENTPP
mailing list