Centreon Exchange monitoring

Hi guys,

I’m trying to use the Centreon Exchange plugin to monitor our Exchange servers, but the checks I’ve configured so far return “$ENV{ExchangeInstallPath} is undefined. Please install PowerShell extensions for Exchange”, but there isn’t much out there for people experiencing this error, so I’m a little stuck and hoping someone can help me out here.

My check command is:

object CheckCommand "check_exchange" {
    import "plugin-check-command"
    command = [ PluginDir + "/centreon-plugins-master/centreon_plugins.pl", ]
    arguments = {
        "--plugin" = "apps::exchange::2010::local::plugin"
        "--mode" = "$check_mode$"
        "--remote-host" = "$address$"
        "--critical" = "$critical$"
        "--warning" = "$warning$"
        "--remote-user" = "$user$"
        "--remote-password" = "$userpass$"
        "--command" = "powershell.exe; Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn"
        "--ps-display" = "--ps-display"

I’ve tried a few variations upon the command - originally it was just “powershell.exe”, I tried this one, and I’ve also tried a much longer and more convoluted one to import the modules manually. All three yield the same results, so I’m pretty confused by now.

My check is defined as follows, but I think it’s pretty safe to assume that

apply Service "Centreon Exchange Replication" {
  import "check_exchange"
  vars.check_mode = "replication-health"
  vars.warning = "8"
  vars.critical = "10"
  assign where "exchange-servers" in host.groups

Could somebody point out where I’m going wrong here please?

Thanks :slight_smile:

If you open a PS shell and type $env:exchangeinstallpath does it return a value?

It looks like that plugin is looking for that environment variable to be set.

Thanks Liam, getting that variable does work (at least for me).

Running the command defined in the check command as myself on the Windows box also works, and I can then run Exchange Powershell commands, but I’m drawing a blank on testing the same functionality with our Icinga WMI service account because it seems not to be allowed to open a Powershell session (when I try doing start powershell -credential “”)

Thoughts and next steps would be much appreciated :slight_smile: