public class NagiosWriter extends BaseOutputWriter
| Modifier and Type | Field and Description |
|---|---|
protected static int |
LOG_IO_BUFFER_SIZE_BYTES |
protected static String |
LOG_PATTERN |
protected org.apache.log4j.Logger |
logger |
protected Map<String,org.apache.log4j.Logger> |
loggers |
BINARY_PATH, BOOLEAN_AS_NUMBER, DEBUG, HOST, OUTPUT_FILE, PORT, TEMPLATE_FILE, TYPE_NAMES| Constructor and Description |
|---|
NagiosWriter(com.google.common.collect.ImmutableList<String> typeNames,
boolean booleanAsNumber,
Boolean debugEnabled,
List<String> filters,
List<String> thresholds,
String nagiosHost,
String outputFile,
String prefix,
String suffix,
Map<String,Object> settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkFile(Query query)
Creates the logging.
|
com.google.common.collect.ImmutableList<String> |
getFilters() |
String |
getNagiosHost() |
String |
getOutputFile() |
String |
getPrefix() |
String |
getSuffix() |
com.google.common.collect.ImmutableList<String> |
getThresholds() |
protected org.apache.log4j.Logger |
initLogger(String fileStr)
Initializes the logger.
|
void |
internalWrite(Server server,
Query query,
com.google.common.collect.ImmutableList<Result> results)
The meat of the output.
|
protected String |
nagiosCheckValue(String value,
String composeRange)
Define if a value is in a critical, warning or ok state.
|
void |
validateSetup(Server server,
Query query)
Initial log setup.
|
protected boolean |
valueCheck(double value,
String simpleRange)
Check if a value is inside of a range defined in the thresholds.
|
close, create, doWrite, firstNonNull, getConcatedTypeNameValues, getSettings, getTypeNames, isDebugEnabled, start, toStringprotected static final String LOG_PATTERN
protected static final int LOG_IO_BUFFER_SIZE_BYTES
protected org.apache.log4j.Logger logger
public void validateSetup(Server server, Query query) throws ValidationException
ValidationExceptionpublic void checkFile(Query query) throws ValidationException
The external command file is implemented as a named pipe (FIFO), which is created when Nagios starts and removed when it shuts down. If the file exists when Nagios starts, the Nagios process will terminate with an error message. http://nagios.sourceforge.net/docs/3_0/configmain.html#command_file
ValidationExceptionpublic void internalWrite(Server server, Query query, com.google.common.collect.ImmutableList<Result> results) throws Exception
internalWrite in class BaseOutputWriterExceptionprotected org.apache.log4j.Logger initLogger(String fileStr) throws IOException
fileStr - IOExceptionprotected String nagiosCheckValue(String value, String composeRange)
protected boolean valueCheck(double value,
String simpleRange)
public com.google.common.collect.ImmutableList<String> getFilters()
public com.google.common.collect.ImmutableList<String> getThresholds()
public String getNagiosHost()
public String getOutputFile()
public String getPrefix()
public String getSuffix()
Copyright © 2010-2017 JmxTrans team. All Rights Reserved.