?
Solved

Problem with querying WMS perfmon counters with VBS/Nagios

Posted on 2009-03-31
6
Medium Priority
?
860 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 750 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 750 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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