Good Morning. I found some topics talking about it, but even following correctly did not work for me. I have a server and inside it G: \ foldername. In this folder I need to count the amount of files inside, how could I do that? Zabbix Version: 3.4.9
Ad Widget
Collapse
File count directory Windows
Collapse
X
-
File count directory Windows
Good Morning. I found some topics talking about it, but even following correctly did not work for me. I have a server and inside it G: \ foldername. In this folder I need to count the amount of files inside, how could I do that? Zabbix Version: 3.4.9Tags: None -
Thank you for your help. In my version of zabbix, I was able to create a power shell script and collect the amount of files in a folder. -
-
raphael.lage Thanks, I'm on 4.2. Actually, I'm not interested in vfs.dir.count but about custom scripting in zabbix. That's another topic, anyway, let me explain.
I want to create custom items from windows performance monitors (perf_counter["counterid"]). (Link attached.) To do that I need to discover physical disks in a host and I have like 350+ hosts from different domains.
Do I have to place the script in those hosts and edit the agent.conf file on hosts or is there a better way?
Also, I would really like see your script and item configuration just to learn more about this stuff.Average Disk sec per Read perf_monComment
-
baggord
In my environment, to monitor avg disk read / write I use a template called Template OS File Server Windows and the key perf_counter [\ 234 (_Total) \ 1404].
I saw that in your topic someone mentioned this key and you said that was not what you wanted, could give more details of what your need?
The powershell script: Get-ChildItem c: \ yourfolder | Measure-Object | % {$ _. Count} switch ($ ITEM) { "FileCountResult" { $ count = Get-ChildItem c: \ your folder | Measure-Object | % {$ _. Count} Write-Output ($ count.FileCountResult) }}
Note: If you want to count sub directories, add the parameter -Recurse
Note2: If you want to filter a certain file type, add the parameter -Include * .exe
Parameter added within .conf: UserParameter = FilesCount[*], powershell -NoProfile -ExecutionPolicy Bypass -File "script path" "$ 1"Comment
-
raphael.lage
Thanks for the tips,
_Total doesn't return values for all existing disks. It probably returns sum of them. I want to collect data for all separate disks. Avg Sec/Write and Avg/Sec Read for all disks and some servers has only C while many has C and D, some has E F G. So, it should be done in a flexible, dynamic way.Comment
-
I am using zabbix agent 3.2.4 and need to create a power shell script, add UserParameter in .conf and create an item in zabbix. If anyone can provide the code/example. I need to do a file count on the following Windows folders and trigger if count is more than 50:
C:\inetpub\mailroot\Badmail
C:\inetpub\mailroot\Drop
C:\inetpub\mailroot\Pickup
C:\inetpub\mailroot\Queue
Many thnaksComment
Comment