Products
Solutions
Resources
Customers
Company

Sign in
My Account.
The Event Publisher Extension executes scripts at various intervals and reports events based on exit code generated by the script.
This extension works only with the standalone machine agent.
Note: The event scripts must have read access by the Machine Agent for the monitoring extension to execute them.
Note: While starting the machine agent please set the property metric.http.listener to true
ex: java -Dmetric.http.listener=true -jar machineagent.jar
Param | Description |
---|---|
project_path | Location of the events script root directory |
worker_count | Number of worker thread(s) that will be spawned as part of the Executor Pool to execute the scripts |
<monitor>
<name>EventPublisherMonitor</name>
<type>managed</type>
<description>Event Publisher Monitor</description>
<monitor-configuration></monitor-configuration>
<monitor-run-task>
<execution-style>periodic</execution-style>
<name>Event Publisher Monitor Run Task</name>
<display-name>Event Publisher Monitor Task</display-name>
<description>Event Publisher Monitor Task</description>
<type>java</type>
<execution-timeout-in-secs>60</execution-timeout-in-secs>
<task-arguments>
<argument name="project_path" is-required="true" default-value="/home/satish/AppDynamics/MachineAgent/monitors/EventPublisherMonitor"/>
<!-- Controls how many worker threads would be spawned to execute the scripts -->
<argument name="worker_count" is-required="false" default-value="5"/>
</task-arguments>
<java-task>
<classpath>event-publisher-extension.jar</classpath>
<impl-class>com.appdynamics.monitors.events.EventPublisherMonitor</impl-class>
</java-task>
</monitor-run-task>
</monitor>
Param | Description |
---|---|
<name> | Name of the event |
<path> | Path to the shell file |
<period> | (seconds) - Delay between consecutive calls. |
<max-wait-time> | (seconds) - seconds to wait before force killing this script. If not specified or is more than period then assumes the value specified in period. |
<arguments> | Arguments that will be passed to the script |
<events>
<event>
<name>Tomcat Status</name>
<summary>Tomcat Status</summary>
<comment>Event for tomcat status</comment>
<path>/home/satish/AppDynamics/Code/extensions/event-publisher-extension/src/main/resources/config/scripts/script.sh</path>
<outputs>
<output>
<exitCode>0</exitCode>
<status>Down</status>
</output>
<output>
<exitCode>1</exitCode>
<status>Up</status>
</output>
</outputs>
<arguments/>
<!--Number of seconds to wait to execute the script periodically -->
<period>60</period>
<!-- Number of seconds to wait before force killing this script. If not specified or is more than period then assumes the value specified in period-->
<max-wait-time>5</max-wait-time>
</event>
</events>
#!/bin/bash
COUNT=`ps -ef | grep tomcat| grep -v grep | wc -l`
if [ "$COUNT" = 0 ]; then
exit 0
else
exit 1
fi
Above script file will check whether tomcat is up or not. Exit code from the script will be looked up in the events.xml to get the status. From the above script
Always feel free to fork and contribute any changes directly via GitHub.
Please look at the troubleshooting document and make sure that everything is followed correctly.
For any support questions, please contact help@appdynamics.com.
Version: | 1.0.1 |
Compatibility: | 3.7 |
Last Update: | 2/19/2018 |