Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
jamoin
Explorer
Jump to solution

Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING)

Hi,

I'm trying to create a custom metric for Skyline. I'm following Skyline Administration Guide - Custom Metric but much like Adam_Kouril in his Post I noticed the deviation of the documentation and actual behavior.

I came to the conclusion that in the configuration json, its seems like the expect value for the command key is the path to script that outputs the metrics in its original location. When adding it as metric the script is moved to /var/log/CPotlpAgent/backup/scripts and the command is rewritten to the new path (According to the output of sklnctl otlp config).

Nonetheless I get this error message and no custom metric:

/opt/CPotlpAgent/otlp_agent.log

caller=level.go:63 ts=2025-04-30T05:02:10.200-04:00 caller=level.go:63 level=error msg="Script:  is missing command"
caller=level.go:63 level=error msg="Script: /home/admin/test_metric was not added due to: " Scriptdoesnothasacommand=(MISSING)

 

test-metric.json

{
  "state" : "enabled",
  "command" : "/home/admin/test_metric.sh",
  "desc" : "Testing the custom metric feature",
  "name" : "custom.metric",
  "type" : "Gauge",
  "unit" : "1",
  "interval" : 10
}

 

test_metric.sh

#!/bin/bash

. /opt/CPotlpAgent/cs_data_handler_is.bash

VALUE=$(($RANDOM % 5))

set_ot_object new value $VALUE
set_ot_object last label test hello

script_exit "Finished running" 0

 
Versions:

HOTFIX_R81_20_JUMBO_HF_MAIN	Take:  92
BUNDLE_CPOTLPAGENT_AUTOUPDATE	Take:  50
BUNDLE_CPOTELCOL_AUTOUPDATE	Take:  129


I would appreciate any help or suggestions!

Kind regards

jamoin

0 Kudos
1 Solution

Accepted Solutions
Elad_Chomsky
Employee
Employee

Hi @jamoin ,

It might be missing from the documentation, please add "secured" : "false", to your payload for the custom script. 

View solution in original post

3 Replies
Elad_Chomsky
Employee
Employee

Hi @jamoin  - 

I suggest to do the following:

Comments:

* There is a known issue in docs "name" is just a unique name for the script, it doesn't have to be a path

* We automatically copy the script to our /var/log folder to make sure it will persist upgrade or operations on the machine. 

1) Please upgrade the Skyline components to the latest - the admin guide contains guidance to the Sk per component. 

2) How are you running the add script command?

 

0 Kudos
jamoin
Explorer

Hi Elad,

thanks for you reply. The system is now  updated to  JHF T99 which brings us to:

BUNDLE_CPOTLPAGENT_AUTOUPDATE Take: 63
BUNDLE_CPOTELCOL_AUTOUPDATE Take: 141

 

I removed the previous attempts and following your note used a simple name instead of a path for the --name parameter. This was the command:

sklnctl otlp add --name test-metric --path /home/admin/test_metric.json
Error: field Secured: required
Unagreed Schema, Verify the script output

 

I could not find any mention of the field "Secured". The script is the same as above. I checked against /opt/CPotlpAgent/custom_scripts_template_example.bash and it does not suggest anything different.

 

Kind Regards

jamoin

0 Kudos
Elad_Chomsky
Employee
Employee

Hi @jamoin ,

It might be missing from the documentation, please add "secured" : "false", to your payload for the custom script. 

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events