Examples

Tag
Module
110 examples

Level

Title

Tags

Modules

Description

🟒

Simple remote connectors

variable

osp-web

This example explains how to create a random value generated by a remote connector.

  • Declare a remote module using an empty module.remote file instead of module.service.

  • Configure a waveform owner to generate a random value.

  • Connect a remote connector container using TLS certificates from the stack.

  • Verify the exposed dispatcher port and visualize the result on a dashboard.

🟒

Access alarms from a script

script alarm

osp-scripts osp-alarms

This example will show how to access the alarms from a script.

  • Create a detached script that runs on a fixed interval using detached.scripts.

  • Check for the existence of an alarm using alarms.exists before acting.

  • Create a new alarm from script if it does not exist.

  • Retrieve live alarms with alarms.getLive and escalate severity when needed.

🟒

ASPsms notification

notification

osp-communications osp-reports

This example shows how to configure SMS notifications using the ASPsms provider: set up the provider credentials, create a notification with a FreeMarker template, and define an output linked to a contact.

  • Configure an ASPsms provider with credentials and a status value.

  • Create a notification referencing a FreeMarker template for the SMS body.

  • Define an output linked to a contact from the directory.

  • Monitor the provider status from a dashboard widget.

🟒

Basic Inventory Example

template composer

osp-web

This example illustrates key aspects of the configuration generation system Templating Generation.

  • Define a playbook with a CSV_INVENTORY task to generate configuration files from each CSV row.

  • Use a variables.ospp file to supply default playbook variables, which can be overridden at task level.

  • Apply path providers (CELL_PICKER, RELATIVE, EVALUATION) to construct output paths dynamically.

  • Execute the playbook via the Composer interface and verify the generated output in OnSphere.

🟒

Collection table with row detailed view

collection dashboard

osp-web osp-collections

This tutorial shows how to enable the row detail view functionality for a Collection table.

  • Define a journal property in the collection schema as an array of objects with id, user, text, timestamp, and meta fields.

  • Set tableRowDetail to journal in the schema.web view definition to activate the expandable row detail.

  • Create a dashboard with a CollectionTable and expand a row to view journal entries inline.

🟒

Colored rows for collection table

collection dashboard

osp-web osp-collections

This tutorial shows how to create a Collection table with colored rows coming from an external collection.

  • Create a separate priority collection that defines color properties (fgHiColor, etc.) as strings or dark/light objects.

  • Reference the priority collection from the main collection schema using the $ref keyword.

  • Expose a priority selector in the form using the appropriate form.web render.

  • Set the column render type to SEVERITY in schema.web to display colored rows based on the linked priority.

🟒

Configure hostname

variable

osp-alarms osp-web

This example explains how to change the default OnSphere stack hostname by creating a stack.cfg configuration file.

  • Create a stack.cfg file under root/configuration/ to declare a custom hostname.

  • The file applies to osp-web, osp-configuration-dispatcher and osp-keycloak modules.

  • Add the hostname to /etc/hosts when no DNS routing is available.

🟒

Connect an OPC UA client to read, write and use methods from a server.

opc-ua variable

osp-alarms osp-web osp-opc-ua osp-variables

In this tutorial, you will learn how to create an OPC UA client and use it with your OPC UA server. You will only need an OPC UA server to connect to.

  • Generate and share a Docker secret to store an encrypted device password.

  • Import the OPC UA server X.509 certificate into the configuration.

  • Read boolean, integer and string node values from the OPC UA server.

  • Write a value or call a method on the server using OPC UA outputs and callbacks.

  • Subscribe to node changes and display live values on a dashboard.

🟒

Create alarm from snmp trap

snmp alarm

osp-snmp-trap

This example shows how to convert incoming SNMP traps into OnSphere alarms using Lua parsing rules linked to the SNMP trap module.

  • Write Lua parsing rules (main.rules) to analyze incoming SNMP traps and dispatch them to dedicated functions.

  • Implement a separate Lua function file to build and populate the alarm from trap fields.

  • Register the rule files as resources in the SNMP trap module configuration.

  • Test the flow by sending a trap with snmptrap and verifying the alarm in the module logs.

🟒

Create an alarm from a DC 09 alarm

alarm

osp-alarms osp-web osp-ip-rct

In this tutorial, you will learn how to create an OnSphere alarm from a DC 09 alarm.

  • Create an action of type CREATE_ALARM that will be called when a matching DC09 event arrives.

  • Configure an IP-RCT server to receive forwarded alarms from the DC09 gateway.

  • Define an IP-RCT device matching a specific transmitter identifier.

  • Create a FIRE_AND_FORGET textual value with an alarm owner that matches NFA alarm codes and links to the action.

🟒

Create an alarm from a script

alarm script

osp-alarms osp-web osp-scripts

In this tutorial, you will learn how to create a script that periodically creates a health-check alarm and logs the result of the insertion.

  • Configure a detached script with a scheduled execution (every hour).

  • Write a JavaScript script that calls the alarms API to create an alarm.

  • Log the result of the alarm insertion using the OnSphere logging API.

🟒

Create an alarm with an output

alarm variable

osp-alarms osp-web osp-variables

In this tutorial, you will learn how to create an output that creates an alarm when a value change state.

  • Create a variable that acts as a boolean trigger for alarm creation.

  • Define an alarm output (output.alarms) that specifies the alarm properties.

  • Attach a callback to the trigger value so the output fires on each state change.

  • Display the trigger and the resulting alarms side by side on a dashboard.

🟒

Create an user and setup is access rights

user

osp-keycloak osp-web

This example shows how to create a user, assign them to a group, and restrict their access to specific dashboards using role-based access control. No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Create a Keycloak group and map it to OnSphere access rights using the rights module.

  • Create a user via the Keycloak admin console or the users.keycloak configuration file and assign them to the group.

  • Define per-dashboard access.rights files to restrict visibility to specific groups.

  • Verify that each user only sees the dashboards permitted for their group.

🟒

Define a collection

collection

osp-collections osp-web

This example shows how to define a basic collection using a schema.ospp file for the data structure and a schema.collections file for indexes, filters, and auto-increment.

  • Define the JSON Schema for a device collection with five typed properties.

  • Configure collection-level filters based on a status field in schema.ospp.

  • Set up indexes, filter queries, and auto-increment in schema.collections.

🟒

Define a dashboard with a BACnet Discovery widget

bacnet dashboard

osp-web osp-bacnet

This tutorial shows how to define a dashboard with a Discovery widget for BACnet devices. This tutorial only focuses on setting up the widget and therefore doesn’t explain how to configure a BACnet device.

  • Add a Discovery widget with type set to BACNET in the dashboard view.

  • Configure propertyForDisplay to control how device names appear in the list.

  • Use the device selector toolbar to pick existing BACnet devices or discover new ones via the add icon.

🟒

Display a WMS source as an image

map

osp-maps osp-web osp-variables

This example shows how to display a WMS (Web Map Service) raster source as an image layer inside an OnSphere map dashboard.

  • Configure a WMS layer using the shared layer files (layer.ospp, layer.maps, layer.web).

  • Declare geographic points with geo.maps and owner.variables to position them on the map.

  • Wire the dashboard to display the WMS image layer alongside the configured points.

🟒

Display alarm points on map

map alarm

osp-alarms osp-web osp-maps osp-variables osp-scripts

This example shows how to display alarm points on a map by linking alarm filters and aggregated values to geographic sites.

  • Create geo.maps files for each site and link them to alarm count and highest-severity values.

  • Configure a complete alarm layer using the three files layer.ospp, layer.maps, and layer.web.

  • Display the layer in a dashboard map widget.

  • Use alarm filters and owner.alarms to track per-site alarm counts and severity.

🟒

Display and interact with JSON in a dashboard

dashboard json alarm form

osp-web osp-alarms osp-variables

This tutorial shows how to render JSON in the front-end and how the shared JSON viewer is reused across a dashboard. It combines the four surfaces of the feature on a single dashboard: a Json widget, a JSON table render, a Json form component and a JSON menu output. It also binds a Json widget to a subscribed value to show live, escaped-JSON content.

  • Add a Json widget to display a JSON value, and update it at runtime from a menu (or a MenuAction prompt) through the setJson widget-context action.

  • Add a JSON render column to an alarm table to inspect a structured field in a modal.

  • Add a Json form component to display a bound property, with and without a scope.

  • Add a json menu output to open a JSON payload in a modal.

  • Bind a Json widget to a subscribed value whose escaped-JSON content is expanded automatically.

🟒

Display content as an iframe

dashboard

osp-web osp-analytics

In this tutorial, you will learn how to add an iframe to a dashboard.

  • Expose an internal service port (e.g. InfluxDB on port 8086) via module.service so the browser can load it.

  • Define a Webview widget in dashboard.view with the target URL as the iframe source.

  • Ensure browser settings allow mixed HTTPS/HTTP content when the iframe source is HTTP.

  • Push the configuration and refresh the dashboard to display the embedded interface.

🟒

Display icons points on map

map variable

osp-maps osp-web osp-variables osp-scripts

This example shows how to configure icons, in geo.maps, layers.ospp and dashboard.view files.

  • Declare an ICON layer with linked values and supported icon names in layer.ospp.

  • Configure static icons via icon-image and dynamic icons via icons with visibleExpression in geo.maps files.

  • Register icon assets through module.resources and reference them with icons and iconPriority in the dashboard view.

  • Display the result: icons appear on the map and switch dynamically based on live value states.

🟒

Display PDF from configuration in a PDFViewer widget

dashboard report

osp-web

This example shows how to use a PDF Viewer widget to display a PDF that is present in your stack configuration.

  • Declare the PDF file as a web module resource in module.resources to expose it to the frontend.

  • Reference the resource destination path as the widget content in dashboard.view.

  • Load the dashboard to verify that the PDF viewer widget displays the configured file.

🟒

Display standard points on map

map variable

osp-maps osp-web osp-variables osp-scripts

This example shows how to display standard geographic points on a map dashboard, with values linked to locations and a configurable layer.

  • Link values to geographic locations using geo.maps files owned by osp-maps.

  • Configure a complete layer with layer.maps, layer.ospp and layer.web files.

  • Display the map and its points in a dashboard using the map widget.

  • Use scripts and callbacks to control the state of each point’s associated value.

🟒

Dynamic colors

dashboard variable

osp-alarms osp-web osp-variables

In this example, you will see how you can bind colors to theme and references. At the end of the example, you will have an understanding on how to update colors based on theme and live value changes.

  • Declare dark and light color variants for alarm severities so colors adapt to the active theme.

  • Bind widget fontColor and backgroundColor directly to theme values (static per-theme color objects).

  • Bind widget colors to OnSphere value references so they update dynamically when the value changes.

  • Switch schematics based on the active theme using a dark/light schema object.

  • Use a form widget to update the referenced color values live from the dashboard.

🟒

Gmail provider

notification

osp-communications

This example explains how to configure Gmail as a notification provider using an application-specific password and TLS encryption.

  • Generate a Gmail application-specific password (requires two-step verification).

  • Configure the provider with SMTP/TLS settings and the application password.

  • Expose the provider connection status as a dashboard value.

🟒

Include Draw.io library on schematics

dashboard

osp-web

This example will show you how to share Draw.io asset for a Schematic.

  • Create a custom shape in app.diagrams.net and export it as a Draw.io library file.

  • Convert the exported XML to the MxGraph-compatible format required by OnSphere.

  • Load the library asset directly in the VS Code extension or via .vscode/settings.json.

  • Use the custom shape in any schematic widget like any built-in asset.

🟒

Insert audit logs from scripts

script user

osp-collections osp-scripts osp-variables osp-web

This example shows how to insert audit log entries from scripts running concurrently across two script modules.

  • Create a variable triggered from a dashboard widget and link it to two output.scripts callbacks.

  • Run two separate script modules in parallel to demonstrate concurrent audit log insertion.

  • Each script inserts 100 entries into the audit log file upon each trigger.

  • Observe interleaved execution in the audit log to confirm concurrent script behavior.

🟒

Keep previous value state

script variable

osp-scripts osp-collections osp-variables osp-web

This example shows how to detect value state changes by storing the previous value in a collection and comparing it to the current one in a callback script.

  • Create a collection to persist previous value states across script executions.

  • Write a reusable library module (valueStore.mjs) for getting and setting stored values.

  • Attach a callback to a value that triggers a script comparing the current value to the stored previous one.

  • Display both current and previous values on a dashboard using a collection table widget.

🟒

List and update a collection

collection dashboard

osp-web osp-collections

This tutorial shows how to create a Collection table to list and update the elements of a collection.

  • Define a schema.web file with column definitions to create a view for the collection.

  • Create a dashboard with a CollectionTable widget linked to a schema and a default filter.

  • Add a Form linked to the schema to enable creating and editing collection entries directly from the table.

🟒

Manage the maintenance state of alarms

alarm dashboard

osp-alarms osp-web osp-scripts osp-variables

In this example, we will present a way to manage the maintenance state of alarms.

  • Configure a manual enable/disable action with parameters for device, node or site scope.

  • Add an automatic disable action that scans expired maintenances and resets severity and journal.

  • Create a pre-insert hook to check active maintenance when a new alarm arrives.

  • Expose maintenance controls via a right-click menu on the alarm table.

🟒

Maps β€” Getting started

map getting-started

osp-web osp-maps osp-mongo

This guide walks through the minimum configuration needed to get a working map in OnSphere, then progressively adds the four supported layer types.

🟒

Offline map display standard points on map

map

osp-maps osp-web osp-variables

This example shows how to display standard geographic points on an offline map using a locally hosted Protomap (PMTiles) file.

  • Extract a PMTiles file from an existing Protomaps source using the pmtiles CLI with a bounding box.

  • Declare the PMTiles asset as a module.resources file and reference it via protomapSource in the dashboard.

  • Restrict user navigation to the offline map area using maxBounds and minZoom parameters.

  • Configure geographic points with geo.maps and owner.variables, then display them via a layer.

🟒

OnSphere Git configuration usage

template

OnSphere is a composition of multiple modules, a module being an autonomous software entity responsible for handling a specific task (Here, autonomous is used to describe the module’s capacity to run on its own. It does not mean it will be able to properly perform its task on its own though. e.g., the Alarms module creates alarms, it can run on its own but without any other module asking it to create Alarms from specific triggers, it won’t do much). No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Understand the benefits of using Git for OnSphere configuration: local copies, offline work and multi-user collaboration.

  • Use git log to track what changed, when, why and by whom in the configuration history.

  • Use git diff (with a GUI difftool) to quickly spot differences between any two configuration versions.

  • Use branches for specific use cases or project stages (production, quality, testing) and tags to mark known-good versions.

🟒

Read a BACnet value by polling

bacnet variable

osp-bacnet osp-web osp-variables

In this example you will learn how to communicate with a BACnet device and read data on it by polling the device.

  • Configure the BACnet module connection using module.bacnet and device.bacnet.

  • Read a BACnet object periodically using the SINGLE_POLLING mode in owner.bacnet.

  • Display the polled value on a dashboard using a value subscription widget.

🟒

Read a BACnet value by subscription

bacnet variable

osp-bacnet osp-web osp-variables

In this example you will learn how to communicate with a BACnet device and read data on it by subscription.

  • Configure the BACnet module connection using module.bacnet and device.bacnet.

  • Subscribe to change notifications using OBJECT_SUBSCRIPTION mode in owner.bacnet to receive updates pushed by the device.

  • Use SINGLE_SUBSCRIPTION as an alternative to receive updates only when PRESENT_VALUE or selected properties change.

  • Display the subscribed value on a dashboard using a value subscription widget.

🟒

Remove a group

user

osp-keycloak

This example explains how to remove a user group from OnSphere by editing the groups.keycloak configuration file. No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Open the groups.keycloak file and remove the target group entry.

  • Push the updated configuration to apply the deletion.

🟒

Remove a user

user

osp-keycloak

This example explains how to remove a user from OnSphere by updating the users.keycloak file and deleting the account from the Keycloak administration console. No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Remove the user entry from users.keycloak and push the configuration.

  • Log into the Keycloak administration console and permanently delete the user account from the Users tab.

🟒

Retrieve dashboard list

script dashboard

osp-scripts osp-variables osp-web

This tutorial demonstrates how to retrieve the list of all dashboards using a script and store it in a variable. The script will be executed every 10 seconds.

  • Write a detached script that calls the dashboard API and stores the result in a variable.

  • Define a text variable using value.ospp and owner.variables to hold the dashboard list.

  • Create two test dashboards (main and alternative) to verify the script output.

  • Display the retrieved dashboard IDs on a dashboard using the valueSubscriptions widget.

🟒

Search folders

dashboard

osp-web

This example shows how to use the dashboards folders in order to change the display behaviour of the dashboard search bar.

  • Configure dashboard folders using the folder property in dashboard.web files.

  • Organize dashboards in a hierarchy of nested folders.

  • Navigate through folder levels in the OnSphere search bar.

  • Control which folder a dashboard belongs to at creation time.

🟒

Setup a local Ant Media server connection and stream

media

osp-media osp-antmedia osp-web

This example shows how setup a local Ant Media server and show the connection status inside a value. It also shows how to setup a test stream in that will be declared in the Ant Media server.

  • Configure an Ant Media server connection using antmedia-server.media with URL, email and password.

  • Expose the server connection status through a value.ospp file.

  • Declare a video stream (camera, OBS, etc.) with stream.media, stream.web and stream.ospp files.

  • Expose stream state as a value and display the stream in a dashboard via mediaPlayerWidgetSettings.

🟒

Setup a Milestone server connection

milestone

osp-milestone

This example show how setup a milestone server and show the connection status inside a value.

  • Configure a Milestone server connection using milestone.server with URL, username and password.

  • Expose the server connection status through a value.ospp file.

🟒

Simple read/write on Modbus

modbus variable

osp-modbus

This example shows how to read and write Modbus coil registers by configuring a slave connection, an owner file, and an output file with a callback trigger.

  • Register a Modbus slave device using slave.modbus with IP address and read frequency.

  • Read coil register address 0 via owner.modbus and expose it as a value.ospp.

  • Write to the Modbus device using output.modbus.

  • Trigger the write automatically on value change using a callback.ospp with expression-based inversion.

🟒

Simple template variable usage

template variable

osp-web osp-variables

In this tutorial, the usage of template variables is described. The focus is done to understand the prevalence of usage and all the types of variables available.

  • Define a value that references a template via templateId and overrides variables locally.

  • Create a first-level template with its own templateVariables.

  • Chain a second-level template to provide variables to the root value.

  • Understand precedence rules: locally defined variables take priority over those inherited from templates.

🟒

State monitoring of external service via HTTP request

script

osp-scripts

This tutorial will guide you through creating a script that periodically checks whether an external HTTP service is available. The script runs every 5 seconds and reports the service’s status as a boolean value (true for available, false for unavailable).

  • Define a boolean value and link it to a script via owner.scripts.

  • Schedule the script to execute every 5 seconds using detached.scripts.

  • Send an HTTP GET request in JavaScript and set the value to true or false based on the response.

🟒

Supervision of modules

variable

osp-web osp-modbus

Each module sends information about its current configuration through the heartbeat, which is useful for remote configuration. This example shows how to retrieve the state, with the main use case being the monitoring of the remote module’s configuration.

  • Fetch the running configuration state of a module via dedicated value files.

  • Retrieve the version of a module using the same heartbeat mechanism.

  • Read the timestamp of the latest module restart.

  • Display supervision data on a dashboard using the object-browser widget.

🟒

Update variable from callback

variable

osp-scripts osp-variables

This example shows how to update a variable at regular intervals by executing a script through a callback and writing the result via an output.

  • Create a script value with owner.scripts to trigger a JS script on each value change.

  • Write a JavaScript function that generates a random number and returns it as the new value.

  • Declare an integer variable with owner.variables and a writable output.variables.

  • Wire the script result to the variable output using a callback.ospp.

🟒

Update variable from script

variable script

osp-scripts osp-variables

This example shows how to update a variable directly from a detached script that runs at a fixed interval.

  • Declare a detached script with detached.scripts to run a JS script every second using a cron expression.

  • Create an integer variable with owner.variables to store the result.

  • Write a JavaScript function that generates a random number and writes it directly to the variable.

🟒

Usage of variables files

template variable

osp-web osp-variables

This example explains how to define default values using variables.ospp files, including nested variable files and per-owner overrides.

  • Use a variables.ospp file to provide a default value to an owner via variablesFiles.

  • Override a variable locally inside the owner using templateVariables.

  • Chain a sub-variables file to supply additional variables from a nested variables.ospp.

🟒

Vault Configuration

script

osp-scripts osp-variables

This tutorial demonstrates how to create a script that leverages the Vault configuration functionality to retrieve data securely from the vault.

  • Declare a vault in vault.ospp containing secret entries identified by key.

  • Create a variable with owner.variables to store the retrieved secret at runtime.

  • Write a detached JS script that reads a vault entry by key and writes it to the variable every 10 seconds.

  • Verify the retrieved value in the variable or in the script logs.

🟒

Visualize current state of values

dashboard variable

osp-web osp-variables

This example shows how to display live value states in a dashboard using a Value subscription widget, useful for real-time debugging during integration.

  • Create a boolean variable with owner.variables to serve as a test value.

  • Add a Value subscription widget to a dashboard via the edit mode.

  • Bind the widget to one or more values and subscribe to their live state updates.

  • Toggle the variable directly from the widget to verify write and display behaviour.

🟒

Visualize Grafana charts in the OSP web interface

dashboard grafana

osp-web osp-analytics osp-grafana

This tutorial explains how to display Grafana dashboards and charts within the OSP web interface.

  • Configure the Grafana module and create a dashboard with charts inside Grafana.

  • Retrieve the Grafana dashboard URL from the browser address bar.

  • Embed the Grafana dashboard in an OSP dashboard using a Webview widget.

  • Use the kiosk and theme URL parameters to adapt the appearance to the OSP interface.

🟒

Visualize list of alarms

alarm dashboard

osp-alarms osp-web

This example shows how to create a dashboard with an alarm table widget to display and manage active alarms from a web browser.

  • Create a dashboard with dashboard.web and dashboard.view files.

  • Add an alarm table widget via the dashboard edit mode and configure it interactively.

  • Export the widget layout from the describe view and commit it to the configuration repository.

  • Push the updated dashboard.view to display the live alarm table in the browser.

🟒

Visualize queries data within charts

dashboard variable

osp-web osp-analytics osp-waveforms osp-variables osp-scripts

In this tutorial, the goal is to display data on charts from the InfluxDB database.

  • Generate fake boolean, decimal, integer and text values using waveforms and detached scripts.

  • Store values in InfluxDB via field.analytics, measure.analytics and output.analytics files.

  • Define analytics queries (query.analytics) to retrieve data for each chart type.

  • Add chart widgets to a dashboard and bind them to the configured queries.

🟒

Visualize reports

dashboard report

osp-alarms osp-web osp-reports

This example shows how to visualize existing reports on a dashboard.

  • Create a menu with download and open actions for CSV and PDF report types.

  • Add a ReportList widget to a dashboard, wired to the report menu.

  • Add a PDFViewer widget alongside the list to display the selected report.

  • Generate reports from an alarm table and observe the ReportList update automatically.

🟒

Visualize schema

dashboard

osp-web osp-variables

This example shows how to embed a draw.io schematic in a dashboard and bind its shapes dynamically to OnSphere values for real-time visual feedback.

  • Create boolean variables with owner.variables to represent the state of each interactive element.

  • Design a Draw.io schematic and use osp-text and osp-fill-color properties to bind shape appearance to value states.

  • Use osp-input-onclick with osp.send to toggle value states directly from schematic shapes.

  • Declare the schematic as a module.resources file and link it to a Schematic widget in the dashboard.

🟒

Webhook - Read values via GET

variable webhook

osp-web

This example shows how to expose a webhook endpoint that writes a value with POST, reads it back with GET, and resets it with DELETE β€” turning the endpoint into a small inbound REST resource.

  • Create a user with an API key assigned to the /internal/data-access group.

  • Define a webhook endpoint declaring POST, GET and DELETE in its methods.

  • Link a STEADY value to the endpoint with owner.webhook so it can be read back.

🟒

Display a WMTS source as a layer

map

osp-maps osp-web osp-variables

This example shows how to display a WMTS (Web Map Tile Service) source as a tile layer inside an OnSphere map dashboard.

  • Configure a WMTS tile layer using the shared layer files (layer.ospp, layer.maps, layer.web).

  • Declare geographic points with geo.maps and owner.variables to position them on the map.

  • Wire the dashboard to display the WMTS tile layer alongside the configured points.

🟒

Write a BACnet value

bacnet variable

osp-bacnet osp-web osp-variables

In this example you will learn how to communicate with a BACnet device and write data. It is recommended to first start by reading the following bacnet polling example, as some of the elements are also explained there.

  • Configure the BACnet device connection using module.bacnet and device.bacnet.

  • Define an output.bacnet targeting the BACnet object to write, and a callback.ospp to trigger it.

  • Read back the written value using SINGLE_POLLING in owner.bacnet to confirm the write.

  • Use a basic input/output value widget on a dashboard to increment or decrement the BACnet analog value.

🟑

Add a delete menu to a CollectionTable

collection dashboard script

osp-alarms osp-web osp-collections osp-scripts

This tutorial shows how to add a menu to delete one or multiple elements from a CollectionTable.

  • Create two menus (single right-click and multi-selection) that pass schema, document IDs, and username to a script.

  • Define a RUN_SCRIPT action and a detached JS script that calls collections.delete.

  • Link the delete menu to the CollectionTable via a view or collection menu reference.

🟑

Add rights to a form

form collection dashboard user

osp-web osp-collections

This tutorial shows how to add rights to a form in order to limit access to some of the ui elements of the form depending on the rights a user have.

  • Define per-element access levels (none, read, write) for different rights roles in a form.web file.

  • Enable collections users rights in the module configuration.

  • Use the form rights selector component to assign form rights to individual users.

  • Verify that form components are shown or hidden according to the logged-in user’s rights.

🟑

Alarm table filter update with alarm severity widget

alarm dashboard script

osp-alarms osp-web osp-scripts

The tutorial guides you through how alarm severity widget can be used to update alarm table filter.

  • Create four alarm filters (all, major-and-more, remote, technical) each with a count and max-severity value.

  • Link each AlarmSeverity widget to its corresponding count and severity values.

  • Configure the onClick handler on each widget to call osp.widgets(...).updateFilter(...) and update the AlarmTable filter.

  • Use a Form widget to generate test alarms and verify the interaction.

🟑

Alarms grouping

alarm

osp-alarms osp-web osp-variables

In this example, we will show you how to create alarm groups and use them.

  • Define static alarm groups using group.alarms files, with a fixed location via an INITIAL field generator.

  • Configure parent-child group relationships and hide empty groups using visibleIfNoChildren.

  • Write a Lua pre-insertion rule to automatically assign new alarms to the correct group based on their location.

  • Block the EDIT_LOCATION action on groups using actionConfigurations with ON_NOBODY.

🟑

API service for http request

script

osp-scripts

This tutorial will guide you through creating a script that use the API service to get data from an external API.

  • Define an API service in api-service.ospp with the target hostname and allowed modules.

  • Declare an endpoint in api-endpoint.ospp with path, HTTP method and default query parameters.

  • Write a detached JavaScript script that calls the endpoint with default and overridden parameters.

  • Observe the full request URL and response body in the module logs.

🟑

Collection table for deleted entries with restore menu

collection dashboard script

osp-web osp-collections osp-scripts

In this tutorial, we will define a filter to display deleted entries from a collection and add a menu to restore them.

  • Define two filters in schema.collections: one with scope ONLY_ACTIVE and one with scope ONLY_INACTIVE to separate live from deleted entries.

  • Create a delete menu with a condition checking the current table filter (ONLY_ACTIVE) and a script using collections.delete.

  • Create a restore menu with a condition checking the current table filter (ONLY_INACTIVE) and a script using collections.restore.

  • Link both menus to the same CollectionTable dashboard.

🟑

Contacts management with a collection

notification collection

osp-communications osp-collections osp-web osp-scripts

This example shows how to manage communication contacts dynamically using a collection, allowing notifications to be sent to multiple people or groups.

  • Define a collection schema storing contact fields (name, enterprise, number, email) with static group filters.

  • Configure collection filters to target a sub-set of contacts per notification.

  • Create a dashboard view with a form to add and edit contacts at runtime.

  • Use collection filters (group_dev, group_tech) to send notifications to specific groups.

🟑

Control a camera with PTZ

media variable dashboard

osp-video osp-web osp-variables osp-onvif

This example shows how to control a PTZ camera from a dashboard by combining an ONVIF camera configuration, a video stream, and a value that sends movement commands.

  • Configure an RTSP video stream and expose it as a value.

  • Register an ONVIF-compatible camera and create a PTZ movement output.

  • Create a variable with a callback that triggers the movement output on value change.

  • Optionally expose the current camera position as a separate value.

  • Display the video stream and PTZ controls together on a dashboard.

🟑

Create alarm from map context menu

alarm map dashboard script

osp-alarms osp-web osp-maps osp-variables osp-scripts

This example adds a Create alarm here action in the map context menu. The menu reads longitude and latitude from the click event, opens a form to edit alarm properties, then executes maps.actions.run_script with script.create_alarm.

🟑

Create alarm with a form using action component

alarm form collection

osp-alarms osp-web osp-collections

In this tutorial, we will create a collection with a form that will allow us to create an alarm from this form using an action form component.

  • Define a collection schema with the alarm properties (serial, summary, source, severity, location, tags, additionalData).

  • Build a form referencing the collection with one field per property and an Action component to trigger alarm creation.

  • Use form.<field> expressions inside the action inputs to pass form values to the alarm.

  • Add a dashboard combining the collection table and an alarm table to verify that created alarms appear.

🟑

Create alarms with lookup

snmp alarm

osp-snmp-trap osp-alarms

This example shows how to generate alarms from SNMP traps by mapping trap fields to alarm properties using CSV lookup files.

  • Write Lua parsing rules that use lookup calls to resolve trap OID fields to alarm property values.

  • Register both the rule files and the CSV lookup files as module resources in the SNMP trap configuration.

  • Test the lookup resolution by sending a trap and reading the mapped alarm fields in the module logs.

🟑

Create an alarm with Value error handler

alarm script variable

osp-alarms osp-web osp-scripts osp-variables

In this tutorial, you will learn how to use the Value error handler to automatically create an alarm whenever a value enters an error state.

  • Create a trigger variable that calls a script via a callback.

  • Write a script that throws an exception to publish an error on the target value.

  • Configure the alarm module error handler so that any value error automatically creates an alarm using the value ID as serial and the error message as summary.

  • Display the trigger and the resulting alarm on a dashboard to validate the behavior.

🟑

Create dynamic actions in menus

alarm dashboard

osp-alarms osp-web osp-network-monitoring

The tutorial guides you through the creation and utilization of menus to define action menu for the alarm table. Within the web module, the root/alarms directory is automatically established, including an initial menu. The steps include integrating this menu into an existing alarm table and introducing a new one.

  • Reference the default auto-generated menu via menuReferences in the alarm table configuration.

  • Add a custom menu entry (e.g., Ping) with a condition restricting it to single-row selection.

  • Pass alarm data to an action using the input field with extract and as parameters.

🟑

Create menu for an Alarm History Table sub-table

alarm dashboard

osp-alarms osp-web

In this example, we will see how to define menus used only by a Alarm History Table widget sub-table, and how to define interactions between the main and the sub table.

  • Configure the alarm history table with defaultHierarchy set to grouped and shareFiltersBetweenTables disabled.

  • Use a menu condition that checks for groupAlarmId to restrict it to the sub-table context only.

  • Use an evaluate operation in the menu to copy filters from the main table to the sub-table.

🟑

Create menu with form prompt as inputs and outputs

alarm dashboard form script collection

osp-alarms osp-web osp-scripts osp-collections osp-network-monitoring

The tutorial guides you through the creation and utilization of menus that show you the different usages of forms prompts. This tutorial assumes you are already familiar with the concepts of dashboards, alarms table widgets and menus. This tutorial will focus on the creation of different menus, showcasing forms prompts. if you are not familiar with some of these concepts, you can follow this other example first.

  • Use a form prompt input to let the user fill a form that auto-creates a collection entry (formSave: true).

  • Pre-populate the prompt form with alarm data (location, summary) using the data field of the menu.

  • Use collectionId in a prompt to open and edit an existing collection entry directly from a menu.

  • Use a form prompt output to display an auto-generated report to the user after a script runs.

🟑

Customize the input and table of a form journal component

form collection dashboard

osp-web osp-collections

This tutorial shows how to customize the journal component in a form in order to add fields to a journal entry.

  • Create a Category collection to provide selectable values for journal entries.

  • Define a standalone journal input form with custom fields (timestamp, text, category).

  • Configure the Journal collection with a JOURNAL render column using journalSettingsOverride.

  • Use a Collection Table widget to interact with the customized journal form on a dashboard.

🟑

Define a collection owner

collection script

osp-scripts osp-collections

This example shows how to link a collection to a value via a collection owner, so that each update automatically pushes the changed document into the value and triggers a callback script.

  • Create a TEXT value to receive the content of an updated collection document.

  • Define an owner.collections with schemaId and filterId to watch specific documents.

  • Write a JS script that reacts when the linked value is updated.

  • Connect the value and the script via a callback.ospp.

🟑

Define a collection owner with a specific target

collection script

osp-scripts osp-collections

This example shows how to use the targetProperty of a collection owner to extract a specific field from the updated document instead of the whole record.

  • Set scope to FULL_DOCUMENT when using the targetProperty attribute.

  • Use watchList to monitor specific document properties independently from the extracted field.

  • Set targetProperty with a JSON path to store only a sub-field of the document in the value.

  • Trigger a callback script with the extracted field value on each relevant document update.

🟑

Define alarms silencing rules with collections

alarm collection script

osp-alarms osp-web osp-collections osp-scripts

In this tutorial, we will go through every necessary step to set up a silencing process for any upcoming alarm.

  • Define a collection schema with filter, hideFrom and hideUntil fields to represent silencing rules.

  • Use a pre-insertion Lua script to match incoming alarms against active rules and set their hideUntil value.

  • React to rule changes via a collection owner that triggers a JS script and re-evaluates current alarms.

  • Build a dashboard combining a CollectionTable (to manage rules) and an alarm table (to observe silenced alarms).

🟑

Define grouping menu to interact with groups from an alarm table

alarm dashboard

osp-alarms osp-web

This example aims to display how you could use the grouping actions with an Alarm Table in order to interact with alarms groups.

  • Define four grouping menu entries: CREATE_GROUP_ALARMS, REMOVE_GROUP_ALARMS, JOIN_GROUP_ALARMS, and LEAVE_GROUP_ALARMS.

  • Use prompts in menu actions to let the user name or select groups interactively.

  • Create a custom view with a BOOLEAN column linked to the children field to visually distinguish groups from simple alarms.

  • Configure the alarm table with defaultHierarchy: grouped to display alarm groups.

🟑

Display collection-backed layers on map

map collection

osp-maps osp-web osp-collections osp-scripts

This example uses one collection schema as the source of truth for map items. The STANDARD layer displays all visible points from the collection, while the ICON layer reuses the same documents and adds icon rules based on the category field.

  • Define a collection schema with a nested GeoJSON object at map.geometry for geographic coordinates.

  • Configure a STANDARD layer and an ICON layer both sourced from the same collection via collectionSource.

  • Share the same visible_only filter between the map layers and the CollectionTable widget.

  • Handle live map updates: collection create, update, and delete operations push to the same websocket stream without any widget-specific refresh.

🟑

Display floor-filtered mixed map sources

map

osp-alarms osp-web osp-maps osp-collections osp-scripts

This example combines four map data sources behind one shared floor picker: a WMTS tile layer, a collection-backed icon layer, a live alarm layer, and a static owner-backed point.

  • Configure a shared Floor selector parameter in the map widget and bind each layer with floorPropertyPath.

  • Store the floor field in a collection schema and create a form to place entries on specific floors.

  • Expose additionalData.geometry and additionalData.floor on an alarm view so the alarm layer can filter by floor.

  • Declare a static GeoJSON point with a properties.floor field so the floor selector can hide it on other levels.

  • Validate that each layer (WMTS, collections, alarms, static point) independently responds to the shared floor picker.

🟑

Display offline live alarm layers on map

map alarm script

osp-alarms osp-web osp-maps osp-scripts osp-variables

This example keeps the map offline with MapLibre and a Protomaps archive, while the displayed features are streamed live from osp-alarms. The geometry is read from additionalData.geometry and icon selection is driven by additionalData.markerType.

  • Reuse PMTiles and icon assets from the offline maps example via module.resources.

  • Declare SEVERITY and ICON alarm-backed layers with alarm views and configurable filters.

  • Create alarms from a map click or from the alarm table toolbar using a JavaScript script and a form prompt.

  • Switch between alarm filters (all / critical only) to confirm that both map layers update in real time.

🟑

Display PDF from a menu of an AlarmTable

alarm dashboard report

osp-alarms osp-web

This example shows how to define a menu in order to show a PDF file from the configuration on an interaction with an alarm table.

  • Declare the PDF as a web module resource and note its destination path.

  • Create a menu using a preview output that opens the PDF in a modal dialog.

  • Add the menu to an alarm table widget in the dashboard.

  • Right-click an alarm row to trigger the menu and verify the PDF is displayed.

🟑

Execute remote command (SSH)

script

osp-scripts

This example shows how to run commands on a remote host from an OnSphere script using SSH with PEM-format key authentication.

  • Create a detached script scheduled to run every 30 seconds.

  • Write a JavaScript script that opens an SSH connection and executes a command on the remote host.

  • Generate an RSA key pair in PEM format and register both files as module resources.

  • Deploy the public key to the remote host’s authorized_keys file to enable key-based authentication.

🟑

File and directory templating with Inventory as Variable

template composer

osp-web

This example illustrates several key aspects of the templating system Templating Generation:

🟑

Force journal entry on alarm menu actions

alarm dashboard script

osp-alarms osp-web osp-scripts

Alarms menu actions allow interactions with alarms from the user interface (especially from an alarm table or alarm history table widget). Default actions allow for example to change an alarm severity or to acknowledge it.

  • Create a RUN_SCRIPT action that replaces the default Acknowledge menu entry.

  • Write a detached script that reads the alarm IDs and journal message passed by the menu.

  • Add a message prompt in the menu configuration so the user must enter a justification before the script runs.

  • Pass the current user identity to the script so the journal entry records who performed the action.

  • Call alarms.acknowledge and alarms.addJournalEntry from the script to combine both operations atomically.

🟑

Generate reports from AlarmTable

alarm dashboard report

osp-alarms osp-web osp-reports

This example shows how to generate PDF and CSV reports from alarm data using FreeMarker templates and action menus on an alarm table widget.

  • Create FreeMarker (FTL) templates for both CSV and PDF output formats, including asset and font handling.

  • Define report entity files (template.reports) linking each FTL template to the reports module.

  • Set up generate and download actions, then attach them to an alarm table via menus.

  • Pass alarm data and date filter context to the template through the menu input configuration.

🟑

Generate reports with Grafana charts

dashboard report grafana

osp-web osp-analytics osp-grafana osp-reports osp-scripts osp-variables

This tutorial provides instructions on how to generate reports using Grafana charts and display them within the OSP web interface.

  • Use a value with a callback and a JavaScript script to trigger Grafana chart report generation via a service token.

  • Configure GRAFANA_SERVICE_TOKEN_TOKEN and GRAFANA_CHART_RELATIVE_URL constants in the script.

  • Expose the Grafana dashboard through a Webview widget and add a ReportsViewer widget for download.

  • Add a menu action to allow users to download generated reports from the OSP interface.

🟑

Insert users from Keycloak into collections rights

script collection user

osp-scripts osp-collections

This tutorial shows how to use a JS script to fetch the list of OnSphere users and create an entry for each of them inside the collections rights collection. At the same time, we will create a profile (collections rights level 2) for each user group.

  • Enable users and profiles levels in the collections rights configuration.

  • Use users.list() to retrieve all Keycloak users and check for existing entries with collections.getWithCustomFilter().

  • Automatically create profile entries per user group and insert missing user rights with collections.insert().

  • Run the script on a recurring schedule to keep collections rights in sync with Keycloak users.

🟑

Inventory with Rules

template composer

osp-web

This example highlights several key capabilities of the configuration generation system Templating Generation:

Playbook definition β†’ associated documentation
Use of CSV inventory data β†’ associated documentation
Rule-based logic and branching β†’ specific rules
Conditional behavior β†’ Condition

🟑

Lay out and drive a basic I/O widget

dashboard variable menu

osp-web osp-variables

This tutorial covers how a basic I/O widget is arranged and how it is driven once displayed. The dashboard reads the same three values through a dozen tiles, so each parameter can be compared side by side.

  • Decide how the parts share the widget with layoutDirection.

  • Decide which parts a widget displays, and in which order, with layout.

  • Change the label, the icon, the parts, the direction and the value of a widget while it is displayed, through its widget context.

  • Drive that context from the onClick handler of another widget and from a menu.

🟑

Managing rights from collections

user collection script

osp-web osp-collections osp-cli osp-variables

This example illustrates how to implement rights management on the frontend, enabling direct user rights management. This can be easily achieved by using a Collections along with the Enrich keycloak token.

  • Define custom rights (rights-management, dynamic-access) in module.rights and assign them to Keycloak groups and users.

  • Store per-user dynamic rights in a dedicated collection accessible only to the supervisor role.

  • Write a Keycloak authorization script that reads the collection at login time and injects rights into the token.

  • Verify that dashboards become accessible or hidden based on the rights dynamically assigned from the collection.

🟑

Map context usage

map variable

osp-maps osp-web osp-variables osp-scripts

This example shows how to use the Map widget context from menus to interact with other widgets on the same dashboard.

  • Reference a specific map widget by name inside a menu configuration.

  • Use the map context to trigger actions targeting other dashboard widgets (e.g. an alarm table).

  • Combine a Maps widget and an AlarmTable widget inside a BoxLayout dashboard.

🟑

Outlook OAuth2 provider

notification

osp-communications

This example explains how to configure Outlook as a notification provider using OAuth2 authentication via an Azure application registration.

  • Register a new application in the Azure portal and save the client ID and tenant ID.

  • Grant the required API permissions (Mail.ReadWrite, Mail.Send, SMTP.Send) and have them validated by an admin.

  • Create app roles for each permission in the Azure application.

  • Configure the OnSphere OAuth2 provider with the tenant, client ID and credentials.

🟑

Process a BACnet event

bacnet alarm

osp-alarms osp-web osp-bacnet osp-variables osp-scripts

In this example you will learn how to subscribe to the event of a BACnet device. It is recommended to first start by reading the Notifications subscription.

  • Configure a BACnet device connection using device.bacnet.

  • Control a BACnet analog value via output.bacnet and a callback to trigger notifications.

  • Define a notification.bacnet listener that maps BACnet event states (fault, off-normal, normal) to alarm severities.

  • Generate and clear alarms automatically via a linked JS script when notifications arrive.

🟑

Save and apply filters on an web-alarm-table

alarm dashboard collections scripts

osp-alarms osp-web osp-scripts osp-collections

This example aims to demonstrate how you could use a collection to store the current filters of an Alarm Table in order to allow the user to use them to quickly filter a table. This could be useful if you have users that tend to redo the same filters on a table everyday. In this example, every filter saved in the collection is available for every user of the platform, but you could expand on this by using collections rights to limit the access of each user to only the ones they created or by any other condition.

🟑

Send actions to chart with a Toolbar widget

dashboard variable script

osp-web osp-analytics osp-waveforms

This example shows how to use a Toolbar widget to broadcast filter or zoom actions to subscribed chart widgets in a dashboard.

  • Start from an existing charts dashboard (see the visualize_charts example).

  • Add a Toolbar widget and subscribe chart widgets to it using widgetSubscriptions.

  • Use a BoxLayout to minimize the Toolbar height without affecting its communication role.

  • Verify that filter changes on the Toolbar are reflected in real time on all subscribed charts.

🟑

Send email notification with attachments

notification report

osp-communications osp-reports osp-analytics osp-waveforms osp-scripts

This example aims at showing you how to add attachments for a email notification triggered from a script.

  • Create a report generator using a FreeMarker template and an analytics query to produce a CSV file.

  • Generate the report from a script using reports.generate with the generator ID.

  • Transform the generated report into the expected attachment structure for the notification API.

  • Send the email notification with the attachment from the same script.

🟑

Setup your configuration to gain access to collections rights

collection script user

osp-collections osp-scripts osp-web

The goal of this example is to define and display how to interact with collection rights (not to be confused with rights from the module osp-rights). Collection rights are rights defined on collections that allow to fine tune who has access to which values and what operations, on a per-collection basis.

  • Enable collection rights in module.collections by setting the three rights flags to true.

  • Define a USERS_RIGHTS collection and a PROFILES_RIGHTS collection with their respective schemas.

  • Create CollectionTable dashboards with Forms to manage profiles, users, and services.

  • Set up a services collection of type SERVICES with enter/leave menu actions backed by scripts.

🟑

Shared parameters for WMS and WMTS sources

map

osp-maps osp-web osp-variables

This example covers the configuration parameters shared by both WMS and WMTS sources, such as offline tile assets, layer definitions and dashboard wiring.

  • Declare offline tile assets (PMTiles) used by both WMS and WMTS map dashboards.

  • Configure layer files (layer.ospp, layer.maps, layer.web) shared across source types.

  • Link geographic points via geo.maps and owner.variables to their respective values.

  • Wire the dashboard to load assets and display the configured layers.

🟑

Show a Collection table with data from multiple collections

collection dashboard

osp-web osp-collections

This tutorial shows how to add a Collection table that displays one or multiple elements from multiple collections.

  • Create two separate collections (company and person) with shared views and filters, plus collection-specific ones.

  • Use allowNullColumns: true on a shared view that references properties not present in all collections.

  • Enable multiple: true on the CollectionTable widget and set multiple schemas as the default.

  • Only views and filters present in all listed collections are exposed in the table interface.

🟑

Synchronize user with LDAP

user

osp-keycloak

This example explains how to configure LDAP user federation in OnSphere with certificate support and automatic synchronization. No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Add the LDAP certificate (self-signed or CA-signed) to the Keycloak module configuration.

  • Configure the LDAP provider via the Keycloak administration console or the federations.keycloak file.

  • Enable automatic user synchronization using the Sync Settings options.

  • Map LDAP attributes to Keycloak user fields and configure group mappers for rights management.

🟑

Usage of a template to create an hysteresis

template variable

osp-alarms osp-web osp-variables

This example tackles the problem of creating a hysteresis using OnSphere to prevent alarm flooding when a value oscillates around a trigger threshold.

  • Define the hysteresis logic in a reusable callback.ospp.template with configurable threshold and delta variables.

  • Declare per-aisle temperature thresholds using owner.variables files.

  • Set a shared delta value that controls the hysteresis band for all aisles.

  • Instantiate the template for each aisle (hot/cold) by binding the required variables in the callback.ospp.

🟑

Use menus to upload file as attachments on alarms

alarm dashboard script

osp-alarms osp-web osp-storage osp-scripts

This example aims to demonstrate how you could use a combination of menus and scripts to upload and attach files into an alarm.

  • Define an upload.ospp to restrict accepted file types (e.g., image/png).

  • Create an upload menu that uses an upload prompt and passes the resulting file identifiers to a script that patches the alarm’s additionalData.

  • Define a visualize menu that uses the attachments output to open a preview modal.

  • Add an ATTACHMENT column in a view definition to display attachments directly in the alarm table.

🟑

Video streaming with control value

media variable

osp-video osp-scripts osp-alarms osp-web

This example shows how to enable or disable a video stream from a dashboard using a boolean variable read by a script through a lookup file.

  • Write a script that reads a lookup file every 5 seconds and publishes a boolean control value.

  • Configure a video controller that binds an RTSP stream URL to the boolean control value.

  • Display the controlled video stream on a dashboard β€” the stream only appears when the lookup value is enabled.

  • Simulate external control by writing the lookup file directly inside the scripts container.

🟑

Webhook - Call a script

variable script webhook

osp-web osp-scripts

This example shows how to expose a webhook endpoint that delegates the request to a run-script action and lets the script build the HTTP response.

  • Create a user with an API key assigned to the /internal/data-access group.

  • Define a webhook endpoint declaring its HTTP verbs in methods, each with an optional linkedAction.

  • Read the request with webhook.parseArgs(trigger.parameters) (.method(), .body(), .json(), …).

  • Build the HTTP response with request.respond(code, content, contentType).

🟑

Webhook - Set value

variable webhook

osp-web osp-cli

This example shows how to create a webhook endpoint secured with an API key that receives HTTP POST requests and maps their payload to OnSphere values.

  • Create a user with an API key assigned to the /internal/data-access group.

  • Define webhook endpoints that accept HTTP POST requests and forward the payload.

  • Map endpoint payload fields to OnSphere values of different types (boolean, numeric, decimal, JSON).

  • Extract nested JSON fields from the request body and expose them as typed values.

πŸ”΄

Configure SSO with SAML

user

osp-keycloak

This example explains how to configure OnSphere to delegate authentication to a SAML server, supporting both self-signed and externally-issued certificates. No downloadable configuration example is provided for this page β€” follow the steps below manually.

  • Add the SAML identity provider certificate to the Keycloak configuration (self-signed or externally-issued).

  • Configure the SAML identity provider via the Keycloak admin console or the identityProviders.keycloak file.

  • Map SAML user attributes (email, username, name) using Keycloak protocol mappers.

  • Export the final configuration from Keycloak and integrate it into the OnSphere configuration files.

πŸ”΄

Create alarms from snmp v3 trap authenticated by specific User

snmp alarm user

osp-snmp-trap osp-alarms

In this tutorial, you will learn how to configure SNMPv3 trap authentication using USM and generate alarms only for traps authenticated by a specific user.

  • Enable SNMPv3 support by setting an engineId in module.snmp-trap.

  • Declare multiple User Security Models (USMs) with different security names and authentication parameters.

  • Modify the default Lua function to discard traps that are not authenticated or do not match the expected USM security name.

  • Verify the filtering behaviour by sending test traps at various security levels (v2c, unauthenticated v3, wrong USM, correct USM).

πŸ”΄

Interaction on streams using callbacks on a Media widget

media script

osp-media osp-antmedia osp-web osp-variables

This example has for goal to show the possibilities of interaction between output.media, the stream-selector.media and the Media widget.

  • Connect to an Ant Media server via antmedia-server.media and declare multiple streams with stream.media.

  • Configure a stream selector as the default stream source for the media widget in the dashboard.

  • Use output.media actions to add or remove a stream from a selector, and to start or stop a stream.

  • Trigger each action via variables and callbacks to control streams interactively from the dashboard.

πŸ”΄

Managing rights from HTTP rest api

user

osp-web osp-cli osp-variables

This example demonstrates how to implement rights management using an external service, such as a REST API. This is useful when Keycloak does not receive the rights from the SSO flow or needs to access another API. This can be achieved by utilizing the Enrich keycloak token and configuring a script.

  • Define a dynamic-access right in module.rights and create test users in Keycloak.

  • Simulate an external rights API using a minimal Python Flask service.

  • Write a Keycloak authorization script that calls the external API at login and merges returned rights into the token.

  • Confirm that dashboard visibility changes according to the rights provided by the external API.

πŸ”΄

Use a script to handle services schedules error

collection script alarm

osp-alarms osp-web osp-collections osp-scripts

The goal of this example is to create a script which goal is to look at all mandatory services and verify that they are in a valid state according to the schedules and active users of the service.

  • Define a detached script with a scheduled execution to periodically validate all mandatory services.

  • Paginate over service entries using page size and page number to handle large collections.

  • Check if the current day and time match a service schedule and detect two error states: active users outside schedule, and empty service during a scheduled slot.

  • Generate alarms for each detected violation.