1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-12-22 09:03:54 +01:00

exchange checks added to nsclient config

This commit is contained in:
Páll Guðjón Sigurðsson 2010-09-20 11:16:24 +00:00
parent 7b5ffc6486
commit e261ce37e0
3 changed files with 13 additions and 5 deletions

View File

@ -45,6 +45,10 @@ check_eva=cmd /c scripts\check_eva\check_eva.exe
[External Alias]
[NRPE Handlers]
check_mailbox_health=cmd /c echo Scripts\check_exchange\MailboxHealth.ps1 | PowerShell.exe -Command -
check_public_folders=cmd /c echo Scripts\check_exchange\PublicFoldersMounted.ps1 | PowerShell.exe -Command -
check_replication=cmd /c echo Scripts\check_exchange\ReplicationHealth.ps1 | PowerShell.exe -Command -
[NRPE Client Handlers]

View File

@ -30,14 +30,14 @@
#
# On the check_nrpe command include the -t 20, since it takes some time to load
# the Exchange cmdlet's.
Write-Host "Test"
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$NagiosStatus = "0"
$NagiosDescription = ""
$LongOutput = ""
ForEach ($DataBase in Get-MailboxDatabase) {
ForEach ($Status in Get-MailboxDatabaseCopyStatus -Identity $DataBase.Name) {
$LongOutput = $LongOutput + $Status.Name + " is " + $Status.Status + "`n"
switch ($Status.Status) {
"Failed" {
$NagiosStatus = "2"
@ -99,5 +99,7 @@ if ($NagiosStatus -eq "2") {
} else {
Write-Host "OK: All Mailbox Databases are mounted and healthy."
}
Write-Host $LongOutput
exit $NagiosStatus

View File

@ -35,11 +35,10 @@ Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$NagiosStatus = "0"
$NagiosDescription = ""
$LongOutput = ""
ForEach ($Type in Test-ReplicationHealth -Identity $env:computername) {
# Look for failed replications
if ($TypeResult -like "*FAILED*") {
if ($Type.Result -like "*FAILED*") {
# Format the output for Nagios
if ($NagiosDescription -ne "") {
$NagiosDescription = $NagiosDescription + ", "
@ -65,6 +64,7 @@ ForEach ($Type in Test-ReplicationHealth -Identity $env:computername) {
$NagiosStatus = "1"
}
}
$LongOutput = $LongOutput + $Type.Result + " on " + $Type.Check + "`n"
}
# Output, what level should we tell our caller?
@ -76,5 +76,7 @@ if ($NagiosStatus -eq "2") {
Write-Host "OK: All replication tests passed."
}
Write-Host $LongOutput
exit $NagiosStatus