Bootstrap FreeKB - SiteScope (Monitoring) - Enable or Disable monitor using REST API
SiteScope (Monitoring) - Enable or Disable monitor using REST API

Updated:   |  SiteScope (Monitoring) articles

You may want to first check out my article on Getting Started with the SiteScope REST API and this MicroFocus PDF.

A GET request can be made to endpoint /api/monitors to return the full list of monitors. For example, here is how you could submit the GET request using curl on Linux.

curl --request GET --user <username>:<password> --url http://<SiteScope hostname or IP address>:<port>/SiteScope/api/monitors

 

And here is a practical example.

~]# curl --request GET --user john.doe:itsasecret --url http://sitescope.example.com:8080/SiteScope/api/monitors

 

Something like this should be returned.

  • sis_path_delimiter often maps to a forward slash, which means the foo monitor is at production/foo/https://foo.example.com/
{
    "production": "Group",
    "production_sis_path_delimiter_foo_sis_path_delimiter_https://foo.example.com/": "Monitor",
    "production_sis_path_delimiter_bar_sis_path_delimiter_https://bar.example.com/": "Monitor"
}

 

Here is how you could enable or disable the monitor for production/foo/https://foo.example.com/.

  • fullPathToMonitor is required and must be an exact match of the monitor returned by the prior command, with %20 used for whitespace
  • enable=true must be used to enable the monitor, enable=false or not including enable will disable the monitor
~]# curl --request POST --header "Content-Type: application/x-www-form-urlencoded" --user john.doe:itsasecret --url http://sitescope.example.com:8080/SiteScope/api/monitors/monitor/status?fullPathToMonitor=production_sis_path_delimiter_foo_sis_path_delimiter_https://foo.example.com/&enable=true

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 72a540 in the box below so that we can be sure you are a human.