Two weeks ago I decided to write a PowerShell script for the purpose to check the whole IaaS usage metering configuration of System Center & Windows Azure Pack. As you already may know I have some kind of addiction for the usage metering & reporting process and the troubleshooting part.
-> https://www.danielstechblog.io/azure-like-chargeback-with-system-center-windows-azure-pack-part-1/
-> https://www.danielstechblog.io/azure-like-chargeback-with-system-center-windows-azure-pack-part-2/
-> https://www.danielstechblog.io/windows-azure-pack-iaas-usage-metering-reporting-troubleshooting/
-> http://channel9.msdn.com/Series/SCUE2014/Windows-Azure-Pack-Usage-Metering-Reporting-Troubleshooting-Guide
-> https://www.danielstechblog.io/system-center-2012-r2-service-reporting-troubleshooting/
From a troubleshooting perspective you have to check a lot of parts in the usage metering chain if something is broken and that is the reason why I wrote this script! Run it and you know where you have to fix the broken usage metering chain.
The requirements for your workstation to run this script are the following ones.
- System Center 2012 R2 VMM PowerShell Cmdlets (Installed VMM console)
- System Center 2012 R2 OpsMgr PowerShell Cmdlets (Installed OpsMgr console)
The next maybe conflict with some of your security strategies. You need an account that has access or full access to the following components.
- SCVMM
- SCOM
- Service Provider Foundation
- Windows Azure Pack usage server
- Service Reporting
- SQL server which hosts the SCOM database
- SQL server which hosts the SCOM data warehouse database
- SQL server which hosts the SPF database
- SQL server which hosts the WAPack Microsoft.MgmtSvc.Usage database
- SQL server which hosts the Service Reporting database
- SQL server which hosts the Service Reporting analysis services database
Before you can run the script you have to edit the variables from line 20 to line 38 in the script to fit your environment.
Variable | Description |
$VMMServer | FQDN of the VMM management server e.g. srv-1.neumanndaniel.local |
$SPFServer | FQDN of the SPF server e.g. srv-2.neumanndaniel.local |
$SPFLBName | FQDN of the SPF Load Balancer e.g. srv-2.neumanndaniel.local If you are not using a LB use the FQDN of the SPF server. |
$WAPackUsageServer | FQDN of the WAPack usage server e.g. srv-5.neumanndaniel.local |
$SRServer | FQDN of the Service Reporting server e.g. srv-5.neumanndaniel.local |
$OperationsManagerSQLServer | SQL server and instance name of the SQL server which hosts the SCOM database e.g. SRV-2SCOM |
$OperationsManagerDWSQLServer | SQL server and instance name of the SQL server which hosts the SCOM data warehouse database e.g. SRV-2SCOM |
$OperationsManagerDBName | Name of the SCOM database e.g. OperationsManager |
$OperationsManagerDWDBName | Name of the SCOM data warehouse database e.g. OperationsManagerDW |
$SRSQLServer | SQL server and instance name of the SQL server which hosts the Service Reporting database e.g. SRV-5SR |
$SRSQLAnalysisServer | SQL server and instance name of the SQL server which hosts the Service Reporting analysis services database e.g. SRV-5SR |
$SRSQLAnalysisDBName | Name of the Service Reporting analysis services database e.g. UsageAnalysisDB |
$SPFSQLServer | SQL server and instance name of the SQL server which hosts the Service Provider Foundation database e.g. SRV-2SPF |
$WAPackSQLServer | SQL server and instance name of the SQL server which hosts the WAPack Microsoft.MgmtSvc.Usage database e.g. SRV-5WAP |
$SPFUsageUser | Service account which has been used during the SPF installation e.g. NEUMANNDANIELspf |
$SRSQLUser | Service account which has been used during the Service Reporting SQL server installation for the SQL database service e.g. NEUMANNDANIELspf |
$SRSQLAgentUser | Service account which has been used during the Service Reporting SQL server installation for the SQL agent service e.g. NEUMANNDANIELspfagent |
$SRPathWD | Path to the directory WorkDir on the Service Reporting server e.g. C:Program FilesMicrosoft System Center 2012 R2Service ReportingWorkDir |
$SRPathSP | Path to the directory SSISPackages on the Service Reporting server e.g. C:Program FilesMicrosoft System Center 2012 R2Service ReportingSSISPackages |
After a run the script will show you the following output for a correct usage metering configuration.
But the output values can be different depending if your configuration is correct or not. Have a look at the following table which output values you get for the different tests.
Test | Output |
VMM SCOM Connection Status | OK | Unhealthy | Broken |
SPF Get-SCSPFServer: SCOM Management Server Name | Match | Mismatch |
SPF Get-SCSPFSetting: SCOM DW SQL | Match | Mismatch |
SPF Get-SCSPFSetting: SCOM Management Server Name | Match | Mismatch |
SPF Website Status | OK | Broken |
SPF Usage Application Pool Status | OK | Broken |
SPF Usage Account OpsMgr DW DB User Status | OK | Missing |
SPF Usage Account OpsMgrReader Membership Status | OK | Missing |
WAPack Service Provider Usage: SPF Usage Account | Match | Mismatch |
WAPack Service Provider Usage: Forwarding Address | Match | Mismatch |
WAPack Usage Website Status | OK | Broken |
WAPack Usage Collector Website Status | OK | Broken |
WAPack Usage Application Pool Status | OK | Broken |
WAPack Usage Collector Application Pool Status | OK | Broken |
WAPack Last Usage Record Index and SPF Last Usage Record Index Status | Match | Mismatch |
WAPack Provider Configuration Usage Record Index and SPF Last Usage Record Index Status | Match | Mismatch |
WAPack Usage Provider Collection Cycle Download Status | OK | Error |
Service Reporting SQL Agent Account OpsMgr DB User Status | OK | Missing |
Service Reporting SQL Agent Account db_datareader Membership Status | OK | Missing |
Service Reporting SQL Account SQL Analysis DB SR_Administrator Membership Status | OK | Missing |
Service Reporting SQL Agent Account SQL Analysis DB SR_Administrator Membership Status | OK | Missing |
Service Reporting DW System Job Last Run Status | OK | Failed |
Service Reporting SQL Agent Account SSISPackages Directory Security Status | OK | Missing |
Service Reporting SQL Agent Account SSISPackages Directory Permission Status | OK | Denied |
Service Reporting SQL Agent Account WorkDir Directory Security Status | OK | Missing |
Service Reporting SQL Agent Account WorkDir Directory Permission Status | OK | Denied |
You can download the PowerShell script from the TechNet Gallery.
-> https://gallery.technet.microsoft.com/System-Center-Windows-7091e0e1