Link to home
Start Free TrialLog in
Avatar of W3Team
W3Team

asked on

Problem with querying WMS perfmon counters with VBS/Nagios

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

Avatar of jwarnken
jwarnken
Flag of United States of America image

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.
Avatar of W3Team
W3Team

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of jwarnken
jwarnken
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of W3Team

ASKER

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of W3Team

ASKER

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.