NetXMS Support Forum

English Support => General Support => Topic started by: ITR on May 05, 2015, 04:19:35 PM

Title: External Parameter (Powershell)
Post by: ITR on May 05, 2015, 04:19:35 PM
Hi,

is it possible to use the Exchange 2013 powershell commands?
The normal powershell commands are working, but the module/snapins are not imported into the normal powershell - is it possible?

I want to monitor an DAG and i need this commands from the Exchange powershell module:

for example:

Get-MailboxDatabaseCopyStatus | fl -Property Status

Thx,
Didi
Title: Re: External Parameter (Powershell)
Post by: Alex Kirhenshtein on May 05, 2015, 04:55:16 PM
You can try to create ps1 script like this:

add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-MailboxDatabaseCopyStatus | fl -Property Status
Title: Re: External Parameter (Powershell)
Post by: ITR on May 05, 2015, 06:02:32 PM
Hi Alex,

thx for the hint its working.

For all others:


Raise the timeout for Server AgentCommandTimeOut and on Agent ExecTimeout (PSSnapIn needs to load a few seconds) (defaults are: 2000 on agent and 4000 on server)

Server Configuration:

AgentCommandTimeOut = 20000

Agent Configuration (for example):

ExecTimeout = 20000
ExternalParameter = DAG2013Healthstatus.status:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\Scripts\Get-MailboxDatabaseCopyStatus.ps1"

Content of PS1

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
Get-MailboxDatabaseCopyStatus | fl -Property Status

Thx
Title: Re: External Parameter (Powershell)
Post by: Alex Kirhenshtein on May 06, 2015, 12:55:21 AM
I suggest you to change it from ExternalParameter to ExternalParameterProvider, this way data collection will work faster.
Detailed description: https://wiki.netxms.org/wiki/ExternalParametersProvider
Title: Re: External Parameter (Powershell)
Post by: ITR on May 06, 2015, 01:53:28 PM
OK i try this.

Is it possible to do a treshold with an OR connection - because i get:

Server 1: Status : Mounted
Server 2: Status : Healthy

Ive created 2 Tresholds not equal "Status : Mounted" and not equal "Status : Healthy" and clicked "process all tresholds" but it dont seem that this works

Thx
Title: Re: External Parameter (Powershell)
Post by: Victor Kirhenshtein on May 07, 2015, 09:59:44 AM
Hi,

you can use script for threshold checking.

Best regards,
Victor