NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Useful WMI Queries  (Read 25703 times)

toad

  • Newbie
  • *
  • Posts: 19
    • View Profile
Useful WMI Queries
« on: November 14, 2008, 07:46:36 am »

I suggest we use this topic to update it with useful WMI queries. My interest is in IIS and SQL. I am having luck with IIS but not SQL, ie a logsize for a particular database is becoming difficult. My set that I can offer, and more will follow are as follows.

iis anoymous users
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalAnonymousUsers)

iis service
WMI.Query(root\microsoftiisv2,select * from iiswebservice,state)

nlb status - 1008 shows all is ok - more details here http://msdn.microsoft.com/en-us/library/cc307934(VS.85).aspx
WMI.Query(root\MicrosoftNLB,select * from MicrosoftNLB_Node, StatusCode)

SQL Cache Memory KB
WMI.Query(root\CIMV2,select * from Win32_PerfFormattedData_MSSQLSERVER_SQLServerMemoryManager,SQLCacheMemoryKB)

SQL Transactions
WMI.Query(root\CIMV2,select * from Win32_PerfFormattedData_MSSQLSERVER_SQLServerTransactions, Transactions)

iis bytes received
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalBytesReceived)

iis bytes sent
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalBytesSent)

iis current connections
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, CurrentConnections)

available memory
WMI.Query(root\cimv2,select * from Win32_perfRawData_PerfOS_Memory,AvailableMbytes)
Logged

Alex Kirhenshtein

  • Team Member
  • Administrator
  • Hero Member
  • *****
  • Posts: 912
    • View Profile
Re: Useful WMI Queries
« Reply #1 on: June 14, 2012, 03:49:58 pm »

Temperature of CPU's thermal zone:
Code: [Select]
WMI.Query(root\WMI,"select * from MSAcpi_ThermalZoneTemperature",CurrentTemperature)
This temperature is in tenths of degrees Kelvin, so you need to add transformation script:
for Celsius:
Code: [Select]
($1-2730)/10for Fahrenheit:
Code: [Select]
((($1-2730)/10)*1.8)+32
Logged