<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING) in OpenTelemetry/Skyline</title>
    <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/247795#M587</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a custom metric for Skyline. I'm following &lt;A href="https://sc1.checkpoint.com/documents/Appliances/Skyline/Content/Topics-AG/Custom-Metrics.htm?tocpath=_____7" target="_blank" rel="noopener"&gt;Skyline Administration Guide - Custom Metric&lt;/A&gt; but much like &lt;A href="https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-telemetry-route-count-issue/m-p/236327#M545" target="_blank" rel="noopener"&gt;Adam_Kouril in his Post&lt;/A&gt; I noticed the deviation of the documentation and actual behavior.&lt;/P&gt;&lt;P&gt;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&lt;FONT color="#000000"&gt;&amp;nbsp;/var/log/CPotlpAgent/backup/scripts&lt;/FONT&gt; and the command is rewritten to the new path (According to the output of&lt;FONT color="#000000"&gt; sklnctl otlp config&lt;/FONT&gt;).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Nonetheless I get this error message and no custom metric:&lt;/P&gt;&lt;P&gt;/opt/CPotlpAgent/otlp_agent.log&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test-metric.json&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "state" : "enabled",
  "command" : "/home/admin/test_metric.sh",
  "desc" : "Testing the custom metric feature",
  "name" : "custom.metric",
  "type" : "Gauge",
  "unit" : "1",
  "interval" : 10
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_metric.sh&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/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&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Versions:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HOTFIX_R81_20_JUMBO_HF_MAIN	Take:  92
BUNDLE_CPOTLPAGENT_AUTOUPDATE	Take:  50
BUNDLE_CPOTELCOL_AUTOUPDATE	Take:  129&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I would appreciate any help or suggestions!&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;jamoin&lt;/P&gt;</description>
    <pubDate>Wed, 30 Apr 2025 13:29:05 GMT</pubDate>
    <dc:creator>jamoin</dc:creator>
    <dc:date>2025-04-30T13:29:05Z</dc:date>
    <item>
      <title>Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING)</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/247795#M587</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a custom metric for Skyline. I'm following &lt;A href="https://sc1.checkpoint.com/documents/Appliances/Skyline/Content/Topics-AG/Custom-Metrics.htm?tocpath=_____7" target="_blank" rel="noopener"&gt;Skyline Administration Guide - Custom Metric&lt;/A&gt; but much like &lt;A href="https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-telemetry-route-count-issue/m-p/236327#M545" target="_blank" rel="noopener"&gt;Adam_Kouril in his Post&lt;/A&gt; I noticed the deviation of the documentation and actual behavior.&lt;/P&gt;&lt;P&gt;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&lt;FONT color="#000000"&gt;&amp;nbsp;/var/log/CPotlpAgent/backup/scripts&lt;/FONT&gt; and the command is rewritten to the new path (According to the output of&lt;FONT color="#000000"&gt; sklnctl otlp config&lt;/FONT&gt;).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Nonetheless I get this error message and no custom metric:&lt;/P&gt;&lt;P&gt;/opt/CPotlpAgent/otlp_agent.log&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test-metric.json&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "state" : "enabled",
  "command" : "/home/admin/test_metric.sh",
  "desc" : "Testing the custom metric feature",
  "name" : "custom.metric",
  "type" : "Gauge",
  "unit" : "1",
  "interval" : 10
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test_metric.sh&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/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&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Versions:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HOTFIX_R81_20_JUMBO_HF_MAIN	Take:  92
BUNDLE_CPOTLPAGENT_AUTOUPDATE	Take:  50
BUNDLE_CPOTELCOL_AUTOUPDATE	Take:  129&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I would appreciate any help or suggestions!&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;jamoin&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 13:29:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/247795#M587</guid>
      <dc:creator>jamoin</dc:creator>
      <dc:date>2025-04-30T13:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING)</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248425#M603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/43294"&gt;@jamoin&lt;/a&gt;&amp;nbsp; -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest to do the following:&lt;/P&gt;
&lt;P&gt;Comments:&lt;/P&gt;
&lt;P&gt;* There is a known issue in docs "name" is just a unique name for the script, it doesn't have to be a path&lt;/P&gt;
&lt;P&gt;* We automatically copy the script to our /var/log folder to make sure it will persist upgrade or operations on the machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Please upgrade the Skyline components to the latest - the admin guide contains guidance to the Sk per component.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) How are you running the add script command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 10:03:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248425#M603</guid>
      <dc:creator>Elad_Chomsky</dc:creator>
      <dc:date>2025-05-08T10:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING)</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248618#M604</link>
      <description>&lt;P&gt;Hi Elad,&lt;BR /&gt;&lt;BR /&gt;thanks for you reply. The system is now&amp;nbsp; updated to&amp;nbsp; JHF T99 which brings us to:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BUNDLE_CPOTLPAGENT_AUTOUPDATE Take: 63
BUNDLE_CPOTELCOL_AUTOUPDATE Take: 141&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sklnctl otlp add --name test-metric --path /home/admin/test_metric.json
Error: field Secured: required
Unagreed Schema, Verify the script output&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;jamoin&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 08:55:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248618#M604</guid>
      <dc:creator>jamoin</dc:creator>
      <dc:date>2025-05-12T08:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom metric: Was not added due to Scriptdoesnothasacommand=(MISSING)</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248620#M605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/43294"&gt;@jamoin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;It might be missing from the documentation, please add "secured" : "false", to your payload for the custom script.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 09:16:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Custom-metric-Was-not-added-due-to-Scriptdoesnothasacommand/m-p/248620#M605</guid>
      <dc:creator>Elad_Chomsky</dc:creator>
      <dc:date>2025-05-12T09:16:43Z</dc:date>
    </item>
  </channel>
</rss>

