[AGENT++] Odd AgentX problem
johnny at navtek.no
johnny at navtek.no
Wed Oct 4 23:32:07 CEST 2006
Hello all
I've just started to get my head around agent++/agentX and have started to
create my own subagent using the example provided as the basis. I'm
running net-snmp as the master.
My problem:
When I do this:
Oidx myOID("1.3.6.1.4.1.4969.1");
add(new MibLeaf(myOID, READWRITE, new SnmpInt32(23)));
# snmpwalk -v 1 -c public localhost 1.3.6.1.4.1.4969
doesn't show anything
However when I do this:
Oidx myOID("1.3.6.1.4.1.4969.2");
add(new MibLeaf(myOID, READWRITE, new SnmpInt32(23)));
# snmpwalk -v 1 -c public localhost 1.3.6.1.4.1.4969
will show:
SNMPv2-SMI::enterprises.4969.2 = INTEGER: 23
How come?
My two own files look like this:
-myagent.h-file
#include <agent_pp/mib.h>
#include <agent_pp/snmp_textual_conventions.h>
#include <agent_pp/notification_originator.h>
#include <agentx_pp/agentx_subagent.h>
#define oidPas "1.3.6.1.4.1.4969"
namespace Agentpp {
class pasSnmpAgent: public MibGroup {
public:
pasSnmpAgent(const OctetStr&, SubAgentXMib*);
virtual ~pasSnmpAgent() { }
static pasSnmpAgent* instance;
};
}
-myagent.cpp-file:
#include <agent_pp/mib.h>
#include <agent_pp/snmp_textual_conventions.h>
#include <agent_pp/notification_originator.h>
#include <agentx_pp/agentx_subagent.h>
#include <pasSnmpMIB.h>
namespace Agentpp {
pasSnmpAgent::pasSnmpAgent(const OctetStr& context, SubAgentXMib* mib):
MibGroup(oidPas, "pasMIB")
{
Oidx myOID("1.3.6.1.4.1.4969.1");
add(new MibLeaf(myOID, READWRITE, new SnmpInt32(23)));
}
}
regards
--
Johnny Ljunggren
More information about the AGENTPP
mailing list