SNMP Device Polling
Every organization has a device or two that requires some version of SNMP communication for monitoring. There are several ways you can monitor an SNMP device in Operations Manager 2007. You can use WMI or you can use the rules contained in the Authoring pane of the Ops Mgr 2007 console. Since Operations Manager 2007 supports SNMPv1 and v2c (thanks to KB939364 for v1 support), there really isn’t much of a need to pull SNMP data from scripts. If you are using System Center Essentials 2007, then you can only support SNMPv2 devices and v1 support is not expected until sometime next year. In the mean time, here is a solution you can use to poll SNMP v1 devices for monitors and rules.
You can use this freeware DLL called System Scripting Runtime and it can do a number of things but most importantly it can do SNMP polling based off the OID on SNMPv1 devices. The script link I am including in this article is a sample of how to poll an OID on a specific device and return it via a property bag to Operations Manager. This script will also log events in the case of any problems (or successful polls depending on configuration).
When you use this script from a monitor, be sure to use this XPATH statement $property[@Name=’Result’] for your evaluations. Here is the command line parameters for the script.
Argument 1: target device (IP or DNS name)
Argument 2: OID
Argument 3: Community string
Argument 4: Set to 1 if you want log success events.
Set to 0 if you do not want to log success events.
Sample: 192.168.0.5 .1.3.6.1.4.1.534.1.3.5.0 public 1
Argument 1: 192.168.0.5
Argument 2: .1.3.6.1.4.1.534.1.3.5.0
Argument 3: public
Argument 4: 1
System Scripting Runtime
Info: http://www.netal.com/ssr.htm
Download: http://www.netal.com/Software/SSR15.ZIP
SNMP Polling Script
Download: http://systemcenterforum.org/wp-content/uploads/SNMPPoll.zip
Create a new Reporting User Role using Powershell
Eugene Bykov posted a Powershell snippet that will add a new Reporting User Role in Operations Manager. You can view the original post at the following URL:
http://blogs.msdn.com/eugenebykov/archive/2007/10/13/creating-new-report-operator-user-role.aspx
I have modified the script to work from the command line with the following parameters.
Parameters:
rootMS: The FQDN or NetBIOS name of the Root MS.
roleUserName: The name User Role.
roleDisplayName: The Display Name of the role.
roleDescription: The description of the role.
Sample Command Line:
Powershell ./AddReportingUserRole.ps1 rootMS.server.local DBTestRole ‘Test DB Role’ ‘A test role created by Powershell’
You can download the updated script here.
Enable ACS in bulk through Powershell
This script was provided during the Operations Manager 2007 Beta by Joseph Chan @ Microsoft. The original script enabled ACS on all agents to the provided ACS collector. I have copied this script and modified it to take the Display Name of the group as a parameter so you can control what agents are enabled.
You can download the All Agents Bulk Enable here.
Parameters:
rmsServerName: The FQDN of the root
collectorServerName: The FQDN of the ACS Collector
You can download the Display Name Bulk Enable here.
Parameters:
rmsServerName: The FQDN of the root
collectorServerName: The FQDN of the ACS Collector
displayName: The display name of the group. Ex: ‘Sample group’
List Ops Mgr Group Membership using Powershell
There are two scripts available in the downloads area that will allow administrators to list group membership and output that data to a text file. The scripts work the same except they require two different types of input to identify the group.
The first script requires the Display Name of the group to find it. Here is the syntax of the script and the link to download it.
Syntax:
rootMS: the root management server. It can be a NetBIOS name or FQDN.
Ex: rootMS.server.local
groupName: The display name of the group like "All Computers Group"
pathName: The path and file name that the script will write the results to.
Sample Command Line:
Powershell ./ListGroupMemebrsUsingDisplayName.ps1 rootMS ‘All Computers’ c:\test.txt
You can get the Display Name version here.
The second script requires the Path Name of the group to find it. Here is the syntax of the script and the link to download it.
Syntax:
rootMS: the root management server. It can be a NetBIOS name or FQDN.
Ex: rootMS.server.local
groupPath: The display name of the group like "Microsoft.SystemCenter.AllComputersGroup"
pathName: The path and file name that the script will write the results to.
Sample Command Line:
Powershell ./ListGroupMemebrsUsingDisplayName.ps1 rootMS Microsoft.SystemCenter.AllComputersGroup c:\test.txt
You can get the Path Name version here.
OM 2007: UNISYS MP AVAILABLE
UNISYS has release the Operations Manager 2007 MP for their Server Sentinel Interface Products. You will need to register to get access for the download.
You can download the MP from here!
Thanks to Joseph Morales @ UNISYS for the notification.
Using Event Descriptions in Alerts and Monitors
The question of “What XPath statement do I use to display the Event description” comes up often enough for us to forget. It would be nice if the Ops Mgr Team would release a document that contains the ‘commonly used‘ XPath statements for Ops Mgr Administrators but don’t hold your breath…..
Here are the XPath statements to display event data in monitors and rule-generated alerts..
Monitors
$Data/Context/EventDescription$
Rule-Generated Alerts
$Data/EventDescription$
SCE Disaster Recovery Part 3 - Symmetrical Key backup for SDK Service
When SCE is installed for the first time, a symmetrical key is created for the purpose of encrypting RunAs account data for storage in the DB. In the case of a disaster on the SCE server, if you do not have this key, then the RunAs information contained in the database is completely worthless and you would have to reconfigure the RunAs account information. A utility is provided with SCE called SecureStorageBackup.exe located in the \SupportTools directory of the distribution media. This utility will backup or restore the symmetrical encryption key used by the SDK service.
Usage
SecureStorageBackup <Backup|Restore> <BackupFile>
When you run the following command to backup the key, it will prompt you for a password. Microsoft recommends that the password be 8 characters long with at least 1 special character.
SecureStorageBackup Backup C:\backup.key
When you run the following command to restore the key, you will need to enter the password previously used to export the key.
SecureStorageBackup Restore C:\backup.key
When should I do this?
You should perform this very soon after a SCE install and keep it in a safe place. Be sure to keep the password in a safe place as well because if you forget that, then what is the point of having the file
The following link provides a little more information about the utility. Even though it pertains to Operations Manager 2007, it is still applicable to SCE.
How to Backup and Restore Encryption Keys in Operations Manager 2007
SCE Disaster Recovery Part 2 - Backing up Un-Sealed Management Packs
We have talked about the backup of the SQL database, but what about unsealed management packs? In Operations Manager 2007, you can use the Command Shell to export all sealed & unsealed management packs to where ever you want using almost any query you want. So how can you automate that in SCE? You can export a management pack from the SCE UI but that can become tedious if you have more than one and it doesn’t solve the automation problem. If you are brave, you could explore your way through an unsupported version of the SCE Command Shell (SystemCenterForum.org Article - SCE Custom Command Shell) or you can find a utility. I decided to go the easier route and find a utility. In the Ops Mgr 2007 SDK, there is an example of exporting an MP with a particular name. With a little work, the snippet was modified to look for all unsealed management packs and a user driven target path for the XML. I have tested this on SCE and OM ‘07 and it works well. I would like to thank whoever put that code snippet in the SDK because I probably would have fumbled around for about 2 weeks to figure everything out.
Parameters:
The only parameter is the path to the location where you want to save all management packs.
Ex. MPExportCMD.exe C:\MPBackup\
This command line example will save all management packs to C:\MPBackup. You will need to be sure that you put the trailing ‘\‘ at the end of the path otherwise the XML files will be save to the wrong directory.
The easiest way to implement this is to use the Scheduled Tasks feature in the Control Panel to schedule when the MP backup happens.
You can get the file here.
Even though sealed Management Packs were not addressed previously, you should save all non-default Management Packs to a directory that is a part of a backup.
FYI, this is the first run of this utility so if you have any comments or feature requests, feel free to respond to this post or the Contact page on Systemcenterforum.org.
SCE 2007: Disaster Recovery Part 1 - Backing up a SCE SQL express edition Instance
When using an application that interfaces with SQL, you will usually want to backup the SQL databases as part of safeguarding that application data. SCE is no different and if you are using SQL Server Express Edition that comes with SCE, then you will be at a disadvantage. SQL Server Express Edition does not come with a SQL Server Agent to schedule and perform maintenance tasks. So if you want to schedule a backup that grooms old files, then you will have to find another way besides the GUI. SQL Server does come with SQLCMD that performs SQL functions from the command line. If you couple this with the Task Scheduler, then you can schedule a backup task. SQL MVP Brian Knight has created a SQL script and batch file to automate this process and the files can be found at http://www.whiteknighttechnology.com/cs/blogs/brian_knight/archive/2006/08/13/215.aspx
Make the following changes you and will have a working backup of your SCE DB.
1. Download the zip file and extract it to any directory you would like
2. Open the file called BackupExpress.sql and edit line 43. In the quotations, replace the path C:\Backups with the desired path. Save the file
3. Create a new Scheduled task with the following command line:
sqlcmd -S RSM01\SCE -i E:\BackupExpress.sql -o E:\backup\SQL\backup.log
Notice that our server is named RSM01 but we have added a \SCE because by default SCE will install with a named instance when using SQL Express Edition. Just replace the name of the sample server name above with your SCE server name and leave the \SCE at the end.
The -i and -E parameters are fairly self explanatory and straightforward. Concerning the .SQL file, just replace the path with the designated path of your modified BackupExpress.sql file. For the log file location, you can set this anywhere you like, just include the full path.
You can schedule the task to whatever suites your business needs or IT limitations. If you are using another version like SQL Standard or Enterprise Edition with your SCE installation, then you should be using teh SQL Server Agent and Maintenance plans for data backup.
View all Ops Mgr 2007 objects in Maintenance from Powershell
Boris Yanushpolsky updated his blog recently (link) that included a Powershell function that would show all objects in maintenance. I thought this was very cool but I wanted to see how our Systemcenterforum.org maintenance script (link) would work with this script. When I tested this against our lab domain controller, the results were good. The script from Boris reported all objects on the server that was in maintenance. Below is a snippet of what was reported to be in maintenance:
DisplayName : Windows Time
Object Type : Windows Time
Start Time : 8/7/2007 4:16:24 PM
End Time : 8/7/2007 4:21:24 PM
Path : NOCDC01.noc.momresources.org;NOCDC01
User : MOMRESOURCES\Administrator
Reason : SecurityIssue
Comment :
DisplayName : Default Web Site
Object Type : IIS 2003 Web Site
Start Time : 8/7/2007 4:16:24 PM
End Time : 8/7/2007 4:21:24 PM
Path : NOCDC01.noc.momresources.org
User : MOMRESOURCES\Administrator
Reason : SecurityIssue
Comment :
DisplayName : NOCDC01
Object Type : Active Directory Domain Controller Server 2003 Computer Role
Start Time : 8/7/2007 4:16:24 PM
End Time : 8/7/2007 4:21:24 PM
Path : NOCDC01.noc.momresources.org
User : MOMRESOURCES\Administrator
Reason : SecurityIssue
Comment :
Next Page »