|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.palantir.opensource.sysmon.linux.LinuxDiskspaceJMXWrapper
public class LinuxDiskspaceJMXWrapper
Monitors disk space on a Linux system. Requires the df utility (part of the coreutils package on Redhat based systems.
Reads the output from 'df -P -B M' that looks like this:
Filesystem 1048576-blocks Used Available Capacity Mounted on /dev/md0 19689M 5275M 13414M 29% / none 4021M 0M 4021M 0% /dev/shm /dev/md1 51376M 48506M 262M 100% /u1It then looks up the filesystem type by reading /proc/self/mounts (for maximum portability).
sysmon.linux.beanpath:type=filesystem,devicename=<devicename>
Config Key | Description | Default Value | Constant |
---|---|---|---|
sysmon.linux.df.df.path | path to df binary |
df |
CONFIG_KEY_DF_PATH |
sysmon.linux.df.df.block.opts | options passed to df when checking free space |
-P -B M |
CONFIG_KEY_DF_OPTIONS |
sysmon.linux.df.df.inode.opts | options passed to df when checking inodes |
-P -i |
CONFIG_KEY_DF_INODE_OPTIONS |
sysmon.linux.df.df.period | Period between checks, in seconds | 10 |
CONFIG_KEY_DF_PERIOD |
sysmon.linux.df.df.deviceNameFilter | Comma-separated list of device names (full path) to ignore when making free space calculations. |
|
CONFIG_KEY_DF_DEVICE_NAME_FILTER |
sysmon.linux.df.df.fsTypeFilter | Comma-separated list of filesystem types to ignore when making free space calculations. | iso9660,proc,sysfs,tmpfs |
CONFIG_KEY_DF_FS_TYPE_FILTER |
sysmon.linux.df.mtab.path | path to mtab file |
/etc/mtab |
CONFIG_KEY_MTAB_PATH |
Lifecycle documentation
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
CONFIG_KEY_DF_DEVICE_NAME_FILTER
Comma-separated list of device names (full path) to ignore when making free space calculations. |
static String |
CONFIG_KEY_DF_FS_TYPE_FILTER
Comma-separated list of file system types to ignore when making free space calculations. |
static String |
CONFIG_KEY_DF_INODE_OPTIONS
Options passed to df when calculating free inodes. |
static String |
CONFIG_KEY_DF_OPTIONS
Options passed to df. |
static String |
CONFIG_KEY_DF_PATH
Path to the df executable. |
static String |
CONFIG_KEY_DF_PERIOD
How often to run space calculations, in seconds. |
static String |
CONFIG_KEY_MTAB_PATH
Path to the mtab file. |
static String |
DEFAULT_DF_DEVICE_NAME_FILTER
Default device filter. |
static String |
DEFAULT_DF_FS_TYPE_FILTER
Default filesystem type filter. |
static String |
DEFAULT_DF_INODE_OPTIONS
Default options passed to df when making inode calculations. |
static String |
DEFAULT_DF_OPTIONS
Default options passed to df when making disk space calculations. |
static String |
DEFAULT_DF_PATH
Default's to using a bare path to allow use of $PATH to find the df executable. |
static int |
DEFAULT_DF_PERIOD
Default period, in seconds. |
static String |
DEFAULT_MTAB_PATH
Default path to mtab file Default value: "/etc/mtab" |
static String |
OBJECT_NAME_PREFIX
For each device name and the passed JMX bean path, the a bean will be mounted with the name '":type=filesystem,devicename="<devicename>' |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
LinuxDiskspaceJMXWrapper(Properties config)
|
Method Summary | |
---|---|
void |
kill()
|
void |
run()
|
void |
startMonitoring()
Starts background thread that will actually be performing monitoring runs. |
void |
stopMonitoring()
Signals shutdown to background thread and then waits for thread to die. |
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 |
---|
public static final String CONFIG_KEY_DF_PATH
default value for this config parameter
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_DF_OPTIONS
DEFAULT_DF_OPTIONS
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_DF_INODE_OPTIONS
DEFAULT_DF_INODE_OPTIONS
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_DF_PERIOD
DEFAULT_DF_PERIOD
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_DF_DEVICE_NAME_FILTER
DEFAULT_DF_DEVICE_NAME_FILTER
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_DF_FS_TYPE_FILTER
DEFAULT_DF_FS_TYPE_FILTER
,
df(1) on your local linux box,
Constant Field Valuespublic static final String CONFIG_KEY_MTAB_PATH
DEFAULT_MTAB_PATH
,
mount(8) on your local linux box,
Constant Field Valuespublic static final String OBJECT_NAME_PREFIX
public static final String DEFAULT_DF_PATH
for information on overriding the default value.
,
Constant Field Valuespublic static final String DEFAULT_DF_OPTIONS
for information on overriding the default value.
,
Constant Field Valuespublic static final String DEFAULT_DF_INODE_OPTIONS
for information on overriding the default value.
,
Constant Field Valuespublic static final int DEFAULT_DF_PERIOD
for information on overriding the default value.
,
Constant Field Valuespublic static final String DEFAULT_DF_DEVICE_NAME_FILTER
for information on overriding the default value.
,
Constant Field Valuespublic static final String DEFAULT_DF_FS_TYPE_FILTER
for information on overriding the default value.
,
Constant Field Valuespublic static final String DEFAULT_MTAB_PATH
for information on overriding the default value.
,
Constant Field ValuesConstructor Detail |
---|
public LinuxDiskspaceJMXWrapper(Properties config) throws LinuxMonitoringException
LinuxMonitoringException
Method Detail |
---|
public void startMonitoring()
startMonitoring
in interface Monitor
public void stopMonitoring() throws InterruptedException
stopMonitoring
in interface Monitor
InterruptedException
- if interrupted while waiting for thread to die.public void run()
run
in interface Runnable
run
in class Thread
public void kill()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |