bibi92
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER