AppD Archive

Custom Metrics not showing up in metric browser

CommunityUser
Splunk Employee
Splunk Employee

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!

0 Karma
1 Solution

CommunityUser
Splunk Employee
Splunk Employee

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.

View solution in original post

0 Karma

Angela_Lang
Path Finder

Could you please include the monitor.xml file you are using?

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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>

0 Karma

Angela_Lang
Path Finder

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?

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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]]

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

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.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...