Inserting Values in Messages, HTTP requests and Paths - icom OS Routers

Prev Next

Status information, event-dependent information as well as all parameters of the configuration can be inserted as variables in SMS and e-mail message text as well as the subject line of an e-mail message. Event-dependent information can only be used by the event that has triggered the message. It is also possible to include values into the path for the download list on an auto-update server.

Inserting values in messages and HTTP requests

The expression for the variable is replaced with the return of a CLI command or a REST request. While the CLI expression can be used to insert the returns of all CLI commands into the text, the REST request can only be used to insert the returns of status endpoints. The following restrictions apply to the respective message types:

CLI command

REST request

SMS message text

check green

minus

E-mail subject

check green

minus

E-mail message text

check green

check green

HTTP request end point

check green

minus

HTTP request body

check green

check green

Example for a message text that outputs the current system time of the router in a message:
The current system time is $cli(status.sysdetail.system.date).

Example for a message text that uses event-dependent information in a message to output user, time and location of a login:
The user $cli(events.info[username]) logged in at $cli(administration.time.time) on location $cli(administration.hostnames.location).
For this, the message must be triggered by an event Authentication attempt has been registered - succeeded within an action.

Example for a message text that uses nested event-dependent information in a message to output the event that occurred:
The event $cli(events.event_config.event[$cli(events.info[event_id])].description) has occurred.
Here, the ID of the requested event will be inserted in the request of the event description using the event-dependent information $cli(events.info[event_id]).

If the expression $rest(/status/sysdetail/system) is inserted in a message text for example, the following return will be inserted at the position of the expression:

{
 "status": {
  "unique": {
   "location": "Regensburg",
   "date": "2025-02-27 11:32:30",
   "uptime": "21 min 1 s",
   "load": "3.30 2.95 1.96",
   "ram": "30964 kByte free",
   "hash": "2C637FC2",
   "mac": "00:05:B6:06:82:61",
   "remote_management": "inactive",
   "remote_management_uptime": "",
   "time_status": "manually_set",
   "signature_required": "inactive",
   "device_virgin": "0",
   "profile_mode": "permanent",
   "flash_mode": "SLC",
   "flash_status": "OK",
   "hostname": "insys",
   "classic_ui_active": "1",
   "device_note": "",
   "minimum_fw_version": "6.9",
   "boots_since_production": "2406",
   "boots_since_reset": "1",
   "operating_hours": "735h:45m",
   "online_count_since_production": "1056",
   "online_count_since_reset": "0",
   "online_count_since_boot": "0",
   "last_online_time": "never"
  }
 }
}

Inserting values in paths

Example for using the serial number of the router to generate a device-specific path on the auto-update server:

/updates/$cli(status.device_info.slot[1].serial_number)/list.txt

In this case, the resulting path would be: /updates/12345678/list.txt (assumed the serial number is 12345678)