public class Trapd extends AbstractServiceDaemon
The Trapd listens for SNMP traps on the standard port(162). Creates a SnmpTrapSession and implements the SnmpTrapHandler to get callbacks when traps are received.
The received traps are converted into XML and sent to eventd.
Note: Trapd is a PausableFiber so as to receive control events. However, a 'pause' on Trapd has no impact on the receiving and processing of traps.
Modifier and Type | Field and Description |
---|---|
static String |
LOG4J_CATEGORY |
PAUSE_PENDING, PAUSED, RESUME_PENDING
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
Constructor and Description |
---|
Trapd()
Constructs a new Trapd object that receives and forwards trap messages
via JSDT.
|
Modifier and Type | Method and Description |
---|---|
static String |
getLoggingCategory() |
int |
getStatus()
Returns the current status of the service.
|
void |
handleReloadEvent(IEvent e) |
protected void |
onInit()
onInit
|
protected void |
onPause()
Pauses Trapd
|
protected void |
onResume()
Resumes Trapd
|
protected void |
onStart()
Create the SNMP trap session and create the communication channel
to communicate with eventd.
|
protected void |
onStop()
Stops the currently running service.
|
afterPropertiesSet, destroy, getName, getStatusText, init, isPaused, isRunning, isStarting, pause, resume, setStatus, start, status, stop, waitForStatus, waitForStatus
public static final String LOG4J_CATEGORY
public Trapd()
Constructs a new Trapd object that receives and forwards trap messages via JSDT. The session is initialized with the default client name of OpenNMS.trapd. The trap session is started on the default port, as defined by the SNMP library.
SnmpTrapSession
protected void onInit()
onInit
onInit
in class AbstractServiceDaemon
protected void onStart()
onStart
in class AbstractServiceDaemon
UndeclaredThrowableException
- if an unexpected database, or IO exception occurs.SnmpTrapSession
,
SnmpTrapHandler
protected void onPause()
onPause
in class AbstractServiceDaemon
protected void onResume()
onResume
in class AbstractServiceDaemon
protected void onStop()
onStop
in class AbstractServiceDaemon
public int getStatus()
getStatus
in interface Fiber
getStatus
in class AbstractServiceDaemon
public void handleReloadEvent(IEvent e)
public static String getLoggingCategory()
Copyright © 2021. All rights reserved.