com.palantir.opensource.sysmon.linux
Class LinuxEntropyLevelJMXWrapper

java.lang.Object
  extended by java.lang.Thread
      extended by com.palantir.opensource.sysmon.linux.LinuxEntropyLevelJMXWrapper
All Implemented Interfaces:
Monitor, Runnable

public class LinuxEntropyLevelJMXWrapper
extends Thread
implements Monitor

Monitors entropy pools that feed secure random number generation.

Entropy pool size is reported in bytes and is read out of the /proc filesystem on a configurable period.

JMX Data Path

sysmon.linux.beanpath:type=EntropyLevel

Configuration parameters

Note that any value not set in the config file will use the default value.
Config KeyDescriptionDefault ValueConstant
sysmon.linux.entropyLevel.period Period, in seconds, between checks of the entropy pool 10 CONFIG_KEY_ENTROPY_LEVEL_PERIOD

See Also:
Lifecycle documentation, the random(4) man page for more information on entropy pools

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String CONFIG_KEY_ENTROPY_LEVEL_PERIOD
          Set this value in the configuration file to set how often (in seconds) the entropy levels are checked.
static int DEFAULT_ENTROPY_LEVEL_PERIOD
          Default value for how often (in seconds) the entropy levels are checked.
static String OBJECT_NAME
          Path where this bean publishes its values.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LinuxEntropyLevelJMXWrapper(Properties config)
          Constructs a new LinuxEntropyLevel object.
 
Method Summary
 void run()
           
 void startMonitoring()
          Start background thread to monitor entropy levels.
 void stopMonitoring()
          Signals for the background thread to shutdown and waits for its execution to finish.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_KEY_ENTROPY_LEVEL_PERIOD

public static final String CONFIG_KEY_ENTROPY_LEVEL_PERIOD
Set this value in the configuration file to set how often (in seconds) the entropy levels are checked. Key: "sysmon.linux.entropyLevel.period"

See Also:
for default value for the configuration parameter., Constant Field Values

DEFAULT_ENTROPY_LEVEL_PERIOD

public static final int DEFAULT_ENTROPY_LEVEL_PERIOD
Default value for how often (in seconds) the entropy levels are checked. Default: 10

See Also:
for instructions on overriding the default value., Constant Field Values

OBJECT_NAME

public static final String OBJECT_NAME
Path where this bean publishes its values. Path: ":type=EntropyLevel"

See Also:
Constant Field Values
Constructor Detail

LinuxEntropyLevelJMXWrapper

public LinuxEntropyLevelJMXWrapper(Properties config)
                            throws LinuxMonitoringException
Constructs a new LinuxEntropyLevel object. You must call startMonitoring() to start the background thread that will continually update the entropy pool values. Note that the constructor will do a single read of the entropy to verify that everything will work in the background thread. Therefore, constructing one of these object is a valid way to take a one-time reading of the entropy pool size.

Parameters:
config - configuration for this JMX wrapper. Passing null or an empty Properties object will just use the default config values.
Throws:
LinuxMonitoringException - on configuration or data read error.
Method Detail

startMonitoring

public void startMonitoring()
Start background thread to monitor entropy levels.

Specified by:
startMonitoring in interface Monitor
Throws:
LinuxMonitoringException

stopMonitoring

public void stopMonitoring()
                    throws InterruptedException
Signals for the background thread to shutdown and waits for its execution to finish.

Specified by:
stopMonitoring in interface Monitor
Throws:
InterruptedException - if the calling thread is interrupted while waiting for the background thread to Thread.join().

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2012 Palantir Technologies. All Rights Reserved.