Discovery Task Outputs

Success

Discovery tasks in SCOM almost always indicate that they have run successfully even if there are failures in the task itself. This simply indicates that a task was launched successfully not that it necessarily completed successfully.

When successful you will be able to find the output listed under the ‘Task Status' menu in the 'Monitoring’ tab.

You will be provided with some basic task details, such as when the task was launched, who it was launched by, and the target discovery.

The Task Output provides more detailed information about what has happened during the discovery process

Task Output

When successful the Task Output will provide you with a number of details about your connection to ServiceNow and what happened in the run.

You can use this information to get an idea of whether or not this behaved as expected and how long this took to complete. If you find that your monitoring objects are increasing you might wish to keep an eye on the timings to ensure that this remains within your configured timeout.

Output 
 
Connecting to SDK Service on <ManagementServer>
Standard licensing found and active.
https://<instance>.service-now.com/api/now/identifyreconcile
{
  "ServiceNowTargetClass": "cmdb_ci_db_mssql_database",
  "ScomSourceClassName": "MSSQL on Windows: Database",
  "UniqueClasses": 4,
  "TotalItems": 27,
  "NoChangeItems": 175,
  "InsertItems": 0,
  "UpdateItems": 0,
  "DeleteItems": 0,
  "UpdateWithItems": 0,
  "FailedObjectPayloads": 0,
  "TotalRelationships": 51,
  "TotalErrors": 0,
  "NoChangeRelationships": 125,
  "InsertRelationships": 1,
  "UpdateRelationships": 0,
  "AveragePostTime": 134.9387755102041,
  "MinPostTime": 89,
  "MaxPostTime": 1000,
  "AverageLookupTime": 683.87755102040819,
  "MinLookupTime": 410,
  "MaxLookupTime": 1085,
  "IdentificationPostCount": 49,
  "ContainFailures": false
}

Error 
 
None

Exit Code: 0 

  • ServiceNowTargetClass - The main target of the payload

    • Can be misleading in more complicated payloads

  • ScomSourceClassName - The main source of the information from SCOM

    • Can pick up other details from hosting relationships so can be misleading

  • UniqueClasses - The number of different classes used in this payload

    • EA Sync may cause this to be a class or two higher than you might normally expect

  • TotalItems - The total number of distinct objects posted in this discovery

    • Parents that host multiple children are only counted once

  • NoChangeItems - The number of objects that resulted in no change to the ServiceNow CMDB

  • InsertItems - The number of objects that resulted in a new item being created in ServiceNow

  • UpdateItems - The number of objects that already existed but required a change in ServiceNow

  • DeleteItems - The number of objects that were actively deleted in ServiceNow

  • UpdateWithItems - A combination of rarer update types:

    • Update with Downgrade - An existing CI in the target table is updated and its class is changed to a more generic class (ancestor class)

    • Update with Switch - An existing CI in the target table is updated and its class is changed to another class which is not an ancestor or descendant class

    • Update with Upgrade - An existing CI in the target table is updated and its class is changed to a more specialized class (descendant class)

  • FailedObjectPayloads - The number of payloads that produced exceptions

  • TotalRelationships - The number of relationships related to this payload

  • TotalErrors - The total number of errors encountered across all payloads

  • NoChangeRelationships - The number of relationships that resulted in no change to the ServiceNow CMDB

  • InsertRelationships - The number of new relationships created in ServiceNow

  • UpdateRelationships - The number of relationships that already existed but required a change in ServiceNow

  • AveragePostTime - The average time it took to transmit each payload to ServiceNow in milliseconds

  • MinPostTime - The fastest time it took to transmit a payload to ServiceNow in milliseconds

  • MaxPostTime - The longest time it took to transmit a payload to ServiceNow in milliseconds

  • AverageLookupTime - The average time it took to look up each SCOM object property in milliseconds

  • MinLookupTime - The quickest time it took to look up a SCOM object property in milliseconds

  • MaxLookupTime - The longest time it took to look up a SCOM object property in milliseconds

  • IdentificationPostCount - The number of attempts it took to complete this discovery

  • ContainFailures - Whether this discovery task contained any failures of any kind

Failure

Discovery tasks in SCOM almost always indicate that they have run successfully even if there are failures in the task itself. This simply indicates that a task was launched successfully not that it necessarily completed successfully.

The exit code can help narrow things down with anything other than a 0 indicating an error, and a 0 (usually) indicating success. The Error section will provide further details that should help with troubleshooting the underlying issue.

File Not Found

Failed to create process due to error '0x80070003 : The system cannot find the path specified.', this workflow will be unloaded. 

or

The system cannot find the file specified. Error Code: -2147024894 (The system cannot find the file specified)

This is a true task failure and will show up with a task failure status. This usually happens shortly after a fresh install or upgrade of the Management Pack.

Our Management packs ship with a number of resources that need to be deployed to the Management Server before use. Much like the Unix/Linux management packs, the Management Server will deploy these resources itself, but, if it’s a busy server or through sheer bad luck of timings a discovery could be run before these resources are fully deployed. Normally waiting a short period for the files to finish unpacking themselves will be enough. You should then be able to re-run the failed tasks from the task itself, or from the Discovery Menu:

Re-run from the task menu:

Re-run from the discovery menu:

Restarting the 'Microsoft Monitoring Agent' (healthservice) service on all servers in the resource pool can help prompt the deployment process if this is taking an abnormally long time.

Not Licensed

This usually shows up as a 'successful' task and returns with an exit code of 0.

Output 
Connecting to SDK Service on <management server>
You are not licensed for this Cookdown Product.

Error 
None

Exit Code: 0

This normally occurs on scheduled discovery tasks as the UI will prevent you from launching ad-hoc discovery tasks:

Check the main Discovery UI to see if you do not have a license available there either. You should then get in contact with support or your license vendor to look into this further.

Authentication Failure

This usually shows up as a ‘successful' task usually with an 'Exit Code’ of 3762504530

Failed to process the object discovery

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

In the event of an Authentication failure, it’s worth checking the correct runas account is linked to the correct runas profile. It can also be worth checking that the account is distributed to the correct management servers.

If this all appears correct it can be worth trying to browse to the endpoint via a web browser.

https://<instance>.service-now.com/api/now/identifyreconcile

This should provide you with an XML response stating that the method is not supported. However, this can verify the connection.

You should also try signing in to your instance using the service account to verify that this works.

In some circumstances, proxies are applied to certain user accounts automatically. This does not always apply to service accounts. If you have the required version of PowerShell (not Windows PowerShell) you can use Invoke-WebRequest with the -NoProxy switch to see if you get the same error.

Invoke-WebRequest -Uri 'https://<instance>.service-now.com/api/now/identifyreconcile' -NoProxy

If you are using Windows PowerShell you can dip into .net to test this out.

If ([Net.ServicePointManager]::SecurityProtocol -notlike '*Tls12*'){[Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType]::Tls12}
$request = [System.Net.WebRequest]::Create('https://<instance>.service-now.com/api/now/identifyreconcile')
$request.Proxy = [System.Net.WebProxy]::new() #blank proxy
$response = $request.GetResponse()
$response

We have previously seen proxies reply with a 401 error rather than the 407 error that should ideally be returned in this scenario.

Missing Matching Attributes

This usually shows up as a 'successful' task with an Exit Code of 2.

Output 
 
Connecting to SDK Service on <management server>
Standard licensing found and active.
https://<instance>.service-now.com/api/now/identifyreconcile
{
  "ServiceNowTargetClass": "cmdb_ci_win_server",
  "ScomSourceClassName": "Windows Operating System",
  "UniqueClasses": 1,
  "TotalItems": 1,
  "NoChangeItems": 0,
  "InsertItems": 25,
  "UpdateItems": 0,
  "DeleteItems": 0,
  "UpdateWithItems": 0,
  "FailedObjectPayloads": 0,
  "TotalRelationships": 0,
  "TotalErrors": 50,
  "NoChangeRelationships": 0,
  "InsertRelationships": 0,
  "UpdateRelationships": 0,
  "AveragePostTime": 1791.36,
  "MinPostTime": 201,
  "MaxPostTime": 3642,
  "AverageLookupTime": 293.08,
  "MinLookupTime": 154,
  "MaxLookupTime": 727,
  "IdentificationPostCount": 25,
  "ContainFailures": true
}
 
Error 
 [
  {
    "error": "MISSING_MATCHING_ATTRIBUTES",
    "message": "In payload missing minimum set of input values for criterion (matching) attributes from identify rule for table [cmdb_ci_hardware]. Add these input values in payload item '{\"className\":\"cmdb_ci_win_server\",\"values\":{\"discovery_source\":\"Cookdown Discovery\"},\"internal_id\":\"ff4ef47f6c5a7010bf461cb1e4160c14\",\"sys_object_source_info\":{\"source_name\":\"Cookdown Discovery\"},\"settings\":{},\"sys_ire_info\":{\"ire_received_time\":\"2021-09-06 16:02:38\"},\"display_values\":{}}'"
  },
  {
    "error": "ABANDONED",
    "message": "Too many other errors"
  },
 ...etc...etc...
 ]
 
Exit Code: 2

In the case of a Missing Matching Attribute error, your payload will usually be missing a key value required to match your individual objects to a CMDB item. In the example above, we deliberately left out the ‘name’ property so that the Windows Servers could not be matched. If you are moving to a fresh instance (EG. From Test to Development to Production) you may find that an identification rule you were expecting to be in place is not there or not the same.

Running through the Identification Simulator can help you work out what is missing.

Task Status Is CompletedWithInfo

This is also usually seen with Exit Code: 3 and covered on the ‘Task Status Is Not Success or Failed on Completion’ page.