|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.syabru.nagios.NagiosJmxPlugin
public class NagiosJmxPlugin
Nagios JMX plugin.
Field Summary | |
---|---|
static String |
PROP_ATTRIBUTE_KEY
Attribute key system property. |
static String |
PROP_ATTRIBUTE_NAME
Attribute name system property. |
static String |
PROP_HELP
Help output. |
static String |
PROP_OBJECT_NAME
Object name system property. |
static String |
PROP_OPERATION
Operation to invoke on MBean. |
static String |
PROP_PASSWORD
Password system property. |
static String |
PROP_SERVICE_URL
Service URL system property. |
static String |
PROP_THRESHOLD_CRITICAL
Threshold critical level system property. |
static String |
PROP_THRESHOLD_WARNING
Threshold warning level system property. |
static String |
PROP_UNITS
Units system property. |
static String |
PROP_USERNAME
Username system property. |
static String |
PROP_VERBOSE
Verbose output. |
Constructor Summary | |
---|---|
NagiosJmxPlugin()
|
Method Summary | |
---|---|
void |
closeConnection(MBeanServerConnection connection)
Close JMX connection. |
int |
execute(Properties args)
Get system properties and execute query. |
ObjectName |
getObjectName(MBeanServerConnection connection,
String objectName)
Get object name object. |
void |
invoke(MBeanServerConnection connection,
String objectName,
String operationName)
Invoke an operation on MBean. |
static void |
main(String[] args)
Main method. |
MBeanServerConnection |
openConnection(JMXServiceURL serviceUrl,
String username,
String password)
Open a connection to a MBean server. |
Object |
query(MBeanServerConnection connection,
String objectName,
String attributeName,
String attributeKey)
Query MBean object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_USERNAME
public static final String PROP_PASSWORD
public static final String PROP_OBJECT_NAME
public static final String PROP_ATTRIBUTE_NAME
public static final String PROP_ATTRIBUTE_KEY
public static final String PROP_SERVICE_URL
public static final String PROP_THRESHOLD_WARNING
public static final String PROP_THRESHOLD_CRITICAL
public static final String PROP_UNITS
public static final String PROP_OPERATION
public static final String PROP_VERBOSE
public static final String PROP_HELP
Constructor Detail |
---|
public NagiosJmxPlugin()
Method Detail |
---|
public MBeanServerConnection openConnection(JMXServiceURL serviceUrl, String username, String password) throws IOException
serviceUrl
- Service URL,
e.g. service:jmx:rmi://HOST:PORT/jndi/rmi://HOST:PORT/jmxrmiusername
- Usernamepassword
- Password
IOException
- XXpublic void closeConnection(MBeanServerConnection connection) throws IOException
connection
- Connection.
IOException
- XX.public ObjectName getObjectName(MBeanServerConnection connection, String objectName) throws InstanceNotFoundException, MalformedObjectNameException, NagiosJmxPluginException, IOException
connection
- MBean server connection.objectName
- Object name string.
InstanceNotFoundException
- If object not found.
MalformedObjectNameException
- If object name is malformed.
NagiosJmxPluginException
- If object name is not unqiue.
IOException
- In case of a communication error.public Object query(MBeanServerConnection connection, String objectName, String attributeName, String attributeKey) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NagiosJmxPluginException
connection
- MBean server connection.objectName
- Object name.attributeName
- Attribute name.attributeKey
- Attribute key.
InstanceNotFoundException
- XX
IntrospectionException
- XX
ReflectionException
- XX
IOException
- XX
AttributeNotFoundException
- XX
MBeanException
- XX
MalformedObjectNameException
- XX
NagiosJmxPluginException
- XXpublic void invoke(MBeanServerConnection connection, String objectName, String operationName) throws InstanceNotFoundException, IOException, MalformedObjectNameException, MBeanException, ReflectionException, NagiosJmxPluginException
connection
- MBean server connection.objectName
- Object name.operationName
- Operation name.
InstanceNotFoundException
- XX
IOException
- XX
MalformedObjectNameException
- XX
MBeanException
- XX
ReflectionException
- XX
NagiosJmxPluginException
- XXpublic int execute(Properties args) throws NagiosJmxPluginException
args
- Arguments as properties.
NagiosJmxPluginException
- XXpublic static void main(String[] args)
args
- Command line arguments.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |