Hello , is it possible to monitor all folder on a windows server (eg C:\) and show like folder sensor will display folder size and display the folder is growth and how much it growth?
monitor all folder on C: drive
Votes:
0
Best Answer
Votes:
0
Dear a23554
WQL means WMI Query Language and its syntax is similar to SQL. Depending on the programming language you use for your custom sensor, you can use WQL. Powershell on the other hand uses a different approach, you can return WMI objects and use the Powershell syntax (instead of WQL syntax.)
You might want to use a non-WMI script (though it only works locally) as a starting point.
param([string]$path = "C:\temp" ,[string]$mask = "*.*",[switch]$recursive = $false,[switch]$dironly = $false) $Options = @{ Recurse = $recursive Directory = $dironly Path = $path Filter = $mask } $Items = (Get-ChildItem @Options).Count Write-Host ([string]::Format("{0}:{0} Objects found in {1}", $items,$path));
Though this sensor counts items, not size, it could be starting point to have something to play with / expand on.
3 Replies
Votes:
0
Dear a23554
A treesize-like monitoring is not implemented in PRTG, I am sorry. PRTG can only measure the size of pre-defined folders.
Votes:
0
Dear Arne
Thanks for your answer, now I have another question. I want to ask about the folder sensor. What method dose the folder sensor collect the folder size? Is WQL? If is WQL can you tell me what its WQL is. Because I want to write custom sensor but I don't know how to collect data. Thank you
Votes:
0
Dear a23554
WQL means WMI Query Language and its syntax is similar to SQL. Depending on the programming language you use for your custom sensor, you can use WQL. Powershell on the other hand uses a different approach, you can return WMI objects and use the Powershell syntax (instead of WQL syntax.)
You might want to use a non-WMI script (though it only works locally) as a starting point.
param([string]$path = "C:\temp" ,[string]$mask = "*.*",[switch]$recursive = $false,[switch]$dironly = $false) $Options = @{ Recurse = $recursive Directory = $dironly Path = $path Filter = $mask } $Items = (Get-ChildItem @Options).Count Write-Host ([string]::Format("{0}:{0} Objects found in {1}", $items,$path));
Though this sensor counts items, not size, it could be starting point to have something to play with / expand on.
Add comment