NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Useful WMI Queries  (Read 26748 times)


  • 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
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)

Alex Kirhenshtein

  • Team Member
  • Administrator
  • Hero Member
  • *****
  • Posts: 914
    • 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]