Skip to main content

Problem indicators

To facilitate the creation and management of custom problem indicators, allowing you to indicate any number of problems with your environment, OUs, Orders, etc., there's several services available for fine-tuning.

Service
CreateMonitor
UpdateMonitor
DeleteMonitor

CRUD services for monitorsโ€‹

{
"Handler": "SettingVulnerabilities",
"Name": "SettingVulnerabilities",
"Description": "Monitor vulnerable settings",
"Type": 1
}

The possible types in the services above are:

  • 0: Info
  • 1: Warning
  • 2: Error
  • 3: Fatal

Some monitors can be configured by setting the Data property in CreateMonitor and UpdateMonitor.

Monitor configurationโ€‹

Check if conditions are available per handlerโ€‹

The main configuration option is to set conditions. First run GetAvailableMonitorHandlers to check if conditions are available for the handler.

{
// Request can be left empty
}

Get which conditions are available per handlerโ€‹

{
"Handler": "TransputJobs"
}

Setting conditions for monitorsโ€‹

You can set conditions for monitors by setting the MainConditionGroup property in the Data property in either CreateMonitor or UpdateMonitor

This is the format of a ConditionGroup:

{
"MatchAny": bool,
"Conditions": Condition[]
"Groups": ConditionGroup[]
}

The format of a Condition:

{
"Field": string,
"ValueOperator": string,
"Value": string
}

With the 'MatchAny' property you can define whether all conditions should be valid or not.

So, for example, to create a monitor that seeks all failed transput jobs for order/shipment RGC exports, we can call CreateMonitor as follows:

{
"Handler": "TransputJobs",
"Name": "Failed RGC",
"Description": "Monitor for failed RGC exports",
"Type": "Error",
"IsPublic": true,
"Data": {
"MainConditionGroup": {
"MatchAny": false,
"Conditions": [
{"Field": "Name", "ValueOperator": "Contains", "Value": "RGC"},
{"Field": "StatusID", "ValueOperator": "Equals", "Value": "-1"}
],
"Groups": [
{
"MatchAny": true,
"Conditions": [
{"Field": "TypeID", "ValueOperator": "Equals", "Value": "1"},
{"Field": "TypeID", "ValueOperator": "Equals", "Value": "2"}
]
},
{
"MatchAny": true,
"Conditions": [
{"Field": "DaysOld", "ValueOperator": "LessThan", "Value": 10},
{"Field": "DaysOld", "ValueOperator": "Equals", "Value": 10}
]
}
]
}
}
}

Query-like: 'all transput jobs where name contains RGC and status is failed and (type is orders or shipments) and (days old is less than 10 or equal to 10)'

Monitor ownersโ€‹

Monitors can be owned by users and roles. By default, the creator of the monitor will be added as owner of the monitor. To define whether or not everyone can see the monitor, the 'IsPublic' property can be set. A user-created monitor has one or more owners.

Role owners can be added to make a monitor visible for specific roles.

User owners can be added to make a monitor visible for specific users. For user owners, the 'IsAllowedToEdit' property can be altered to allow one to make changes to monitors.

{
"MonitorID": 1,
"UserID": 1,
"IsAllowedToEdit": true
}

Running monitorsโ€‹

A Monitor can be run by manually calling RunMonitor or by creating a recurring task, such as RunTaskPlugin.

{
"ID": 2
}

Getting monitor resultsโ€‹

Call GetMonitorResults to fetch the latest results for all monitors.

{
// Empty request
}

The content of 'LastResult' varies by handler and is therefore not typed. How each handler stores information will be documented later.

Monitor alertsโ€‹

The first step to creating the alert itself, via CreateMonitorAlert.

{
"MonitorID": "1",
"Level": "Warning",
"Threshold":"5",
"Description":"If more than 5 warnings available, sound the alarm!",
"EmailSubject":"5 or more monitor warnings"
}

With this ID from the above service, you can call CreateMonitorAlertEmailRecipient to set an email address for the warning to be sent out to.

{
"AlertID": "2",
"Name": "Pedro",
"EmailAdress":"pedro@docs-inc.org",
}