KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Monitor MSExchange with HM

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Wish list
View previous topic :: View next topic  
Author Message
shernyeexing



Joined: 02 Aug 2009
Posts: 20

PostPosted: Tue May 15, 2012 2:36 am    Post subject: Monitor MSExchange with HM Reply with quote

MSExchange ,the Exchange Command Management Console with PowerShell can get some infomation such as mailbox statistics ,mail server statistics to monitor the exchange, but these commands can only run at the Exchange Command Management Console .
How can i run these commands like get-mailbox through HM(with rma) for monitoring?

thanks.
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue May 15, 2012 6:51 am    Post subject: Reply with quote

You may use Shell Script test method to run MS Exchange Powershell commands.
E.g. You may use the following powershell script with Shell Script test method to check MS Exchange mailbox database state:
Code:
Add-PSSnapin Microsoft.Exchange.*
$mounted = (Get-MailboxDatabase -Identity $args[0] -status).Mounted
if($mounted)
{echo  $statusOk}
else
{echo  $statusBad}

Start CMD: powershell.exe %script% %params%

Please check the manual or visit our web site for more information at:
Shell Script test method: http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#chkShell
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shernyeexing



Joined: 02 Aug 2009
Posts: 20

PostPosted: Tue May 15, 2012 8:07 pm    Post subject: Reply with quote

thank you first.

there is a ps1 file, when execute on the remote exchange server , it is ok.
but can't be executed on the HM server by rma.

the ps1 file:
Add-PSSnapin Microsoft.Exchange.*
$HMMailNums1 = Get-MailboxStatistics -Identity archiver | ft -h totalitemsize > c:\test\test.tmp1
$HMMailNums2 = (get-content c:\test\test.tmp1)[1] > c:\test\test.tmp2
$HMMailNums = (get-content c:\test\test.tmp2 -delimiter B)[0]
echo $HMMailNums

the error msg:
[9:54:21] Agent: 172.28.90.2 is going to execute "PowerShell: Get-MailboxStatistics totalitemsize" script ...
[9:54:22] Script started, invalid result received:
----------
?
C

the reply:
Error: Invalid result (C

the startcmd:
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe %script% %params%
or
powershell.exe %script% %params%
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Wed May 16, 2012 6:40 am    Post subject: Reply with quote

Shell Script test has special script output requirement.
Your script should echo string like
scriptres:Host is alive:1000 ms
or
scriptres:Bad:90 % e.t.c.
With such output HostMonitor is able to recognise test Status and Reply.
You may find Powershell Script sample in HostMonitor Script Manager.

Please check for details at: http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#chkShell

Also, what HostMonitor and RMA version do you use ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shernyeexing



Joined: 02 Aug 2009
Posts: 20

PostPosted: Wed May 16, 2012 9:16 pm    Post subject: Reply with quote

HM VER: 8.86
RMA VER: 3.85
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Wish list All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index