ServiceNow Monitoring Management Pack

The ServiceNow Monitoring Management Pack lets you know what experience your end users have when they access ServiceNow from each of your satellite offices. Setup outside in monitoring from any existing SCOM Agent in each site you want to test from and get detailed insights such as:

  • Availability – ServiceNow itself is up but something between your users and ServiceNow preventing them from accessing it? get early alerts from SCOM when ServiceNow isn’t available from each site

  • See how your ServiceNow site is load-balanced – we expose the servers that underpin your ServiceNow instance in SCOM, allowing you to alert on key performance metrics

  • 38 ServiceNow performance counters included in this management pack, such as node memory usage, logged in users and instance load.

Setup - ServiceNow

  1. Create an account in ServiceNow to act as a service account. This account needs to be able to access the sys_cluster_state table and the web API - permissions to the sys_cluster_state table are granted by the Admin role only by default so we recommend creating a custom ACL to grant access to this table alone. Your ServiceNow administrator will be able to set this up for you. If you are the ServiceNow administrator, the below instructions take you through the steps and require you are logged in as a system administrator

  2. Type Users in the navbar, select Users under System Security (as per New York). Click New, give the new user a user ID and name and hit Submit

  3. Type Roles in the navbar and select Roles under System Security and click “New”

  4. Give the role a name and leave all other settings at the defaults

  5. Type ACL in the navbar and select Access Control (ACL)

  6. Click the down arrow in the top right corner of the screen by your profile and select “Elevate Roles”, check “security_admin” and click OK

  7. The “New” button should now appear on the Access Controls page - click it

  8. Complete the new record as per the below screenshot then click Submit then Continue. The key changes from defaults are

    1. Operation: Read (no write/create/delete permissions are needed)

    2. Name: sys_cluster_state (this is the table we are granting access to)

    3. Requires role: the role you created earlier in this wizard

  9. Once done search Users in the navbar and select Users under System Security

  10. Select the user you created earlier, click the Roles tab and hit Edit

  11. Find the web_service_admin role (which grants API access) and the custom role you just created then click Save

Setup - SCOM

  1. Import the Management Pack (MP) as you would import any other MP following the standard Microsoft import from disk steps here.

  2. Create a Run As account in SCOM to hold the credentials of your service account. This is in the SCOM console under Administration > Run As Configuration > Accounts, where you will need to right-click and select Create Run As Account

  3. The Run As account type is Basic Authentication and make sure you distribute the credentials to all SCOM Management Servers (or the discoveries you will configure next will not work consistently)

  4. The MP creates a Profile that you will need to associate the credentials with. In the SCOM console navigate to Administration >Run As Configuration > Profiles and find the “Cookdown: ServiceNow Monitoring API Probe Account”

  5. right-click the profile, select properties. Click through the wizard until you get to the Run As Accounts page. On this page click Add and find the Run As account you just created in SCOM

  6. Complete the wizard

  7. The discoveries that find your ServiceNow instance are disabled by default. To enable them in the SCOM Console, navigate to Authoring > Management Pack Objects > Object Discoveries

  8. Change the scope of the view to “ServiceNow Instance”

  9. Override the (disabled by default) discovery shown for any Windows Computer you want to monitor your ServiceNow instance from by picking the specific objects from the Windows Computer class

  10. When you have selected the specific Windows Computer to monitor for you are shown the three parameters of our discovery, Fill these in and save your override to enable ServiceNow instance discovery:

    1. Enabled - controls whether our discovery is enabled or disabled

    2. InstanceUrls - contains the ServiceNow URLs you wish to monitor. This field accepts a comma-separated list of instance URLs. Each instance should be followed by a “/” for it to be recognized (for example “https://mycompanyservicenowinstance.service-now.com/”)

    3. LocationName - the friendly name that is shown in the UI for the watcher created for this location

  11. Repeat the previous step from all Windows Computer you expect the discovery to run from (your remote sites)

  12. The result of the discovery is a Distributed Application (DA) that looks like the below:

  1. The MP should collect performance metrics from your ServiceNow instance’s nodes also

Once Setup

When the SCOM MP has been imported and the needed overrides have been created, SCOM will discover your ServiceNow instance, nodes and will expose key performance counters.

Default Views

Out of the box the above views are added to SCOM

Support

This is a free community management pack so it is made available “as is” and is provided without support. The source code is made available on GitHub here: https://github.com/cookdown/ServiceNow-Monitoring-MP

If you have a technical question please raise an issue against the GitHub repository or use community.squaredup.com

Known Issues

ServiceNow watchers not discovered & an error is thrown to the event log

Issue: I see the below error thrown to the event log and no ServiceNow watchers are discovered once I have the MP setup

Solution: This issue is caused by the ServiceNow service account you are using not having permissions to the “sys_cluster_state” table. Please grant the account permissions to this table to prevent this issue

Event Log error:

Failed to run the PowerShell script due to exception below, this workflow will be unloaded.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.EnterpriseManagement.HealthService.MalformedDataItemException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Unrecognized Guid format.

at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)

at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)

at System.Guid..ctor(String g)

at Microsoft.EnterpriseManagement.Modules.DataItems.Discovery.RelationshipInstance..ctor(XmlReader reader)

--- End of inner exception stack trace ---

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at Microsoft.EnterpriseManagement.Mom.Internal.Xml.XmlReaderHelper.ReadElementAsItem[TItemType](String itemName)

at Microsoft.EnterpriseManagement.Mom.Internal.Xml.XmlReaderHelper.ReadElementsAsArray[TItemType](String itemName)

at Microsoft.EnterpriseManagement.Mom.Internal.Xml.XmlReaderHelper.ReadContainerElementAsArray[TItemType](String containerName, String itemName)

at Microsoft.EnterpriseManagement.Modules.DataItems.Discovery.DiscoveryDataItem.InitializeExtendedDataFromXml(XmlReader reader)

at Microsoft.EnterpriseManagement.Modules.DataItems.Discovery.DiscoveryDataItem..ctor(XmlReader reader)

--- End of inner exception stack trace ---

at Microsoft.EnterpriseManagement.Modules.DataItems.Discovery.DiscoveryDataItem..ctor(XmlReader reader)

--- End of inner exception stack trace ---

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at Microsoft.EnterpriseManagement.HealthService.DataItemBase.CreateDataItemFromXml(ConstructorInfo dataItemConstructor, String itemXml)

at Microsoft.EnterpriseManagement.Modules.PowerShell.PipelineResults.GetDataItemFromOutput(PowerShellOutputType outputType, Int32 serializationDepth, Collection`1 output, String scriptOutput)

at Microsoft.EnterpriseManagement.Modules.PowerShell.PipelineResults..ctor(PowerShellOutputType outputType, Int32 serializationDepth, Exception scriptException, PipelineState pipelineState, Collection`1 output, String scriptOutput)

--- End of inner exception stack trace ---

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at Microsoft.EnterpriseManagement.Common.PowerShell.RunspaceController.GetDataFromOutput[T](Object[] constructorArgs, Exception scriptException, PipelineState pipelineState, Collection`1 output, String scriptOutput)

at Microsoft.EnterpriseManagement.Common.PowerShell.RunspaceController.RunScript[T](String scriptName, String scriptBody, Dictionary`2 parameters, Object[] constructorArgs, IScriptDebug iScriptDebug, Boolean bSerializeOutput)

at Microsoft.EnterpriseManagement.Modules.PowerShell.PowerShellProbeActionModule.RunScript(RunspaceController runspaceController)

Script Name: DiscoverServiceNowMonitoring.ps1

One or more workflows were affected by this.

Workflow name: CookdownCommunity.ServiceNow.Monitoring.DiscoveryWatchersAndInstances

Instance name: cookdown.service-now.com

Instance ID: {57CEB508-8DA8-15F1-97A7-39267A82}

Management group: SCOM_12