Monitor File existence

Standard

In this blogpost I am going to take you true the steps I took to create a two state monitor which checks if a file exist.

A big thank’s to Pete Zeger and Kevin Holman for creating the VB script to check if a file exist.

You can download the script from here

Now that we have script I took the following steps to create the two state Monitor

  1. Start the “System Center operations Mananger Concole"
  2. In the “Navigation" pane, click “Administration
  3. From the “Administration” page, right click “Management Pack” and click “Create Management Pack.Create Management Pack
  4. On the “Create a Management Pack” wizard on the “General Properties” page in the “Management pack General Properties” section enter a “Name” and click “Next
  5. On the “Create a Management Pack” wizard on the “Knowledge” page in the “Knowledge” section click “Create
  6. In the “System Center Operations Manager Console” in the “Navigation” pane, click “Authoring
  7. From the “Authoring” page, expand “Management Pack Objects”, right click “Monitors” click “Unit Monitor” and click “Unit MonitorCreateUnitMonitor
  8. In the “Create a unit Monitor” wizard, on the “Monitor Type” page, in the “Select the type of monitor to create” section expand “Scripting”, “Generic” and select “Timed Script Two State Monitor
  9. In the “Create a unit Monitor” wizard, on the “Monitor Type” page, in the “Management pack” section, select the above created “Management pack” and click “Next

    CreateUnitMonitor1

  10. In the “Create a unit Monitor” wizard, on the “General” page, in the “General Properties” section enter a “Name” and “Description”.
  11. In the “Create a unit Monitor” wizard, on the “General” page, in the “General Properties” section click “Select” tot target the Monitor
  12. In the “Select Items tot target” in the “Look for” bar enter “Windows Server” and select the target “Windows Server” and click “OK

    CreateUnitMonitor2

  13. In the “Create a unit monitor” wizard, on the general page uncheck “Monitor is enabled” and click “Next

    CreateUnitMonitor3

  14. In the “Create a unit Monitor” wizard, on the “Schedule” page, click “Next
  15. In the “Create a unit monitor” wizard, on the “Script” page, in the “Enter script information” section enter the name “DoesFileExist.vbs” copy the script into the Script section. and click “NextCreateUnitMonitor4
  16. In the “Create a unit monitor” wizard, on the “Unhealthy Expression” page in the “File one or more events” section click “Insert” and  “Or groupCreateUnitMonitor5
  17. In the “Create a unit monitor” wizard, on the “Unhealthy Expression” page in the “Filter one or more events” section enter the following settings:
    • Parameter: “Property[@Name=’FolderExists’]
    • Operator: “Equals
    • Value: “No

    In the “Create a unit Monitor” wizard, on the “Unhealthy Expression” page in the “Filter one or more events” section click “Insert” and click “Expression”. Enter the following settings:

    • Parameter: “Property[@Name=’FileExists’]
    • Operator: “Equals
    • Value: “No

    Click  "Next"

    CreateUnitMonitor8

  18. In the “Create a unit monitor” wizard, on the “Healthy Expression” page in the “File one or more events” section click “Insert” and  “And groupCreateUnitMonitor7
  19. In the “Create a unit monitor” wizard, on the “Healthy Expression” page in the “Filter one or more events” section enter the following settings:
    • Parameter: “Property[@Name=’FolderExists’]
    • Operator: “Equals
    • Value: “Yes

    In the “Create a unit Monitor” wizard, on the “Healthy Expression” page in the “Filter one or more events” section click “Insert” and click “Expression”. Enter the following settings:

    • Parameter: “Property[@Name=’FileExists’]
    • Operator: “Equals
    • Value: ”

    Click “Next

    CreateUnitMonitor6

  20. In the “Create a unit monitor” wizard, on the “Configure Health” page in the “Map monitor conditions to heath state” section enter the following settings:
    • Monitor condition: “Unhealthy
    • Operation State: “Unhealthy
    • Health State: “Critical"
    • Monitor Conditions: “Healthy
    • Operation State: “Healthy
    • Health State: “Healthy

    Click “NextCreateUnitMonitor9

  21. In the “Create a unit monitor” wizard, on the “Configure alerts” page in the “Alert Setting” section. Check “Generate alerts for this monitorCreateUnitMonitor10
  22. In the “Create a unit monitor” wizard, on the “Configure Alerts” page in the “Alert properties” section enter the following settings:
    • Alert Name: “File Exist
    • Alert Description: “The following files or folders are missing:””Folder: $Data/Context/Property[@Name=’FolderExists’]$””File: $Data/Context/Property[@Name=’FileExists’]$
    • Priority: “Medium
    • Severity: “”Critical

    Configure Alerts Click “Create

Now that the two state monitor is created it’s time to configure the monitor.

  1. Start the “System Center Operations Manager” Console.
  2. In the “Navigation" pane, click “Authoring
  3. From the “Authoring” page, expand “Management Pack Objects” and select “Monitors
  4. In the “Look for..” enter the Name of the above created monitor Monitor File Exists
  5. Right click on the two state Monitors name and click “Properties
  6. On the “<Name> File Exist Properties” page, select the “Script” tab Script
  7. On the “<Name> File Exist Propertis” page, on the “Script” tab click “Parameters
  8. On the “Script – DoesFileExist.vbs” page, in the “Parameters” section en the following lines:
    • ”C:\test” “test.txt”Enter Parameters 

    Click “OK

  9. On the “<Name> File Exist Properties” page, on the “Script” tab click “Apply” and click “OK

Now that we have the parameters Configured we have to override the monitor to be used for a certain computer.

  1. Start the “System Center Operations Manager” Console
  2. In the “Navigation" pane, click “Authoring
  3. From the “Authoring” page, expand “Management Pack Objects” and select “Monitors
  4. In the “Look for..” enter the Name of the above created monitor
  5. Expand “Windows Server” and right click “<Name> File Exist Monitor” click “Overrides”, “Override the Monitor” and click “For al specific object of class: Windows ServerOverride Monitor
  6. In the “Select Object” pane in the the “Text string” bar enter the computer name where you want to override the monitor for. In the “Matching objects” display select the computer and click “OKSelect Object
  7. On the “Overrides Properties” page in the “Override-controlled parameters” change the following settings:
    • select “Parameter Name”: “Enable
    • change the “Override Value”: to “True 

    Click “Apply” and click “OK

The result should look something like this:

  • When the file doesn’t existsFile Not Exist
  • When the file and the folder doesn’t exists:File and Folder Not Exist
  • When the file and the folder exists:File Exist

Updates MP: System Center Management Pack for Windows 8 and 8.1 Client Operating System

Standard

On 18-January-2016 Microsoft released  an update of the System Center Management Pack for Windows 8 and 8.1 Client Operating System to version: 6.0.7251.0

  • System Center Management Pack for Windows 8 and 8.1 Client Operating System The features and fixes that are included in this update:
    • Feature:
      • Changed discovery of Win 8 client computer and Win 8 client OS data sources to fix the issue with discovering Win 10 computers by Win 8 MP. Instead of registry provider now we use registry and WMI to find version of the OS
      • Added Alert Messages to the following monitors: CPU Percentage Utilization, CPU DPC Time Percentage, CPU Percentage Interrupt Time
      • Added a group populator for Win 8.1 Business Critical group
    • Fix:
      • Windows 8 Aggregate Physical Disk Discovery
      • Discover Network Adapters (Only Enabled) and Discover Network Adapters (Both Enabled and Disabled) discoveries
      • Windows 8 MP Aggregate reports failure issue occurring while running reports under standard service account by granting appropriate permissions in Install and Upgrade sections scripts of DW datasets

Before installing the updates in your production environment make sure you test these updates in your test environment

An object of class MonitoringAlert with ID was not found

Standard

In my test environment I was runnning into the following event when opening an active alert:

OperationsManagerError

When you access the System Center Operations Manager Console, the alerts are cached  in your profile in a file called momcache.mdb.

The System Center Operations Manager user console creates a cache file in %localappdata%\Microsoft\Microsoft.EnterpriseManagement.Monitoring.Console. To resolve the above error there are 2 options.

  • Use the “clearcache” option:
    1. Right Click on the "System Center Operations Manager" and select “Properties
      Properties System Center Operations Manager Console
    2. On the “Operations Console Properties” page on the “Shortcut” tab in the “Target” section enter “”C:\Program Files\System Center 2012\Operations Manager\Console\Microsoft.EnterpriseManagement.Monitoring.Console.exe" /clearcache"
      PropertiesSystemCenterConsole2
  • Delete the “momcache.mdb” from the file location “%localappdata%\Microsoft\Microsoft.EnterpriseManagement.Monitoring.Console