Debug Scripts

These debug scripts illustrate two common methods for integrating custom metrics with Skyline:

  • Script A (hello_world_a.sh): uses Skyline infrastructure and predefined templates to structure metric data.

  • Script B (hello_world_b.sh): functions independently, generating the metric output internally without relying on Skyline templates.

Use these scripts as references when building new custom metrics or troubleshooting existing metrics in Skyline.

Procedure:

  1. Copy the archive with the required shell scripts from your computer to the Gaia server to some directory (for example, /var/log/).

  2. Connect to the command line on the Gaia server.

  3. Log in to the Expert mode.

  4. Go to the directory with the archive:

    cd /var/log/

  5. Extract the archive:

    tar xvf Skyline_Debug.tar

  6. Assign the 'execute' permission to the scripts:

    chmod +x /var/log/Skyline_Debug/*

  7. Convert the scripts to the UNIX format:

    dos2unix /var/log/Skyline_Debug/*

  8. Copy the shell scripts to the directory "/usr/bin/":

    cp -v /var/log/Skyline_Debug/* /usr/bin

  9. Create the file /home/<USERNAME>/hello_world_a_payload.json:

    Note - Substitute the correct "<USERNAME>".

    1. Create the file:

      vi /home/<USERNAME>/hello_world_a_payload.json

    2. Paste this syntax into the file, save the changes, and exit Vi editor:

      {
        "name": "hello.world.a",
        "desc": "Use this to debug custom scripts with a template",
        "unit": "\{a}",
        "type": "Gauge",
        "state": "enabled",
        "command": "/usr/bin/hello_world_a.sh",
        "secured": "true",
        "interval" : 15
      }
      
    3. Add the custom script to the OpenTelemetry Agent:

      sklnctl otlp add --name hello_word_a --path /home/<USERNAME>/hello_world_a_payload.json

  10. Create the file /home/<USERNAME>/hello_world_b_payload.json:

    Note - Substitute the correct "<USERNAME>".

    1. Create the file:

      vi /home/<USERNAME>/hello_world_b_payload.json

    2. Paste this syntax into the file, save the changes, and exit Vi editor:

      {
        "name": "hello.world.b",
        "desc": "Use this to debug custom scripts without a template",
        "unit": "\{b}",
        "type": "Gauge",
        "state": "enabled",
        "command": "/usr/bin/hello_world_b.sh",
        "secured": "true",
        "interval" : 15
      }
      
    3. Add the custom script to the OpenTelemetry Agent:

      sklnctl otlp add --name hello_word_b --path /home/<USERNAME>/hello_world_b_payload.json

  11. Track the results of the scripts "hello_world_a" and "hello_world_b" in Grafana / Prometheus.

    • If results are missing or getting dropped from both "hello_world_a" and "hello_world_b", contact Check Point Support to investigate OpenTelemetry Agent issues.

      Run this command to collect the required logs:

      sklcntl collect_logs

    • If results are missing or getting dropped from only "hello_world_a" or "hello_world_b", contact Check Point Support to re-write the script.