You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implemented pending_commands table and associated functionality
added "Delete All" button to table editor pages
fixed bug where log and events table is not properly cleaned
fixed bug where the frontend gui could not handle trend mappings to servers that don't exist
@@ -54,6 +56,8 @@ When this WebCTRL add-on is installed and configured, it periodically communicat
54
56
- Add-ons that are not white or blacklisted remain unaltered
55
57
- Manage the PostgreSQL database from the add-on's main page on any connected server
56
58
- Only whitelisted operators are permitted to manage the database
59
+
- Remotely push out commands for servers to execute during their next sync
60
+
- Among other things, this function can be used for automated bulk installation of WebCTRL patches
57
61
- Import or export a JSON document containing local operators
58
62
- Optionally collect data from specific WebCTRL trends
59
63
@@ -162,9 +166,9 @@ In addition to the SFTP connection settings shown in the previous section, there
162
166
| Setting | Example | Description |
163
167
| - | - | - |
164
168
|`debug`|`false`| When enabled, log messages will be more verbose. |
165
-
|`log_expiration`|`14`| Specifies how many days to retain log messages in the database. |
169
+
|`log_expiration`|`60`| Specifies how many days to retain log messages in the database. |
166
170
|`auto_update`|`true`| Specifies whether to attempt automatic updates for this add-on. |
167
-
|`version`|`0.5.8`| When `auto_update` is enabled, any connected client whose add-on version is less than this value will be updated. |
171
+
|`version`|`0.5.9.1`| When `auto_update` is enabled, any connected client whose add-on version is less than this value will be updated. |
168
172
|`download_path`|`/webctrl/addons/PostgreSQL_Connect.addon`| When `auto_update` is enabled, this is the SFTP server path where the latest version add-on file will be retrieved. |
169
173
|`license_directory`|`/webctrl/licenses`| Specifies an SFTP server directory path for where to store WebCTRL license files. |
170
174
|`ftp_host`|`postgresql.domain.com`| SFTP server hostname or IP address. |
@@ -195,7 +199,7 @@ This page lists all connected servers. If a server is decomissioned or permanent
195
199
| ID |`1`| Internal ID which uniquely identifies the server within the PostgreSQL database. (Read-only) |
196
200
| Name |`ACES Main Building`| User-friendly display name for the server. This defaults to the display name of the root of the Geo tree. |
197
201
| WebCTRL Version |`8.5.002.20230323-123687`| Full version of the WebCTRL server. (Read-only) |
198
-
| Add-On Version |`0.5.8`| Installed version of the PostgreSQL_Connect add-on. (Read-only) |
202
+
| Add-On Version |`0.5.9.1`| Installed version of the PostgreSQL_Connect add-on. (Read-only) |
199
203
| IP Address |`123.45.67.89`| External IP address of the server as viewed by the PostgreSQL database. (Read-only) |
200
204
| Last Sync |`2024-12-02 14:05:32`| Timestamp of the last successful synchronization. If synced within the last 24 hours, the background color is green; otherwise, the background is red. (Read-only) |
201
205
| License |`WebCTRL Premium`| Click this field to download WebCTRL's license. (Read-only) |
@@ -269,6 +273,73 @@ Exceptions entered into this table through the add-on's configuration pages affe
269
273
| - | - | - |
270
274
| Username |`aces`| Specifies a blacklisted username which should be allowed to exist on this WebCTRL server. |
271
275
276
+
### Pending Commands
277
+
278
+
Commands entered into this table are executed on servers during their next sync interval.
279
+
280
+
| Column | Example | Description |
281
+
| - | - | - |
282
+
| Command ID |`4`| Unique identifier for this command. (Read-only) |
283
+
| Server ID |`2`| Unique identifier for the WebCTRL server. You can retrieve the current server's ID from the add-on's main page. |
284
+
| Server Name |`ACES Main`| User-friendly name of the WebCTRL server. (Read-only) |
285
+
| Ordering |`3`| When there are multiple command entries for a single server, this column specifies the ascending order in which commands are executed. |
286
+
| Command |`notify "Hello!"`| The command(s) to execute. Multiple commands can be separated by newlines for fail-fast semantics. |
287
+
288
+
Commands chained together using new-lines in a single entry are fail-fast, which means that execution is terminated immediately when an error is encountered. However, errors in one command entry do not affect other entries. Generally, commands are case-insensitive. Commands are tokenized using whitespace as delimiters. Double quotes can be used if a token must include whitespace. The caret character `^` can be used as an escape character. The local file path are specified, paths starting with `/` or `\` are treated as relative to WebCTRL's installation directory, and paths starting with `./` or `.\` are treated as relative to WebCTRL's active system directory. The two dots in `a/../b` go to the parent folder of `a`, so that `b` would be a sibling folder of `a`. Single-line comments are supported when a line is starts with `//`. The following commands are supported.
289
+
290
+
| Command | Description |
291
+
| - | - |
292
+
|`duplicate [id1,id2,...]`| When a new pending command is created, and `duplicate` is on the first line, the command is copied to all servers with the specified IDs. If no server IDs are specified, then the command is copied to all servers. You can use `%ID%` anywhere in the command after the `duplicate` statement, and it will be replaced with the server ID of each server the command is copied to. |
293
+
|`log <message>`| Writes a message to the add-on's log file. |
294
+
|`notify <message>`| Functions identically to the `notify` manual command. Logged in operators get a popup message in their web browsers. |
295
+
|`sleep <milliseconds>`| Sleeps for the specified number of milliseconds. |
296
+
|`reboot`| Functions identically to the `rebootserver` manual command. The WebCTRL server reboots. |
297
+
|`set <key> <value>`| Sets an add-on connection parameter to the specified value. These parameters can all be changed on the add-on's main page on each server, but this command allows remotely editing connection parameters in bulk. The following keys are supported: `connectionURL`, `username`, `password`, `keystorePassword`, `maxRandomOffset`, `cronSync`. |
298
+
|`mkdir <folder_path>`| Creates a new directory on the local file system of the WebCTRL server. |
299
+
|`rmdir <folder_path>`| Deletes a directory and contents on the local file system of the WebCTRL server. |
300
+
|`rm <file_path>`| Deletes a file on the local file system of the WebCTRL server. |
301
+
|`cp <src_path> <dst_path>`| Copies a file on the local file system of the WebCTRL server. |
302
+
|`mv <src_path> <dst_path>`| Moves a file or directory on the local file system of the WebCTRL server. Try using `cp` and `rmdir` to move a folder if you encounter errors with this command; this command generally only works when the source and destination are on the same drive. |
303
+
|`cat <file_path>`| Logs the contents of the specified file. |
304
+
|`exists <path>`| Asserts that the specified file or directory exists. If non-existent, then command execution is terminated. |
305
+
|`!exists <path>`| Asserts that the specified file or directory does not exists. If it exists, then command execution is terminated. |
306
+
|`regex <file_path> <find> [replace]`| If a replacement string is not given, then this commands logs all matches of the regular expression in the specified file. If a replacement string is given, then this command edits the specified file by replacing all matches of the regular expression. The file's contents are assumed to be UTF-8 encoded text. The [MULTILINE](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html#MULTILINE) and [DOTALL](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html#DOTALL) flags are used by default. |
307
+
|`download <sftp_file_path> <local_file_path>`| Downloads a file from the SFTP server into the local file system of the WebCTRL server. |
308
+
|`upload <local_file_path> <sftp_file_path>`| Uploads a file from the local file system of the WebCTRL server into the SFTP server. |
309
+
|`canApplyUpdate <file_path>`| Asserts that WebCTRL is able to apply the specified *.update* patch file. If the update cannot be applied, then command execution is terminated. |
310
+
|`!canApplyUpdate <file_path>`| Asserts that WebCTRL is not able to apply the specified *.update* patch file. If the update can be applied, then command execution is terminated. |
311
+
|`updateDST`| Updates daylight savings dates stored in the WebCTRL database and marks controllers for a pending parameter download. |
312
+
313
+
#### Examples
314
+
315
+
Here are a few sample scripts that can be modified to install WebCTRL patches in bulk.
This webpage helps you to find the persistent identifier for trends in order to track them in the database. See the next section for more details on how to use this identifier. You can browse the Geographic tree to search for trends. When you find a trend you want to track, click the turquoise colored trend type in order to copy the persistent identifier.
@@ -286,7 +357,7 @@ You can view all trend mappings from every WebCTRL server using this webpage.
286
357
| Server Name |`ACES Main`| User-friendly name of the WebCTRL server. (Read-only) |
287
358
| Name |`Boiler Temp`| User-friendly name to identity the trend mapping. |
288
359
| Persistent Identifier |`DBID:1:2176071:hws`| Unique identifier for the microblock value to be trended. Use the 'Find Trends' page to retrieve this. |
289
-
| Retain Data |`14`| Specifies how many days of historical data should be kept in the database. |
360
+
| Retain Data |`60`| Specifies how many days of historical data should be kept in the database. |
290
361
| Field Access |`false`| Whether to use field access when gathering trend data. If field access is disabled, then data collection will be faster, but it may not include the most up-to-date samples available. |
291
362
| Sample Count |`3972`| Number of samples stored in the database. (Read-only) |
292
363
| First Sample |`2024-11-19 14:10:00`| Timestamp of the oldest sample. (Read-only) |
0 commit comments