We are excited to announce that we have released the Microsoft Dynamics NAV 2013 R2 Management Pack for System Center. You can find the Management Pack and guide on the Microsoft Download Center here:http://www.microsoft.com/en-in/download/details.aspx?id=36388. The guide walks you through the details of deploying, configuring and using the management pack.

In this blog, we are focusing on describing the benefits of the management pack, as well as some of the internals of how it works, and how it is meant to be used.

What is new in the Management Pack?

The Microsoft Dynamics NAV 2013 R2 Management Pack for System Center is built on top of the previous version. The new features include:

New rules that collect data on all Microsoft Dynamics NAV performance counters.

Two new monitors for Microsoft Dynamics NAV Server instances. One of the monitors checks certificates that protect communication for the different communication endpoints. The other monitor checks the health of the individual tenants that are mounted on the server instances.

The new monitors are simple event-based monitors that use events that are logged by each server instance. Therefore, each server instance is responsible for notifying the management pack about its own health. For certificates, this functionality is built into the server, but for tenants the story is a little different.

Monitoring tenants with the Task Scheduler

Microsoft Dynamics NAV 2013 R2 does not have built in monitoring, but combined with the windows Task Scheduler, an administrator can create logic that can be used to determine tenants’ health. Rules can be created that detect issues, automatically perform recoveries, and ultimately notify an operations manager of issues if the recoveries are not successful.

Notifying and alerting an operations manager is handled via events, so the management pack has a set of simple event monitors that are triggered based on these events. Events are logged to the Windows Application event log of the computer hosting the Microsoft Dynamics Server instances.

An example

The following is an example of a Task Scheduler task that can be used for monitoring whether all tenant databases are available.

This tasks runs a Windows PowerShell script that contains the actual logic. The script runs every minute. The scripts must be run in elevated mode (as an Administrator) and created as a Microsoft Dynamics NAV user.

The task expects a working directory that is named C:\ScheduledMonitoring and contains the PowerShell script Test-TenantDB.ps1

The script iterates through all the tenants hosted by all the local Microsoft Dynamics NAV Server instances, and invokes the OnRun function on Codeunit 1. The OnRun function contains no logic, so the invocation will just act as a ping, which detects whether the tenant database is available.

The Invoke-NAVCodeunit script can be used for multiple purposes. It is very easy to use the following template to invoke random methods and execute real synthetic transactions that make sense in your environment.

Generating event log entries that will be escalated to SCOM

There are two generic event log monitors in the management pack, one for server instances and one for mounted tenants. These monitors are described in detail in the Management Pack Guide for Microsoft Dynamics NAV 2013 R2. The communication with these monitors is rather simple when creating scheduled monitoring tasks. Basically, you can run any type of logic that matches your infrastructure and application, and then either rely on the server instance to create the proper events or create escalation events in your script.

For a server instance named DynamicsNAV71, the format looks like this:

# write a generic server instance event log entry that will be picked up by SCOM