Hello,
Im checking the apppool state with this command:
/usr/lib/nagios/plugins/check_centreon_nrpe3 -H hostip -p 5666 -u -2 -P 8192 -c check_app_pool -a poolname
This is the content of check_app_pool.ps1:
lCmdletBinding()]
Param(
Parameter(Mandatory=$True,Position=1)]
string]$ApplicationPool
)
Set-Variable OK 0 -option Constant
Set-Variable WARNING 1 -option Constant
Set-Variable CRITICAL 2 -option Constant
Set-Variable UNKNOWN 3 -option Constant
Import-Module WebAdministration
$appPool = Get-Item "IIS:\AppPools\$ApplicationPool"
if ($appPool -eq $null) {
Write-Host "IISPOOL UNKNOWN: Application pool '$ApplicationPool' not found."
exit $UNKNOWN
}
$state = $appPool.state
if ($state -eq 'Started') {
Write-Host "IISPOOL OK: Application pool '$ApplicationPool' is 'Started'."
exit $OK
} elseif ($state -eq 'Stopped') {
Write-Host "IISPOOL CRITICAL: Application pool '$ApplicationPool' is 'Stopped'."
exit $CRITICAL
} else {
Write-Host "IISPOOL UNKNOWN: Application pool '$ApplicationPool' is 'Unknown'."
exit $UNKNOWN
}
The check works correctly, but sometimes it gives error: CHECK_NRPE STATE UNKNOWN: Socket timeout after 10 seconds
How do I know what is wrong? is there any debug option in check_centreon_nrpe3 ?
I also have try with timeout 20 (-t 20)
Thanks,