monitoring: Advanced Monitoring
The monitoring
utility is used for managing the data
presented by the Advanced Monitoring extension.
Note: The utility is available when the Advanced Monitoring and Grafana extensions are installed in Plesk. The extensions are installed by default.
Usage
plesk ext monitoring <command> <operation> [options] [arguments]
Example
The following command sets the Apache & PHP-FPM memory usage threshold to 10%:
plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10
Commands
Command | Operation | Description | Example |
---|---|---|---|
--installation |
--get-status | --fix | --detect-hardware-changes
|
Manages the Advanced Monitoring installation. |
To check for changes made to the server hardware and reflect them (if any): plesk ext monitoring --installation --detect-hardware-changes |
--overview |
--list-panel-ids | --list-targets | --list-sections | --get-sources-map
|
Shows the main Advanced Monitoring data: panel IDs, threshold IDs, and tab IDs. |
To show the table of dependencies between panel IDs, tab IDs, and threshold IDs in the JSON format: plesk ext monitoring --overview --get-sources-map -format json |
--thresholds |
--list | --set | --set-from-json | --set-from-file | --unset | --restore-defaults
|
Manages thresholds in Advanced Monitoring. |
To restore the default threshold values: plesk ext monitoring --thresholds --restore-defaults |
--arrangement |
--list | --set | --set-from-json | --set-from-file | --restore-defaults
|
Manages the layout of panels on tabs in Advanced Monitoring. |
To display only the “Real memory usage” panel on the “Memory” tab in Advanced Monitoring (by default, three panels are shown on this tab): plesk ext monitoring --arrangement --set -section ram -panel-ids memory_usage |
--help or -h
|
Displays the help on the utility usage. |
To see the help on the utility usage: plesk ext monitoring --help or plesk ext monitoring -h |
Operations
Operation | Option | Description | Example |
---|---|---|---|
--get-status |
Shows the result of the Advanced Monitoring installation. Used with the |
To show the result of the extension installation: plesk ext monitoring --installation --get-status |
|
--fix |
Detects and fixes Advanced Monitoring issues (if any). Used with the |
To detect and fix Advanced Monitoring issues (if any): plesk ext monitoring --installation --fix |
|
--detect-hardware-changes |
Checks for changes made to the server hardware and, if the changes exist, reflects them in Advanced Monitoring. Learn more about updating Advanced Monitoring after hardware change. Used with the |
To check for changes made to the server hardware and reflect them (if any): plesk ext monitoring --installation --detect-hardware-changes |
|
--list-panel-ids |
Lists the IDs of all panels in Advanced Monitoring.
For example, the “Plesk CPU usage” panel in the Plesk interface has the Used with the |
To list the IDs of all panels in Advanced Monitoring: plesk ext monitoring --overview --list-panel-ids |
|
--list-sections |
Lists the IDs of all tabs in Advanced Monitoring.
For example, the “Disk” tab in the Plesk interface has the Used with the |
To list the IDs of all tabs in Advanced Monitoring: plesk ext monitoring --overview --list-sections |
|
--list-targets |
Lists the IDs of all available thresholds in Advanced Monitoring. Used with the |
To list the IDs of all available thresholds in Advanced Monitoring in the JSON format: plesk ext monitoring --overview --list-targets -format json |
|
--get-sources-map |
Shows the table of dependencies between panel IDs, tab IDs, and threshold IDs in Advanced Monitoring.
The table shows that, for example, the Used with the |
To show the table of dependencies between panel IDs, tab IDs, and threshold IDs in the JSON format: plesk ext monitoring --overview --get-sources-map -format json |
|
--list |
If used with the --thresholds command, shows the table of all thresholds whose values have been set along with the exact values.
If used with the --arrangement command, shows the current layout of panels
(in which order panels are shown on Advanced Monitoring tabs). |
To show all set threshold values: plesk ext monitoring --thresholds --list |
|
--set (for the thresholds command) |
-panel-id <panel_ID> [-target <target>] [-operator <operator>] [-type <type>] -value <value> |
Sets or updates the threshold value. When the resource usage exceeds its threshold value, Advanced Monitoring will show notifications in the Plesk interface. |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
--set (for the --arrangement command) |
-section <section> -panel-ids <panel_IDs> |
Changes which panels and in which order are shown on the Advanced Monitoring tab. Note: Advanced Monitoring has the default layout of tabs and panels related to them. You can change the order and visibility of the panels on a specific tab but you cannot place a panel on the tab where the panel is not meant to be according to the the default layout. Advanced Monitoring in the Plesk interface will not show the tab’s panels
whose IDs you do not specify as arguments for the |
To display only the “Real memory usage” panel on the “Memory” tab in Advanced Monitoring (by default, three panels are shown on this tab): plesk ext monitoring --arrangement --set -section ram -panel-ids memory_usage |
--set-from-json |
-json <json_string> |
If used with the If used with the
Note:
You need to specify the whole list of all available threshold values/tabs.
|
To set or update all threshold values via a raw JSON string: plesk ext monitoring --thresholds --set-from-json -json [{"panelId":"memory_usage","target":"memory:memory-used:value","operator":"greater_than","type":"percent","value":90},...] To change the layout of panels on all Advanced Monitoring tabs via a raw JSON string. plesk ext monitoring --arrangement --set-from-json -json [{"section":"overview","panelIds":["cpu_usage__cpu","memory_usage"]},...] |
--set-from-file |
-path <path_to_file> |
If used with the If used with the
Note:
You need to specify the whole list of all available threshold values/tabs in a JSON file.
|
To set or update all threshold values using the data specified in the plesk ext monitoring --thresholds --set-from-file -path /tmp/values.js To change the layout of panels on all Advanced Monitoring tabs using the data specified in the plesk ext monitoring --arrangement --set-from-file -path /tmp/arrangement.js |
--unset |
-panel-id <panel_ID> |
Deactivates the threshold and deletes the threshold value. Advanced Monitoring stops tracking the resource whose threshold you deactivated. |
To stop tracking Apache & PHP-FPM memory usage: plesk ext monitoring --thresholds --unset -panel-id memory_usage__web |
--restore-defaults |
If used with the If used with the |
To restore the default threshold values: plesk ext monitoring --thresholds --restore-defaults To restore the default layout of Advanced Monitoring tabs: plesk ext monitoring --arrangement --restore-defaults |
Options
Option | Description | Example |
---|---|---|
-panel-id |
The panel ID. For example, the “Real memory usage” panel in the Plesk interface has the The option is used with the |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
-target |
The threshold ID related to the panel ID. For example, The option is used with the |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
-operator |
The comparison operator. The supported values: The option is used with the |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
-type |
The threshold value type. The supported values: The option is used with the |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
-value |
The threshold value (a float number). The option is used with the |
To set the Apache & PHP-FPM memory usage threshold to 10%: plesk ext monitoring --thresholds --set -panel-id memory_usage__web -target sw_mem-Web:ps_rss:value -operator greater_than -type percent -value 10 |
-json |
A string in the JSON format. The option is used with the |
To change the layout of panels on all Advanced Monitoring tabs via a raw JSON string. plesk ext monitoring --arrangement --set-from-json -json [{"section":"overview","panelIds":["cpu_usage__cpu","memory_usage"]},... |
-path |
The path to the JSON file. The option is used with the |
To set or update all threshold values using the data specified in the plesk ext monitoring --thresholds --set-from-file -path /tmp/values.js |
-section |
The tab ID. For example, The option is used with the |
To display only the “Real memory usage” panel on the “Memory” tab in Advanced Monitoring (by default, three panels are shown on this tab): plesk ext monitoring --arrangement --set -section ram -panel-ids memory_usage |
-panel-ids |
Panel IDs separated by commas. For example, The option is used with the |
To display only the “Real memory usage” panel on the “Overview” tab in Advanced Monitoring: plesk ext monitoring --arrangement --set -section overview -panel-ids memory_usage |
General Options
Option | Description | Example |
---|---|---|
-v | -verbose
|
Shows the detailed output of the command. |
To show the detailed result of the Advanced Monitoring installation: plesk ext monitoring --installation --get-status -v |
-f | -format
|
Shows the output in a particular format. The supported formats: raw , json .
By default, all data is shown in the raw format. |
To list the IDs of all available thresholds in Advanced Monitoring in the JSON format: plesk ext monitoring --overview --list-targets -format json |