MIDServerFinder - Global
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API reference
The MIDServerFinder script include provides methods to find a list of MID Servers for specified IP addresses.
Use in server scripts to get the MID Server list.
MIDServerFinder - MIDServerFinder()
Creates an instance of MIDServerFinder.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
MIDServerFinder - getMIDServers()
Gets the names of MID servers available for a given range and capability.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array | An array of MID server names. If no MID servers are available, returns an empty array. |
Example
MIDServerFinder - getMIDServersBySysId()
Gets the sys_ids of MID servers available for a given range and capability.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Array | An array of MID server sys_ids. If no MID servers are available, returns an empty array. |
Example
MIDServerFinder - getStatusMessage()
Gets the state of the finder operation.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The status message |
Example
MIDServerFinder - setActive(Boolean flag)
Sets whether to look for active or inactive MID servers. By default, searches are for active MID servers unless inactive is specified by this method.
Name | Type | Description |
---|---|---|
flag | Boolean | If true, look for inactive MID servers. If false, do not look for inactive MID servers. |
Type | Description |
---|---|
void |
Example
MIDServerFinder - setCapabilities(Array capabilities)
Sets the technologies for which to look.
Name | Type | Description |
---|---|---|
capabilities | Array | Contains a list of capabilities, for example - capabilities =
["ssh","wmi","snmp",{"os_domain":"disco"},{"phase":1}]; |
Type | Description |
---|---|
void |
Example
MIDServerFinder - setDebug(Boolean onOrOff)
Turns debugging on or off.
Name | Type | Description |
---|---|---|
onOrOff | Boolean | True to turn on debugging; false to turn debugging off. |
Type | Description |
---|---|
void |
Example
MIDServerFinder - setRanges(String ranges)
Sets the range of IP addresses for which to look.
Name | Type | Description |
---|---|---|
ranges | String | A comma-separated list in one of these formats.
|
Type | Description |
---|---|
void |
Example
MIDServerFinder - setRangesByIPOrHostname(String ipOrHostname)
Determines if the input is a single IP or a hostname, and passes the IP or multiple IPs to the setRanges() method.
If the value of ipOrHostname is an IP address, it is passed into the setRanges() method. It the value is a hostname, we look up the DNS table (cmdb_ip_address_dns_name) to try resolving the hostname. The result, either an IP or multiple IPs, is then passes into the setRanges() method.
Name | Type | Description |
---|---|---|
ipOrHostname | String | The IP address, IP range, or host name. |
Type | Description |
---|---|
void |
Example
On this page
- MIDServerFinder - MIDServerFinder()
- MIDServerFinder - getMIDServers()
- MIDServerFinder - getMIDServersBySysId()
- MIDServerFinder - getStatusMessage()
- MIDServerFinder - setActive(Boolean flag)
- MIDServerFinder - setCapabilities(Array capabilities)
- MIDServerFinder - setDebug(Boolean onOrOff)
- MIDServerFinder - setRanges(String ranges)
- MIDServerFinder - setRangesByIPOrHostname(String ipOrHostname)