3 years ago
DataSource - Powershell to check 40 different remote shared (on printers...) - TIMEOUT
Hi community :)/emoticons/smile@2x.png 2x" title=":)" width="20" />
I have a new datasource powershell script that checks print shares to ensure that a copy process has run successfully.
I also have individual datapoints for each path so the alert can be relevant to the particular site.
$paths = @()
$paths += ,@("\\PATHONE\share\folder\")
$paths += ,@("\\PATHTWO\share\folder\")
etcetc
$statuses = @(0) * $paths.Count
$location=[int]0
$i=0
foreach ($path in $paths){
if(!(Test-path $path)){
$statuses[$location]= 1
$location++
continue
}
$file = gci $path | sort LastWriteTime | select -last 1
if($file.LastWriteTime -lt (Get-Date).AddDays(-1)){
Unfortunately I get a timeout while trying to test this, and when implemented, it just doesn't work.
Error;
QuoteFAILED
Embed powershell script failed, elapsed time: 61 seconds - java.util.concurrent.TimeoutException: The request timeout
This script might take about 1.5 minutes to run, so I definitely exceed any request limit here.
Can I work around this issue somehow?
Thanks!