public class JMXTestAgent
extends org.snmp4j.agent.BaseAgent
JMXTestAgent is a sample SNMP agent implementation of all
features (MIB implementations) provided by the SNMP4J-AgentJMX framework.
For demonstration purposes, the agent implements the JVM-MANAGEMENT-MIB as
far as this can be done without violating the SNMP standard. There are flaws
in that MIB module that violate the SNMP standard which have been implemented
in a standard conforming way.| Modifier and Type | Field and Description |
|---|---|
protected String |
address |
agent, agentState, bootCounterFile, configFileURI, defaultContext, defaultPersistenceProvider, defaultProxyForwarder, dispatcher, mpv3, notificationOriginator, server, session, snmp4jConfigMIB, snmp4jLogMIB, snmpCommunityMIB, snmpFrameworkMIB, snmpNotificationMIB, snmpProxyMIB, snmpTargetMIB, snmpv2MIB, STATE_CREATED, STATE_INIT_FINISHED, STATE_INIT_STARTED, STATE_RUNNING, STATE_STOPPED, sysDescr, sysOID, sysServices, transportMappings, usm, usmMIB, vacmMIB| Constructor and Description |
|---|
JMXTestAgent(File bootCounterFile,
File configFile)
Creates the test agent with a file to read and store the boot counter and
a file to read and store its configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB) |
protected void |
addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB) |
protected void |
addUsmUser(org.snmp4j.security.USM usm) |
protected void |
addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm) |
protected void |
initTransportMappings() |
static void |
main(String[] args) |
protected void |
registerManagedObjects() |
protected void |
registerSnmpMIBs() |
protected void |
unregisterManagedObjects() |
addShutdownHook, finishInit, getAgent, getAgentState, getBootCounterFile, getConfigFile, getContext, getDefaultContext, getDefaultProxyForwarder, getEngineBoots, getMPv3, getNotificationOriginator, getServer, getSession, getSnmp4jConfigMIB, getSnmp4jLogMIB, getSnmpCommunityMIB, getSnmpFrameworkMIB, getSnmpNotificationMIB, getSnmpProxyMIB, getSnmpTargetMIB, getSnmpv2MIB, getSysDescr, getSysOID, getSysServices, getUsm, getUsmMIB, getVacmMIB, init, initConfigMIB, initMessageDispatcher, initSnmpSession, loadConfig, run, saveConfig, sendColdStartNotification, setAgent, setBootCounterFile, setConfigFile, setDefaultContext, setDefaultProxyForwarder, setEngineBoots, setSysDescr, setSysOID, setSysServices, setupDefaultProxyForwarder, stop, unregisterSnmpMIBs, updateEngineBoots, updateSessionprotected String address
public JMXTestAgent(File bootCounterFile, File configFile) throws IOException
bootCounterFile - a file containing the boot counter in serialized form (as expected by
BaseAgent).configFile - a configuration file with serialized management information.IOException - if the boot counter or config file cannot be read properly.protected void registerManagedObjects()
registerManagedObjects in class org.snmp4j.agent.BaseAgentprotected void addNotificationTargets(org.snmp4j.agent.mo.snmp.SnmpTargetMIB targetMIB,
org.snmp4j.agent.mo.snmp.SnmpNotificationMIB notificationMIB)
addNotificationTargets in class org.snmp4j.agent.BaseAgentprotected void addViews(org.snmp4j.agent.mo.snmp.VacmMIB vacm)
addViews in class org.snmp4j.agent.BaseAgentprotected void addUsmUser(org.snmp4j.security.USM usm)
addUsmUser in class org.snmp4j.agent.BaseAgentprotected void initTransportMappings()
throws IOException
initTransportMappings in class org.snmp4j.agent.BaseAgentIOExceptionpublic static void main(String[] args)
protected void unregisterManagedObjects()
unregisterManagedObjects in class org.snmp4j.agent.BaseAgentprotected void addCommunities(org.snmp4j.agent.mo.snmp.SnmpCommunityMIB communityMIB)
addCommunities in class org.snmp4j.agent.BaseAgentprotected void registerSnmpMIBs()
registerSnmpMIBs in class org.snmp4j.agent.BaseAgentCopyright © 2014 SNMP4J.org. All Rights Reserved.