I got a request to monitor a Exchange 2013 server. Found a powershell script on the Exchange site.
I've tried to implement it, but run into a few things:
What I did:
Uploaded script to host in ~nsclient++\Scripts
Modified nsclient.ini file (section Wrapped Scripts)
Added command on Nagios Xi server
Added service.
When I click Apply configuration I get an error:
Code: Select all
Error: Service check command 'check_exch_2013_SiteMailbox ' specified in service 'check SiteMailbox' for host 'stb-exch-01' not defined anywhere!Code: Select all
define command {
command_name check_exch_2013_SiteMailbox
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c exchange_serverhealth $ARG2$
}
**Edit: I got it to work, but the powershell scripts fails with this:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H [IPADDRESS] -t 30 -c exchange_serverhealth -a SiteMailbox
Get-ServerHealth : Cannot process command because of one or more missing mandat
ory parameters: Identity.
At C:\Program Files\NSClient++\scripts\exchange-serverhealth.ps1:28 char:21
+ $HealthSetResult = (get-serverhealth |'Where-Object'=0 '{$_.HealthSetName'=0 '-eq'=0 '$He
alt'=0 '...
+'=0 '~~~~~~~~~~~~~~~~
'=0 '+'=0 'CategoryInfo'=0 ':'=0 'InvalidArgument:'=0 '(:)'=0 '[Get-ServerHealth],'=0 'Paramet'=0 '
'=0 'erBindingException
'=0 '+'=0 'FullyQualifiedErrorId'=0 ':'=0 'MissingMandatoryParameter,Microsoft.Exchange.Man'=0 '
'=0 'agement.Tasks.GetServerHealth
'=0 '
OK:'=0 'SiteMailbox'=0 '-'=0 '0'=0 'checks'=0 'are'=0 'OK'=0
there's a lot of info out there on "missing mandatory parameter: identity"
But my powershell knowledge is barely existent, therefore at a loss...