I currently have an agent built using snmp4j that implements some custom mibs. What Im looking to do is run this snmp4j agent under windows as an snmp extension agent to the windows snmp service. The reason is I need this new snmp4j agent to handle snmp requests for info from my custom mibs and the windows snmp service to handle requests for mib2 info. If anyone has any experience with windows snmp extension agents and snmp4j and can give me some tips on how to achieve this, or if it is even possible to do with snmp4j, i would very much appreciate it. thanks
Asked
Active
Viewed 386 times
1 Answers
1
Microsoft has designed SNMP agent as a service. This service does all the dirty work on protocol level (ASN.1/BER encoding and decoding). In order to develop the extension agent we have to implement an extension agent DLL on top of Windows SNMP service.
In order to create an extension agent you need to create a Win32 DLL and within this DLL you need to define, implement and export the following functions:
BOOL SNMP_FUNC_TYPE SnmpExtensionInit(DWORD dwUptimeReference,
HANDLE *phSubagentTrapEvent,
AsnObjectIdentifier *pFirstSupportedRegion)
BOOL SNMP_FUNC_TYPE SnmpExtensionQuery(BYTE bPduType,
SnmpVarBindList *pVarBindList,
AsnInteger32 *pErrorStatus,
AsnInteger32 *pErrorIndex)
// trap handler
BOOL SNMP_FUNC_TYPE SnmpExtensionTrap(AsnObjectIdentifier *pEnterpriseOid,
AsnInteger32 *pGenericTrapId,
AsnInteger32 *pSpecificTrapId,
AsnTimeticks *pTimeStamp,
SnmpVarBindList *pVarBindList)
Unfortunately, there is no way you can implement MS SNMP Agent Extension using SNMP4J library.

Andrew Komiagin
- 6,446
- 1
- 13
- 23