<?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 Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring in OpenTelemetry/Skyline</title>
    <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252119#M656</link>
    <description>&lt;P&gt;Great job,&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/6901"&gt;@Alexander_Wilke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please look at my email, as we might have some plans for your script &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jun 2025 08:10:11 GMT</pubDate>
    <dc:creator>_Val_</dc:creator>
    <dc:date>2025-06-27T08:10:11Z</dc:date>
    <item>
      <title>Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251194#M641</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am running R81.20 + JumboHFA Take 99. I use the Skyline packages:&lt;/P&gt;
&lt;P&gt;BUNDLE_CPVIEWEXPORTER_AUTOUPDATE Take: 67&lt;BR /&gt;BUNDLE_CPOTLPAGENT_AUTOUPDATE Take: 92&lt;BR /&gt;BUNDLE_CPOTELCOL_AUTOUPDATE Take: 179&lt;BR /&gt;&lt;BR /&gt;I created my script based on this not so complete and correct documentation:&lt;BR /&gt;&lt;A href="https://sc1.checkpoint.com/documents/Appliances/Skyline/Content/Topics-AG/Custom-Metrics.htm#:~:text=You%20can%20configure%20custom%20metrics%20and%20query%20them,metrics.%20Create%20this%20script%20file%20in%20any%20directory" target="_blank"&gt;https://sc1.checkpoint.com/documents/Appliances/Skyline/Content/Topics-AG/Custom-Metrics.htm#:~:text=You%20can%20configure%20custom%20metrics%20and%20query%20them,metrics.%20Create%20this%20script%20file%20in%20any%20directory&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Idea:&lt;BR /&gt;there are some metrics which show the cluster_xl status. But these metrics only show the status of the SGM within a Maestro environment. As all SGMs are in general "ACTIVE" there is no indicator/metric which shows which chassis is the ACTIVE chassis or if the chassis is ACTIVE at all or down or chassis admin down, standby etc.&lt;/P&gt;
&lt;P&gt;So I tried with a simple bash script to collect these information from "asg stat -v" and put this into otlp metrics. here is my script, my commands and a documentation which helps me to understand what to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;### create the script which collects the information we need:
vi /config/skyline_custom_metrics/chassis_state.sh

____________________________________________________________________________________________________________________________________________________

#!/bin/bash
### Include Checkpoint environment variables
source /opt/CPshrd-R81.20/tmp/.CPprofile.sh
. /opt/CPotlpAgent/cs_data_handler_is.bash


## script part to check the values

# status chassis 1
chassis_1=$(asg stat -v | grep "SGM ID" -A1 | grep -v "SGM ID" | awk -F ' ' '{print $2}')

# status chassis2
chassis_2=$(asg stat -v | grep "SGM ID" -A1 | grep -v "SGM ID" | awk -F ' ' '{print $3}')

# reset variable "metric_value"
metric_value=0  

# check if both chassis are ACTIVE (split brain) and set metric_value
if [[ "$chassis_1" == *ACTIVE* &amp;amp;&amp;amp; "$chassis_2" == *ACTIVE* ]]; then  
    metric_value=3  
# check chassis_1
elif [[ "$chassis_1" == *ACTIVE* ]]; then  
    metric_value=1  
# check chassis_2
elif [[ "$chassis_2" == *ACTIVE* ]]; then  
    metric_value=2  
# check if no chassis is active set 0
else  
    metric_value=0  
fi  



## Building the metric otlp with its labels and values
     # value of the metric itself. if not gauge or counter set to 1 or something else
set_ot_object new value ${metric_value}

     # define a label and its value. the value is result from the previous script and was saved in a variable and used here.
     # we add "host_name" as this is needed for identification
     # set_ot_object last label host_name ${host_name}
     # define a label and its value. the value is result from the previous script and was saved in a variable and used here
set_ot_object last label chassis_1 ${chassis_1}

     # define a label and its value. the value is result from the previous script and was saved in a variable and used here
set_ot_object last label chassis_2 ${chassis_2}

### mandatory to quit the script
script_exit "Finished running" 0


____________________________________________________________________________________________________________________________________________________

### create the json file which we need for this script
/config/skyline_custom_metrics/chassis_state.json


### documentation is missing the "secured" parameter but sklnctl complains if this is missing
### what the meaning of "secured" is not documented but sklnctl command complains if not added

{
  "state" : "enabled",
  "command" : "/config/skyline_custom_metrics/chassis_state.sh",
  "desc" : "Chassis status in Maestro",
  "name" : "chassis.state",
  "type" : "Gauge",
  "unit" : "{bool}",
  "interval" : 15,
  "secured" : "false"
}


____________________________________________________________________________________________________________________________________________________


### as a test you may run the script like this and you get a JSON output back which tells you if your script worked:
chmod 775 /config/skyline_custom_metrics/*
/config/skyline_custom_metrics/chassis_state.sh


### copy script and json to all members of the Maestro Cluster
asg_cp2blades /config/skyline_custom_metrics/ -r


## --name is the script name not the filename and is wrong in the documentation
## --path is the path to the json not the shell script, the json has the path to the shell script. the documentation is wrong here
## "secured" needs to be added to the json and is missing in documentation
## yes confirms the confirmation request
gexec -b all -c 'yes | sklnctl otlp add --name /config/skyline_custom_metrics/chassis_state --path /config/skyline_custom_metrics/chassis_state.json'

## you need to enable the script first which is missing in documentation
## --name you defined earlier
## "script" means it is of type script. you can enable and disable "collectors" with this command, too.
gexec -b all -c 'sklnctl otlp enable --name chassis_state script'


### restart the otlp and otelcol processes and wait for the metrics.
g_all /opt/CPotlpAgent/CPotlpagentCli.sh stop; sleep 2; g_all /opt/CPotlpAgent/CPotlpagentCli.sh start
g_all /opt/CPotelcol/CPotelcolCli.sh stop; sleep 2; g_all /opt/CPotelcol/CPotelcolCli.sh start



### To add additional processes to the monitoring you may add these by the following commands

## add additional system processes to the monitoring
## To check if the process is monitored check this metric: "process_cpu_usage"
## I added pepd, pdpd and rsyslogd - I used "ps -ef | sort" to get a list on the system
gexec -b all -c 'sklnctl otlp process --add pepd,pdpd,rsyslogd'

### shows the list of all monitored processes
sklnctl otlp process --show

### restart the otlp and otelcol processes
g_all /opt/CPotlpAgent/CPotlpagentCli.sh stop; sleep 2; g_all /opt/CPotlpAgent/CPotlpagentCli.sh start
g_all /opt/CPotelcol/CPotelcolCli.sh stop; sleep 2; g_all /opt/CPotelcol/CPotelcolCli.sh start
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Jun 2025 22:08:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251194#M641</guid>
      <dc:creator>Alexander_Wilke</dc:creator>
      <dc:date>2025-06-12T22:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251625#M645</link>
      <description>&lt;P&gt;Do we want to start a maestro only thread?&lt;BR /&gt;&lt;BR /&gt;I have a maestro view that lets me select in skyline the firewall name that shows up in smartconsole.&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I will show first some averages / summaries of all the blades in that SG.&lt;BR /&gt;&lt;BR /&gt;Then I have it walk through all the blades / members in that SG and show the CPU Memory network.... etc for each blade using the &amp;lt;smartconsolename01-01&amp;nbsp; 01-02&amp;nbsp; 01-03...&amp;gt;&amp;nbsp; names to get the individual blade specs.&lt;BR /&gt;&lt;BR /&gt;I think some of your above script will help with that as I have issues figuring out when to "stop" and how to tell if a specific blade number is down / missing because its been pulled out at the SMO level or because it has an issue...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 15:40:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251625#M645</guid>
      <dc:creator>David_Evans</dc:creator>
      <dc:date>2025-06-19T15:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251636#M646</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/17016"&gt;@David_Evans&lt;/a&gt;&amp;nbsp;I think I still have this. I created a dashboard variable for "host_name" and this allows me to view all my firewalls and SGMs in a separate "row". It's based on&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/11456"&gt;@Kaspars_Zibarts&lt;/a&gt;&amp;nbsp;Dashboard which I found somewhere here in the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add missing metrics like the 64k/maestro specific metrics and commands.&lt;/P&gt;
&lt;P&gt;asg stat -v&lt;BR /&gt;fwaccel stats -s&lt;BR /&gt;orch_stat -p&lt;BR /&gt;and others.&lt;BR /&gt;&lt;BR /&gt;Building these scripts is more or less easy stepp. I use the AI and it build me the shell scripts.&lt;BR /&gt;My problem ist that these metrics are not collected or not send correctly or otlpagent stops executing these scripts because of high CPU usage.&lt;BR /&gt;&lt;BR /&gt;My "asg stat -v" panel looks like this. To use the panel json you need Grafana 12.0.0 or higher and the new layouts feature toggle enabled.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asg_stat_v.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/30807iB9DAAE94BCC2874B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="asg_stat_v.png" alt="asg_stat_v.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Grafana Panel json as attachment.&lt;BR /&gt;&lt;BR /&gt;My complete CheckPoint Dahboard added as attachment.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I addition I added the&amp;nbsp;&lt;BR /&gt;fwaccel stats -s&lt;BR /&gt;asg stat -v&lt;BR /&gt;orch_stat -p (tx and rx)&lt;BR /&gt;&lt;BR /&gt;scripts. if you run them individually they work. if you run them from "sklnctl otlp add --name" the do not work or only on some SGMs not all. Have several tickets open at my diamond team.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditor_694b4797817645Alexander_Wilke_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 21:06:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/251636#M646</guid>
      <dc:creator>Alexander_Wilke</dc:creator>
      <dc:date>2025-06-19T21:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252119#M656</link>
      <description>&lt;P&gt;Great job,&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/6901"&gt;@Alexander_Wilke&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please look at my email, as we might have some plans for your script &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 08:10:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252119#M656</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2025-06-27T08:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252583#M657</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a bunch of new and updated scripts. I think they work - at least all of them produce JSON output.&lt;BR /&gt;Unfortunately the OTLP Agent including version 103 has bugs with cs_data_handle file locks, preventing multiple scripts to run. This issue should be solved in take 114 but this is not released.&lt;/P&gt;
&lt;P&gt;Not sure if this CPotlpAgent Version 114 will fix issue with Scripts running long /20s) and generating (high) CPU load e.g. on an MHO with only 2 CPU Cores.&lt;/P&gt;
&lt;P&gt;PS:&lt;BR /&gt;I am only allowed to add 20 files so I added the shell scripts. you may need to add the json files on your own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 20:30:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252583#M657</guid>
      <dc:creator>Alexander_Wilke</dc:creator>
      <dc:date>2025-07-03T20:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252593#M658</link>
      <description>&lt;P&gt;Nice work thank you!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;I already stopped my work with custom&amp;nbsp; scripts due to the mentioned stability issues. Hope those are fixed soon.&lt;BR /&gt;One more for your list could be "asg stat vs all" which is showing HA state of VSX virtual systems in a maestro cluster.&lt;BR /&gt;A few weeks ago I already opened an RFE for this, but RFEs take more time that creating custom scripts&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 07:10:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252593#M658</guid>
      <dc:creator>Sven_Glock</dc:creator>
      <dc:date>2025-07-04T07:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252595#M659</link>
      <description>&lt;P&gt;Hi Sven,&lt;/P&gt;
&lt;P&gt;I do not use any virtual systems or security groups so I (a) don't know how exactly the output looks like with multiple VS and (b) I do not know which label:value pairs would be relevant/interesting in a metric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To generate these scripts I put the checkpoint custom metrics documentation and the exact output of the command into the ChatGPT or other chat box and then iterate as long as I have a script which gives me json output.&lt;BR /&gt;&lt;BR /&gt;I noticed if I use some simple tasks first and get a working script then AI can use these to better create the followup scripts.&lt;/P&gt;
&lt;P&gt;However - as long as they do not run reliably it is useless. Hopefully take 114 will solve these issues&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 07:23:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252595#M659</guid>
      <dc:creator>Alexander_Wilke</dc:creator>
      <dc:date>2025-07-04T07:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Skyline Custom Script - Maestro Chassis State and add additional processes to otlp monitoring</title>
      <link>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252606#M661</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If a kind fairy conjures up some free time for me, I would gladly try to delve into the topic of VSX/Security Group based on your scripts and would post it here.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 11:50:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/OpenTelemetry-Skyline/Skyline-Custom-Script-Maestro-Chassis-State-and-add-additional/m-p/252606#M661</guid>
      <dc:creator>Sven_Glock</dc:creator>
      <dc:date>2025-07-04T11:50:46Z</dc:date>
    </item>
  </channel>
</rss>

