← All guides

ServiceNow MID Server: Installation, Configuration, and Troubleshooting

Install and validate a ServiceNow MID Server, configure its key parameters, and troubleshoot a MID Server that is down, stuck, or failing its jobs.

A ServiceNow MID Server is a Java service that runs inside your network and carries out work the cloud instance cannot do directly, such as Discovery probes, LDAP imports, and calls to internal REST or database endpoints. This guide covers MID Server installation, the configuration that matters, and how to troubleshoot one that is down or slow.

How a MID Server communicates

The MID Server polls the instance over HTTPS on port 443. It picks up work from the ECC queue (ecc_queue table) as output records, runs the probe or command locally, and posts the results back as input records.

Every connection starts from the MID Server. The instance never calls into your network, which is why the firewall team only needs to allow outbound traffic to https://<instance>.service-now.com.

Before you install

  • Host: a dedicated Windows or Linux server. Check the current system requirements for your release. As a starting point, plan for 4 CPU cores, 8 GB of memory, and 40 GB of disk.
  • Network: outbound 443 to the instance, plus access from the host to the targets it will reach.
  • Time: the host clock must be accurate. Clock drift causes authentication and certificate errors.
  • MID Server user: create a dedicated user on the instance and assign the mid_server role. Do not use a personal account or an admin account.
  • Service account: on Windows, the service should run as a domain account with the rights Discovery needs on its targets, not as Local System.

Install the MID Server

  1. On the instance, go to MID Server > Downloads and download the installer for your operating system. Use the installer from the same instance you will connect to, so the versions match.
  2. Run the installer on the host. On Windows this is an MSI. On Linux, install the package or extract the archive into a path such as /servicenow/<mid-server-name>.
  3. When prompted, enter the instance URL, the MID Server user name and password, and a unique MID Server name.
  4. Start the service.
  5. On the instance, open MID Server > Servers. The new record appears with Validated set to No. Open it and select Validate.

A MID Server does no work until it is validated. Validation also encrypts the password stored on the host.

One host can run several MID Servers. Install each one in its own folder with its own service name.

Key configuration

Settings live in config.xml in the agent folder, and most can also be set as Configuration Parameters on the MID Server record.

ParameterPurpose
urlThe instance URL
mid.instance.username / mid.instance.passwordThe MID Server user credentials
nameThe MID Server name shown on the instance
mid.proxy.use_proxy, mid.proxy.host, mid.proxy.portSend instance traffic through a web proxy
threads.maxNumber of worker threads for standard-priority jobs

Restart the service after you edit config.xml.

Memory is set separately, in agent/conf/wrapper-override.conf:

wrapper.java.maxmemory=2048

Raise this when the MID Server runs large Discovery schedules or big JDBC imports and the log reports out-of-memory errors.

Capabilities, applications, and IP ranges

The instance chooses a MID Server for each job using three settings on the MID Server record:

  • Supported applications, such as Discovery, Orchestration, or ALL
  • Capabilities, such as SSH, WMI, SNMP, or PowerShell
  • IP ranges the MID Server may reach

If a Discovery schedule reports that no MID Server is available, the usual cause is a mismatch here. A MID Server limited to 10.10.0.0/16 will never be picked for a target in 10.20.0.0/16.

Clusters

Group MID Servers with the same capabilities into a cluster. A failover cluster moves work to the next MID Server when one goes down. A load balance cluster spreads work across all members. Use at least two MID Servers per environment.

Troubleshoot a MID Server

Start with the logs

On the host, open the agent/logs folder:

  • agent0.log.0 is the main log. Search it for SEVERE and WARNING.
  • wrapper.log records service start and stop events and JVM errors.

On the instance, check MID Server > Server Issues for problems the MID Server has reported about itself.

The MID Server is Down

Work through these in order:

  1. Is the service running on the host? Start it and watch wrapper.log.
  2. Can the host reach the instance? From the host, open the instance URL in a browser or run curl -I https://<instance>.service-now.com.
  3. Is the MID Server user active and not locked out on the instance? The active locked-out users report finds locked accounts quickly.
  4. Did the password change? Update mid.instance.password in config.xml with the new plain-text value and restart. The MID Server encrypts it again on start.
  5. Does agent0.log.0 show a certificate error? A TLS-inspecting proxy presents its own certificate, which the MID Server does not trust by default. Ask the network team to exclude the instance URL from inspection, or import the proxy's root certificate following the MID Server certificate documentation.

The MID Server is Up but jobs do not finish

Check the ECC queue. This background script, which only reads data, shows how much work is waiting per MID Server:

var queue = new GlideAggregate('ecc_queue');
queue.addQuery('queue', 'output');
queue.addQuery('state', 'ready');
queue.addAggregate('COUNT');
queue.groupBy('agent');
queue.query();

while (queue.next()) {
  gs.info(queue.getValue('agent') + ': ' +
    queue.getAggregate('COUNT') + ' output records waiting');
}

A large and growing count means the MID Server cannot keep up. Add a MID Server to the cluster, stagger Discovery schedules, or raise threads.max if the host has spare CPU and memory.

Output records stuck in Processing for a long time usually point to a probe that hangs on an unreachable target. The matching entry in agent0.log.0 names the target.

Credential failures

Discovery and Orchestration credentials are stored on the instance and sent to the MID Server when needed. When a probe fails to authenticate:

  • Use Test credential on the credential record and select the MID Server that will run the job.
  • Confirm the credential is not restricted to a different MID Server.
  • For Windows targets, confirm the service account has the required rights on the target and that the firewall allows WMI or WinRM.

After an instance upgrade

MID Servers upgrade themselves to match the instance. If one stays on the old version, check that the host can download the package, that the service account can write to the agent folder, and that disk space is available. Then restart the service and review agent0.log.0. Add this check to your upgrade checklist.

Checklist

  • Dedicated host with an accurate clock
  • Dedicated user with only the mid_server role
  • Outbound 443 allowed to the instance, with TLS inspection excluded
  • MID Server validated
  • Applications, capabilities, and IP ranges match the work it should do
  • At least two MID Servers in a cluster per environment
  • Logs and the ECC queue checked after every upgrade

Most integrations that run through a MID Server are REST or import jobs. The outbound REST integration guide and the import set best practices cover what to build on top of it.

Frequently asked questions

What is a MID Server in ServiceNow?

A MID Server (Management, Instrumentation, and Discovery) is a Java application that runs as a service on a Windows or Linux host inside your network. It lets a cloud-hosted ServiceNow instance reach systems behind the firewall for Discovery, Service Mapping, Orchestration, and integrations such as LDAP, JDBC, and REST.

Which ports does a MID Server need?

The MID Server opens outbound HTTPS connections to the instance on port 443. The instance never opens a connection to the MID Server, so no inbound firewall rule is needed for that link. The MID Server also needs access to whatever it probes or integrates with, for example SSH on 22, WMI and WinRM for Windows, or the database port for a JDBC source.

Why is my MID Server showing as Down?

Common causes are a stopped service on the host, a locked or wrong MID Server user account, a password that changed on the instance but not in config.xml, a proxy or firewall blocking port 443, or an expired or untrusted certificate. Check the service first, then read agent0.log.0 in the agent's logs folder for the exact error.

How many MID Servers do I need?

Run at least two per environment so that a cluster can fail over or share load. Add more when you separate network zones, when Discovery schedules overlap with integration traffic, or when ECC queue output records wait a long time in the Ready state.

More practical ServiceNow notes.

Back to the guides