Event Publisher Extension

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.


  1. Download the file EventPublisherMonitor.zip
  2. Unzip the downloaded file and cd into EventPublisherMonitor
  3. Open the monitor.xml file and edit the project path to the EventPublisherMonitor directory that was just created.
  4. Open the events.xml file and add the appropriate scripts such as those in the events.xml example.
  5. Restart the Machine Agent by setting -Dmetric.http.listener=true.
  6. In the AppDynamics controller, look for events in <App ID> -> Events

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


XML Examples



project_pathLocation of the events script root directory
worker_countNumber of worker thread(s) that will be spawned as part of the Executor Pool to execute the scripts


    <description>Event Publisher Monitor</description>
        <name>Event Publisher Monitor Run Task</name>
        <display-name>Event Publisher Monitor Task</display-name>
        <description>Event Publisher Monitor Task</description>
            <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"/>



<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


            <name>Tomcat Status</name>
            <summary>Tomcat Status</summary>
            <comment>Event for tomcat status</comment>
            <!--Number of seconds to wait to execute the script periodically -->
            <!-- 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-->

Example script


COUNT=`ps -ef | grep tomcat| grep -v grep | wc -l`
if [ "$COUNT" = 0 ]; then
    exit 0
    exit 1

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

  • if exit code is 0 then the status is Down
  • if exit code is 1 then the status is Up



Always feel free to fork and contribute any changes directly via GitHub.




For any support questions, please contact help@appdynamics.com.






Last Update: