Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

find $warning and the $critical for a FS

Hello

Monitoring.txt contains :

z:\mssql:FS:20%:30%
z:\mssql\:FS:20%:30%
k:\mssql:FS:OFF
k:\mssql\:FS:OFF

I search to modify the following code to find the $warning and the $critical for a FS
$thresholds = @()
get-content $MONITORING | ? { $_ -like '*:FS:*%' } | % {
  $val = $_ -split ':' -replace '%'
  $thresholds += New-Object PsObject -Property @{
    $fs       = $val[0]+':'+$val[1]
    $warning  = $val[3]
    $critical = $val[4]
  }
}
$thresholds

How can I do it?
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bibi92

ASKER

Thanks