Okay, let me open this with I am not much of a scripter and am rather new to NPM/APM.
I have this process that generates files and occasionally goes wrong and just starts generating hundreds of files. In my old monitoring solution I ran a simple powershell script that looked at the directory and would alert me if the number of new files per last hour exceeded X. The other gotcha is the path changes monthly. i.e. c:\dir\dir\yyyyMM.
Here is the working powershell script (don't laugh I am not much of a scripter):
$mypath = $args[0]
$folder = get-date -format yyyyMM
$count = (Get-ChildItem "$mypath\$folder" | where-object {$_.lastwritetime -gt (get-date).Addhours(-1)}).count
#Write-Host "Count: $count"
exit $count
Is there a way to get this functionality in NPM/APM? The variable path and last hour functions seems to exclude the built in filecount script. Any help/suggestions would be great.
Jeff