Skip to main content

SCOM Integration with NATS

If you monitor JAMS with Microsoft System Center Operations Manager (SCOM), you must install an updated JAMS management pack. The previous pack read alerts from an MSMQ queue that no longer exists.

Action required

Import management pack version 7.0.0.4 or later, and do it after upgrading JAMS, not before.

Before the JAMS upgrade there is no NATS server for the new pack to read, so it fails. After the upgrade the old pack has nothing to read, because the JAMStoSCOM queue has been drained and deleted. Either ordering mistake means no JAMS alerts reach SCOM.

For the rest of the management pack, including import steps and the alert parameters, see The JAMS Management Pack for MS SCOM.

What Changed​

BeforeNow
Where alerts are writtenThe private MSMQ queue .\Private$\JAMStoSCOMThe NATS stream JAMS_SCOM, subject jams.event.<MachineName>.scom
FormatXMLJSON
How the pack reads themDrained the MSMQ queueA durable pull consumer named JAMS_SCOM_READER
AuthenticationWindows queue permissionsMutual TLS, using the JAMS NATS certificate
Uncollected alertsAccumulated indefinitelyExpire after 7 days

Alerts are still produced by the JAMS Scheduler service, still polled every 60 seconds, and still raise the same JAMS Scheduler Event alert with the same fields.

Getting and Importing the Pack​

The management pack is not included with the JAMS installer. Download the current MVP.JAMS.mp from the JAMS Support site, or contact JAMS Support.

Pack IDMVP.JAMS
Version7.0.0.4
FileMVP.JAMS.mp (sealed)

Import it the way you import any sealed pack, replacing the version you have.

Required SCOM library versions

Version 7.0.0.4 references newer Microsoft libraries than earlier packs. Your management group must have at least these versions or the import is rejected:

LibraryVersion
Microsoft.SystemCenter.Library10.25.10132.0
Microsoft.SystemCenter.DataWarehouse.Library10.25.10132.0
System.Library7.5.8501.1
Microsoft.Windows.Library7.5.8501.1
System.Health.Library7.0.8447.6
System.Performance.Library7.0.8447.6

Requirements on the JAMS Scheduler Machine​

The pack's collection script runs on the JAMS Scheduler machine itself. It connects to NATS over loopback and reads the JAMS installation's own configuration and certificates. It needs:

  1. The JAMS PowerShell module, so the script can find the JAMS installation folder.
  2. The JAMS Scheduler installed locally, which provides nats-server.conf and NATS.Client.dll.
  3. Read access to the NATS folder for the SCOM RunAs account.

Grant the RunAs Account Access to the Certificates​

This is the requirement most likely to catch you out.

The collection rules run under the RunAs profile Account for JAMS Collection Rules. To connect to NATS, the script must read the three .pem files in C:\Program Files\MVPSI\JAMS\Scheduler\NATS. JAMS removes BUILTIN\Users from that folder so the private key is not readable by standard users, which means an ordinary RunAs account cannot read them.

Grant that account read access:

$natsDir = "C:\Program Files\MVPSI\JAMS\Scheduler\NATS"
$account = "DOMAIN\SCOMRunAsAccount"

$acl = Get-Acl $natsDir
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
$account, "ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow")
$acl.AddAccessRule($rule)
Set-Acl $natsDir $acl
caution

The account you grant here can read the NATS server's private key. Use a dedicated account and scope it to this folder only.

Verifying It Works​

Successful polls are silent by design. No events means it is working. Confirm by running a Job that raises an alert and watching for a JAMS Scheduler Event alert in SCOM.

To check from the JAMS side that the stream and consumer exist:

cd "C:\Program Files\MVPSI\JAMS\Scheduler\NATS"
nats stream info JAMS_SCOM
nats consumer info JAMS_SCOM JAMS_SCOM_READER

The consumer appears only after the updated pack has polled at least once. The pack creates it, not JAMS. See Using the NATS Admin CLI.

Troubleshooting​

The script writes to the Operations Manager event log on failure:

Event IDSeverityMessageCause and fix
4001ErrorUnable to locate the JAMS install directory.The JAMS PowerShell module is not available to the RunAs account, or JAMS is not installed on this machine.
4001ErrorNATS.Client.dll was not found under <path>The JAMS Scheduler is not installed at the resolved location. The pack must run on a JAMS Scheduler machine.
4002WarningNATS TLS files were not found under <path>; connecting without TLS.The RunAs account cannot read the .pem files. The script then connects in plaintext and is rejected, usually followed by a 4001. Grant the RunAs account read access to the NATS folder.
4004ErrorThe NATS server certificate was rejected: ...chains to a different root CA than nats-ca.pemThe NATS server is presenting a certificate issued by a previous root CA. This is the failover case: a shared root CA was imported without re-issuing the NATS certificate. Re-issue it. See NATS in a Failover Environment.
4004ErrorThe NATS server certificate was rejected: ... (other reasons)The server certificate is not a JAMS NATS certificate or its chain does not build. Re-issue it. See NATS TLS Certificates.

If no alerts arrive and there are no events:

  1. Confirm the pack version is 7.0.0.4 or later. An older pack silently reads a queue that is gone.
  2. Confirm nats stream info JAMS_SCOM shows the stream on the Scheduler machine.
  3. Confirm the alert rule's target is discovered and the rule is not overridden off.
  4. Check whether alerts are sitting unread. A rising message count on JAMS_SCOM means JAMS is publishing and nothing is collecting.

Uncollected Alerts Now Expire​

JAMS_SCOM discards its oldest entries when full and expires anything unread after 7 days. Its size cap is 1 GiB.

This is a deliberate change from MSMQ, where alerts accumulated indefinitely. A management pack can stop collecting for reasons outside JAMS, and a full stream must never make a JAMS operation fail.

What to plan for:

  • You have a 7-day window. Alerts published while you are still on the old pack wait in the stream and are collected once the updated pack starts polling, but only for 7 days.
  • Alerts nobody collects are eventually dropped. If SCOM collection is down for more than a week, alerts from before that window are lost. The Job history in the JAMS database is unaffected.

Empty Fields​

Alerts carry 17 fields: JobName, JAMSEntry, Summary, Detail, FinalStatus, Priority, Severity, and CustomField0 through CustomField9.

The JSON serializer omits numeric fields whose value is zero, so where the old XML format showed 0 for Priority, Severity, or JAMSEntry, the new pack shows an empty string. Priority and Severity default to 1, so this only arises when a Job explicitly sets one of them to 0. If you have SCOM rules or reports that match on a literal 0 in those fields, update them.