Hi,
We created a custom monitoring extension using shell script and below is what we output.
name=Custom Metrics|Server Monitors|Port Listening Status|Port1,value=1,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Port Listening Status|Port2,value=1,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Port Listening Status|Port3,value=1,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Mount Status,value=2,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Live Monitor|HTTP Status,value=200,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Live Monitor|Time Taken,value=2,aggregator=OBSERVATION,time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Agent Monitor|HTTP Status,value=200,aggregator=OBSERVATION, time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
name=Custom Metrics|Server Monitors|Agent Monitor|Time Taken,value=55,aggregator=OBSERVATION,time-rollup=CURRENT,cluster-rollup=INDIVIDUAL
But these metrics are not getting displayed in the metric browser. We restarted the machine agents as well but that didnt help.
Script works fine when we run it through the command prompt. We checked the logs too but I dont see any errors or exceptions being thrown there.
Please help.
Thanks!
There was an issue with a command in my script because of which metrics were not coming up. Fixed that and can see the metrics now.
Thanks Angela for looking into this.
Could you please include the monitor.xml file you are using?
Please see below.
<monitor>
<name>URLMonitor</name>
<type>managed</type>
<description>Monitors All Servers.
</description>
<monitor-configuration>
</monitor-configuration>
<monitor-run-task>
<execution-style>periodic</execution-style>
<name>Run</name>
<type>executable</type>
<execution-timeout-in-secs>60</execution-timeout-in-secs>
<task-arguments>
</task-arguments>
<executable-task>
<type>file</type>
<file os-type="linux">URLMonitor.sh</file>
</executable-task>
</monitor-run-task>
</monitor>
Have you checked that the subdirectory containing your script and monitor.xml files has read, write, and execute permissions and is in the Machine Agent's Monitors subdirectory? Also does the machine agent have execute permissons on the script file and the contents of the file?
Yes. I have checked those and is properly set up. I can see the below in the machine agent logs as well.
[Agent-Scheduler-1] 21 Jan 2015 09:21:21,366 INFO ExecTask - Running Executable Command [[/data/Appdynamics/Machineagent/monitors/urlmonitors/URLMonitor.sh]]]
[Agent-Scheduler-1] 21 Jan 2015 09:21:21,369 INFO ExecTask - Started Executable Command [[/data/Appdynamics/Machineagent/monitors/urlmonitors/URLMonitor.sh]]
There was an issue with a command in my script because of which metrics were not coming up. Fixed that and can see the metrics now.
Thanks Angela for looking into this.