Solved

Problem with querying WMS perfmon counters with VBS/Nagios

Posted on 2009-03-31
6
852 Views
Last Modified: 2012-05-06
I have run into quite an odd problem today and wonder if someone else had observed it, or better - solved it. We have two Windows Media Servers - one with W2k3 Standard 32-bit edition server and second one with Wsk3 Enterprise x64 edition. Both have Nagios client installed, since we use Nagios Server to monitor them. The Standard edition one responds to Nagios monitoring all right, giving us data about all requested performance monitor counters including those associated with WMS, the second one (Enterprise x64) properly responds for querying the system counters (and any other afaik) _excluding_ all those associated with WMS.

We have tried another approach by runing attached query against those WMS counters via VBS scripts (automaticaly generated with Scriptomatic 2.0) - the same on both servers (forgive the long query but I am quite new to VBS and mostly use automaticly generated scripts). On the Standard 32-bit edition this went smoothly giving us output like:

==========================================
Computer: **-**-SERVER
==========================================
Caption:
CurrentConnectedPlayers: 0
CurrentFileReadRateKbps: 0
CurrentLateReadRate: 0
CurrentOutgoingDistributionAllocatedBandwidthKbps: 0
CurrentOutgoingDistributionConnections: 0
CurrentPlayerAllocatedBandwidthKbps: 0
CurrentStreamErrorRate: 0
CurrentStreamingHTTPPlayers: 0
CurrentStreamingMMSPlayers: 0
CurrentStreamingPlayers: 0
CurrentStreamingRTSPPlayers: 0
Description:
Frequency_Object:
Frequency_PerfTime:
Frequency_Sys100NS:
Name: /
PeakConnectedPlayers: 0
PeakOutgoingDistributionAllocatedBandwidthKbps: 0
PeakOutgoingDistributionConnections: 0
PeakPlayerAllocatedBandwidthKbps: 0
PeakStreamingPlayers: 0
Timestamp_Object:
Timestamp_PerfTime:
Timestamp_Sys100NS:
TotalAdvertisements: 0
TotalConnectedPlayers: 0
TotalFileBytesRead: 0
TotalLateReads: 0
TotalOutgoingDistributionBytesSent: 0
TotalOutgoingDistributionConnections: 0
TotalPlayerBytesSent: 0
TotalStreamDenials: 0
TotalStreamErrors: 0
TotalStreamingPlayers: 0
TotalStreamTerminations: 0

Caption:
CurrentConnectedPlayers: 0
CurrentFileReadRateKbps: 0
CurrentLateReadRate: 0
CurrentOutgoingDistributionAllocatedBandwidthKbps: 0
CurrentOutgoingDistributionConnections: 0
CurrentPlayerAllocatedBandwidthKbps: 0
CurrentStreamErrorRate: 0
CurrentStreamingHTTPPlayers: 0
CurrentStreamingMMSPlayers: 0
CurrentStreamingPlayers: 0
CurrentStreamingRTSPPlayers: 0
Description:
Frequency_Object:
Frequency_PerfTime:
Frequency_Sys100NS:
Name: Cache\Proxy On-Demand
PeakConnectedPlayers: 0
PeakOutgoingDistributionAllocatedBandwidthKbps: 0
PeakOutgoingDistributionConnections: 0
PeakPlayerAllocatedBandwidthKbps: 0
PeakStreamingPlayers: 0
Timestamp_Object:
Timestamp_PerfTime:
Timestamp_Sys100NS:
TotalAdvertisements: 0
TotalConnectedPlayers: 0
TotalFileBytesRead: 0
TotalLateReads: 0
TotalOutgoingDistributionBytesSent: 0
TotalOutgoingDistributionConnections: 0
TotalPlayerBytesSent: 0
TotalStreamDenials: 0
TotalStreamErrors: 0
TotalStreamingPlayers: 0
TotalStreamTerminations: 0

Caption:
CurrentConnectedPlayers: 0
CurrentFileReadRateKbps: 0
CurrentLateReadRate: 0
CurrentOutgoingDistributionAllocatedBandwidthKbps: 0
CurrentOutgoingDistributionConnections: 0
CurrentPlayerAllocatedBandwidthKbps: 0
CurrentStreamErrorRate: 0
CurrentStreamingHTTPPlayers: 0
CurrentStreamingMMSPlayers: 0
CurrentStreamingPlayers: 0
CurrentStreamingRTSPPlayers: 0
Description:
Frequency_Object:
Frequency_PerfTime:
Frequency_Sys100NS:
Name: Cache\Proxy Broadcast
PeakConnectedPlayers: 0
PeakOutgoingDistributionAllocatedBandwidthKbps: 0
PeakOutgoingDistributionConnections: 0
PeakPlayerAllocatedBandwidthKbps: 0
PeakStreamingPlayers: 0
Timestamp_Object:
Timestamp_PerfTime:
Timestamp_Sys100NS:
TotalAdvertisements: 0
TotalConnectedPlayers: 0
TotalFileBytesRead: 0
TotalLateReads: 0
TotalOutgoingDistributionBytesSent: 0
TotalOutgoingDistributionConnections: 0
TotalPlayerBytesSent: 0
TotalStreamDenials: 0
TotalStreamErrors: 0
TotalStreamingPlayers: 0
TotalStreamTerminations: 0

Caption:
CurrentConnectedPlayers: 320
CurrentFileReadRateKbps: 0
CurrentLateReadRate: 0
CurrentOutgoingDistributionAllocatedBandwidthKbps: 0
CurrentOutgoingDistributionConnections: 0
CurrentPlayerAllocatedBandwidthKbps: 43073
CurrentStreamErrorRate: 0
CurrentStreamingHTTPPlayers: 288
CurrentStreamingMMSPlayers: 13
CurrentStreamingPlayers: 301
CurrentStreamingRTSPPlayers: 0
Description:
Frequency_Object:
Frequency_PerfTime:
Frequency_Sys100NS:
Name: stream1
PeakConnectedPlayers: 572
PeakOutgoingDistributionAllocatedBandwidthKbps: 0
PeakOutgoingDistributionConnections: 0
PeakPlayerAllocatedBandwidthKbps: 259152
PeakStreamingPlayers: 529
Timestamp_Object:
Timestamp_PerfTime:
Timestamp_Sys100NS:
TotalAdvertisements: 0
TotalConnectedPlayers: 153558
TotalFileBytesRead: 73240395797
TotalLateReads: 258894
TotalOutgoingDistributionBytesSent: 0
TotalOutgoingDistributionConnections: 0
TotalPlayerBytesSent: 6489956438712
TotalStreamDenials: 0
TotalStreamErrors: 6
TotalStreamingPlayers: 235635
TotalStreamTerminations: 2249

Caption:
CurrentConnectedPlayers: 52
CurrentFileReadRateKbps: 0
CurrentLateReadRate: 0
CurrentOutgoingDistributionAllocatedBandwidthKbps: 0
CurrentOutgoingDistributionConnections: 0
CurrentPlayerAllocatedBandwidthKbps: 15776
CurrentStreamErrorRate: 0
CurrentStreamingHTTPPlayers: 46
CurrentStreamingMMSPlayers: 1
CurrentStreamingPlayers: 47
CurrentStreamingRTSPPlayers: 0
Description:
Frequency_Object:
Frequency_PerfTime:
Frequency_Sys100NS:
Name: stream2
PeakConnectedPlayers: 371
PeakOutgoingDistributionAllocatedBandwidthKbps: 0
PeakOutgoingDistributionConnections: 0
PeakPlayerAllocatedBandwidthKbps: 226807
PeakStreamingPlayers: 289
Timestamp_Object:
Timestamp_PerfTime:
Timestamp_Sys100NS:
TotalAdvertisements: 0
TotalConnectedPlayers: 160183
TotalFileBytesRead: 97916245687
TotalLateReads: 245359
TotalOutgoingDistributionBytesSent: 0
TotalOutgoingDistributionConnections: 0
TotalPlayerBytesSent: 4151974586958
TotalStreamDenials: 0
TotalStreamErrors: 0
TotalStreamingPlayers: 208552
TotalStreamTerminations: 890

However on the Enterprise x64 edition the same script has generated no more than this:

==========================================
Computer: **-**-STREAMSRV
==========================================

Obviously something does not work here. This goes for every possible query against WMS related object. All other, like system objects, works just fine. I assume that our Nagios application have the same problem as we have, probably using the same mechanism to collect data. Is this a bug in x64 wersion? Have anyone tried to query those objects on similar system version as we have with any luck?

Interestingly Windows Perfmon does not have any problem with querying those counters on both servers... Please help! :-)
On Error Resume Next
 
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
 
arrComputers = Array("RM-STREAMSRV")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="
 
   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfFormattedData_WMServer_WindowsMediaPublishingPoints", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
 
   For Each objItem In colItems
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "CurrentConnectedPlayers: " & objItem.CurrentConnectedPlayers
      WScript.Echo "CurrentFileReadRateKbps: " & objItem.CurrentFileReadRateKbps
      WScript.Echo "CurrentLateReadRate: " & objItem.CurrentLateReadRate
      WScript.Echo "CurrentOutgoingDistributionAllocatedBandwidthKbps: " & objItem.CurrentOutgoingDistributionAllocatedBandwidthKbps
      WScript.Echo "CurrentOutgoingDistributionConnections: " & objItem.CurrentOutgoingDistributionConnections
      WScript.Echo "CurrentPlayerAllocatedBandwidthKbps: " & objItem.CurrentPlayerAllocatedBandwidthKbps
      WScript.Echo "CurrentStreamErrorRate: " & objItem.CurrentStreamErrorRate
      WScript.Echo "CurrentStreamingHTTPPlayers: " & objItem.CurrentStreamingHTTPPlayers
      WScript.Echo "CurrentStreamingMMSPlayers: " & objItem.CurrentStreamingMMSPlayers
      WScript.Echo "CurrentStreamingPlayers: " & objItem.CurrentStreamingPlayers
      WScript.Echo "CurrentStreamingRTSPPlayers: " & objItem.CurrentStreamingRTSPPlayers
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "Frequency_Object: " & objItem.Frequency_Object
      WScript.Echo "Frequency_PerfTime: " & objItem.Frequency_PerfTime
      WScript.Echo "Frequency_Sys100NS: " & objItem.Frequency_Sys100NS
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "PeakConnectedPlayers: " & objItem.PeakConnectedPlayers
      WScript.Echo "PeakOutgoingDistributionAllocatedBandwidthKbps: " & objItem.PeakOutgoingDistributionAllocatedBandwidthKbps
      WScript.Echo "PeakOutgoingDistributionConnections: " & objItem.PeakOutgoingDistributionConnections
      WScript.Echo "PeakPlayerAllocatedBandwidthKbps: " & objItem.PeakPlayerAllocatedBandwidthKbps
      WScript.Echo "PeakStreamingPlayers: " & objItem.PeakStreamingPlayers
      WScript.Echo "Timestamp_Object: " & objItem.Timestamp_Object
      WScript.Echo "Timestamp_PerfTime: " & objItem.Timestamp_PerfTime
      WScript.Echo "Timestamp_Sys100NS: " & objItem.Timestamp_Sys100NS
      WScript.Echo "TotalAdvertisements: " & objItem.TotalAdvertisements
      WScript.Echo "TotalConnectedPlayers: " & objItem.TotalConnectedPlayers
      WScript.Echo "TotalFileBytesRead: " & objItem.TotalFileBytesRead
      WScript.Echo "TotalLateReads: " & objItem.TotalLateReads
      WScript.Echo "TotalOutgoingDistributionBytesSent: " & objItem.TotalOutgoingDistributionBytesSent
      WScript.Echo "TotalOutgoingDistributionConnections: " & objItem.TotalOutgoingDistributionConnections
      WScript.Echo "TotalPlayerBytesSent: " & objItem.TotalPlayerBytesSent
      WScript.Echo "TotalStreamDenials: " & objItem.TotalStreamDenials
      WScript.Echo "TotalStreamErrors: " & objItem.TotalStreamErrors
      WScript.Echo "TotalStreamingPlayers: " & objItem.TotalStreamingPlayers
      WScript.Echo "TotalStreamTerminations: " & objItem.TotalStreamTerminations
      WScript.Echo
   Next
Next

Open in new window

0
Comment
Question by:W3Team
  • 3
  • 3
6 Comments
 
LVL 8

Expert Comment

by:jwarnken
ID: 24050539
Can you view the counters in perfmon?

Wmi uses the same counters so I would start by ensuring that the counters are usable in perfmon.
0
 

Author Comment

by:W3Team
ID: 24050625
As I mentioned above:
"...Windows Perfmon does not have any problem with querying those counters on both servers.", so yes, I can view those counters in perfmon.
0
 
LVL 8

Accepted Solution

by:
jwarnken earned 250 total points
ID: 24050961
2 suggestions
1-  run the script with On Error Resume Next commented out and check for errors

2- run the attached scipt to ensure you are getting data returned
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
 
arrComputers = Array("RM-STREAMSRV")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="
 
   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfFormattedData_WMServer_WindowsMediaPublishingPoints", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
 
   Wscript.Echo "Number of datapoints in Win32_PerfFormattedData_WMServer_WindowsMediaPublishingPoints is " & colItems.Count
Next

Open in new window

0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:W3Team
ID: 24057580
Thank you for the response. I have tried my script with On Error commented out with this error as a result:

temp_script.vbs(17, 4) (null): 0x80041010

Your script gave me this:

temp_script.vbs(15, 4) SWbemObjectSet: Unspecified error

Looks like it can't display colItems.Count since when I had removed it, it completed without error displaying only static text.
0
 
LVL 8

Assisted Solution

by:jwarnken
jwarnken earned 250 total points
ID: 24059263
This indicates there is a differance in the class between the two OS versions.
http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx#EHAAC

Try using scriptomatic on both versions and compare the results.
0
 

Author Comment

by:W3Team
ID: 24075885
I have followed your link and try to match the information there to our problem. However it does not directly solve the problem, it somehow helped. Unfortunately I really do not know how :-). I have tried to perform some of the tests on this page, tried to perform some actions recommended there for similar problems and initially that has not help at all. But somehow on some level of further digging the problem mysteriously disappeared... First thing we have managed to do was querying counters on problematic x64 server from another one in the farm (the x86 one). Then we tried to do it locally on x64 again but it did not work. Then we tried to query it again from outside x86 machine to check if we were not mistaken at the first time  we werent :-). Then eventually we tried another time locally and... it worked. I cant point out any particular action we have done to make it work&

So... I can not confirm that what you referred me to solve the problem directly but obviously it helped us to do "something", at least we were motivated to digg more. Therefore the points are yours :-), thank you.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question