jsn / ServiceNow, simplified.
AustraliaREFERENCE GUIDE

MIDServerSelector - Global

On this page

MIDServerSelector- Global

The MIDServerSelector script include provides methods to find a MID Server based on capabilities and target IP address.

Use in server scripts to find a MID Server with specific capabilities.

Parent Topic:Server API reference

MIDServerSelector - MIDServerSelector()

Creates an instance of MIDServerSelector.

Name Type Description None     Type Description void  

MIDServerSelector - findAgent(String target)

Finds the MID server based on the capabilities and target IP address.

Name Type Description target String The target IP address Type Description void  
var mss = new MIDServerSelector();
var capab = ["ssh","wmi","snmp"];
mss.setCapabilities(capab);
mss.findAgent('100.101.10.10');

MIDServerSelector - getError()

Gets the error messages for the current MID server.

Name Type Description None     Type Description void  
var mss = new MIDServerSelector();
var capab = ["ssh","wmi","snmp"];
mss.setCapabilities(capab);
mss.findAgent('100.101.10.10');
mss.getError();

MIDServerSelector - getWarning()

Gets the warning messages for the current MID server.

Name Type Description None     Type Description void  
var mss = new MIDServerSelector();
var capab = ["ssh","wmi","snmp"];
mss.setCapabilities(capab);
mss.findAgent('100.101.10.10');
mss.getWarning();

MIDServerSelector - setCapabilities(Array capabilities)

Sets the technologies for which to look.

Name Type Description capabilities Array A list of capabilities, for example - capabilities = [“ssh”,“wmi”,“snmp”,{“os_domain”:“disco”},{“phase”:1}]; Type Description void  
var mss = new MIDServerSelector();
var capab = ["ssh","wmi","snmp"];
mss.setCapabilities(capab);

Keep exploring.

Find another answer, or bring this documentation into your own tools.