Hi, can you please extend the "WMI: Laufwerkskapazität (mehrere Laufwerke)" with the information "DirtyBitSet" from "Win32_LogicalDisk"?
Can I monitor DirtyBitSet via WMI with PRTG?
Votes:
0
Best Answer
Votes:
1
First of all,
Although "PRTG WMI Tester" parses a query with multiple lines just fine, a query in resulting .wql file, seems, should be a one-liner:
SELECT DeviceID
FROM Win32_LogicalDisk
WHERE DriveType=3 and VolumeDirty=True
doesn't work.
SELECT DeviceID FROM Win32_LogicalDisk WHERE DriveType=3 and VolumeDirty=True
works.
Here's a Custom WMI String Sensor (.wql file) for one particular logical drive (#PH1 drive letter is set in sensor settings):
SELECT VolumeDirty FROM Win32_LogicalDisk WHERE DeviceID="<#PH1>"
With value 'True' set in settings as not desired/error.
I'd love to get an Overall sensor for multiple drives at once, but it's not possible using WQL-only: there's no COUNT or CASE THEN True ELSE False END in WQL language.
Here's my PowerShell 'Custom EXE' script for overall system status:
Param([string] $Hostname='localhost')
$Query = Get-WmiObject -ComputerName $Hostname -Query "SELECT DeviceID,VolumeDirty FROM Win32_LogicalDisk WHERE DriveType=3 and VolumeDirty=true" | measure
write-host $Query.count:OK
It returns a counter of dirty drives, and values above 0 limit should be treated as errors.
Unlike WQL, PowerShell is run directly on probe device, so a parameter %host should be set in sensor settings.
5 Replies
Votes:
0
We assume you would like to monitor the VolumeDirty counter which indicates whether Windows suggests to run chkdsk.
Please use a WMI Custom sensor with your own WQL query.
Please find more details about the Win32_LogicalDisk Class here: http://msdn.microsoft.com/en-us/library/aa394173%28v=VS.85%29.aspx
Votes:
0
Then, I must generate a new sensor for every drive on every server. o-o
Votes:
0
To easily add a specific WMI Custom sensor to you existing devices, you can follow these steps:
- On a new device, create the new WMI Custom sensor.
- Create a Device Template. This template now only contains your WMI Custom sensor.
- Show a device list (menu Devices | Device List) with all of your devices you want to add this sensor to and use multi-edit to change these devices' settings all at once: In the Sensor Management section, select Automatic sensor creation using specific device template(s) and select the device template you created above. Save your settings.
- Back in the device tree, right-click your devices, or the group they are part of, and select Run Auto-Discovery from the context menu. During this process, the new sensor will be added to each device.
Votes:
1
First of all,
Although "PRTG WMI Tester" parses a query with multiple lines just fine, a query in resulting .wql file, seems, should be a one-liner:
SELECT DeviceID
FROM Win32_LogicalDisk
WHERE DriveType=3 and VolumeDirty=True
doesn't work.
SELECT DeviceID FROM Win32_LogicalDisk WHERE DriveType=3 and VolumeDirty=True
works.
Here's a Custom WMI String Sensor (.wql file) for one particular logical drive (#PH1 drive letter is set in sensor settings):
SELECT VolumeDirty FROM Win32_LogicalDisk WHERE DeviceID="<#PH1>"
With value 'True' set in settings as not desired/error.
I'd love to get an Overall sensor for multiple drives at once, but it's not possible using WQL-only: there's no COUNT or CASE THEN True ELSE False END in WQL language.
Here's my PowerShell 'Custom EXE' script for overall system status:
Param([string] $Hostname='localhost')
$Query = Get-WmiObject -ComputerName $Hostname -Query "SELECT DeviceID,VolumeDirty FROM Win32_LogicalDisk WHERE DriveType=3 and VolumeDirty=true" | measure
write-host $Query.count:OK
It returns a counter of dirty drives, and values above 0 limit should be treated as errors.
Unlike WQL, PowerShell is run directly on probe device, so a parameter %host should be set in sensor settings.
Votes:
0
Unlike WQL (WMI Custom String sensor), PowerShell is run directly on the probe device, so a parameter %host should be set in the sensor settings. Here's the PowerShell 'Custom EXE' script for overall remote system status:
Param([string] $Hostname='localhost')
$Query = Get-WmiObject -ComputerName $Hostname -Query "SELECT DeviceID,VolumeDirty FROM Win32_LogicalDisk WHERE DriveType=3 and VolumeDirty=true" | measure
write-host $Query.count:OK
It returns a counter of dirty drives, and values above 0 limit should be treated as errors.
Add comment