Discovery schedule using the wrong mid servers

Robert Paniagua
Tera Contributor

I have a schedule for on prem servers that is canceling because it has gone past the max run time. In looking at the Discovery Status, Discovery is trying to use two mid servers that are not part of the cluster the schedule is pointing then to use, and those two servers are in a down state because they are in our Test instance. Why is Discovery not using the cluster and using other mids to complete the schedule?

6 REPLIES 6

tim_broberg
ServiceNow Employee
ServiceNow Employee
  1. On your discovery schedule, what is your MID Server selection method?
  2. Are your mid servers configured to support the Discovery application?
  3. Are they configured to support the IP addresses in question?

Here's a background script to experiment with the load balancer and see how the system views your MID configuration:

var host = 'hostname@example.com';
var application = 'Discovery';
var capability = 'ssh';

var midSel = new SNC.MidSelector();
var midIDs = midSel.select(application, [host], [{'capability':capability}]);

var mids = [];
for (var i = 0; i < midIDs.length; i++) {
 var midGR = new GlideRecord('ecc_agent');
 midGR.get(midIDs[i]);
 mids.push(midGR.name);
}

mids.sort();
gs.print(mids.length + ' mids found:\n' + mids.join('\n'));

Tweak the first 3 lines to match your needs.

(IIRC, Discovery will ignore the capability, so you could probably pass null instead of that array, but it's not a bad idea to setup the capabilities properly anyway.)

Hope this helps,
    - Tim.

The schedule is configured to use a mid server cluster where both servers are up.

Ok, so, cluster.

This logic is implemented in Script Include, "ShazzamLaunch." Search for "midSelectSpecificCluster" and you'll find it.

A few things to try:

  1. Replicate fragments of this script in a background script and putter with it until it makes sense.
  2. Duplicate this script and edit it to reproduce the condition and add log messages to see what's going on. Consider modifying my debug script to use the same MIDSelector call you fine.
  3. Modify the original with log messages and revert back to the original when you're done.

This should give you a good idea what the logic is doing, and from there you can figure out what input is causing the problems.

Hope it helps. I can't take more time to look into it now, but I can help with what you find as you experiment.
    - Tim.

Rahul Priyadars
Giga Sage
Giga Sage

I am assuming schedules were exported and imported from lower to higher environment?

In schedule why do not you set one mid server and try running this.