Re: Need assistance to capture the exchange metrics (543 Views)
Reply
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 1 of 15 (694 Views)

Need assistance to capture the exchange metrics

Hello,

 

I would like to retrieve health information about exchange servers. Attached is one sample power shell command ouput which gives that info. I have attached screenshot of the policy and script as well. My requirement is to create a policy  to execute this command and read the values and trigger an event in case result is a failure or latency value is high. Attached is the policy I created to execute the command but I do not know how to read it. I guess this needs to be done through log file policy but not sure how. Please feel free to advice me if there is a better way to get this done.  I am new to HPOMW so your inputs are greatly appreciated.

 

Hoping somebody will lead me in right direction.

 

Regards,

Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 2 of 15 (692 Views)

Re: Need assistance to capture the exchange metrics

 
Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Honored Contributor
KAKA_2
Posts: 1,453
Registered: ‎05-26-2007
Message 3 of 15 (670 Views)

Re: Need assistance to capture the exchange metrics

[ Edited ]

Hello Sujith,

I would try to acheive this with measurement threshold policy to so it does not become much complicated.

you may need to modify your script in the way that you save this output in a temp file.

then read the temp file and pass the values using opcmona and then set your thresholds in measurement policy.

if you can not or dont want to do it within the same policy then you can create script as i stated above and execute it using ST policy and then create multiple MT policies with the source external and match the threshold individually.

HTH
-KAKA-

Valued Contributor
pafreire
Posts: 140
Registered: ‎01-10-2011
Message 4 of 15 (666 Views)

Re: Need assistance to capture the exchange metrics

Hello,

 

I think the more simple way is using log file policy.

 

To achieve this goal, you need to configure the log policy to execute your script and, in this same field use ">" (redirect sign) to generate a log file.

 

After it, set the file generated to be read by policy and use regular expressions to trigger.

 

 

HTH,

 

Paulo

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.”
Bertrand Russell
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 5 of 15 (647 Views)

Re: Need assistance to capture the exchange metrics

Thanks Folks. Yes I have redirected the output to a notepad. Can any of you help me configure the log file policy from scratch?

 

I have redirected the ouput to a notepad in the instrumentation directory (screenshot attached)

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Valued Contributor
pafreire
Posts: 140
Registered: ‎01-10-2011
Message 6 of 15 (636 Views)

Re: Need assistance to capture the exchange metrics

Hello Sujith,

 

I think the best way to do it is use the policy to execute the script and get the result.

 

To acomplish it, in the "Source" tab of logfile policy configuration, you need to mark "Preprocessing" option and set the script as "File to be executed".

 

In the same "File to be executed" field  you can do an explicit redirect ">" or, if you prefer, write the file inside the script.

 

After it, set output file created by script as "file to be read".

 

Please see the example attached.

 

 

HTH,

 

Paulo

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.”
Bertrand Russell
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 7 of 15 (626 Views)

Re: Need assistance to capture the exchange metrics

Thanks Pafreire. But this is a power shell command so I doubt using anything with .cmd is going to work. Here is the policy I created after taking your input and using power shell attribute. How does it look? I have placed the power shell script on remote server. Two questions.

 

1. How will I get to know the log file is pulling up/executing the power shell script

2. How to read/parse the output using regualr expression.

 

--Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 8 of 15 (625 Views)

Re: Need assistance to capture the exchange metrics

KAKA, I have created scheduled task policy as well but how to create the measurement policy that suits my requirement. Screenshots would help me. Sorry if I am asking too much.

Regards,
Sujith
Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Valued Contributor
pafreire
Posts: 140
Registered: ‎01-10-2011
Message 9 of 15 (620 Views)

Re: Need assistance to capture the exchange metrics

Hello Sujith,

 

You can use any script to generate logfile (perl, python, powershell) since this script could be executed in system and generate a file as output.

 

The script is executing If the logfile was updated and no error message is on agent.

 

In regards to regex, please send a sample output text.

 

 

Regards,

 

Paulo

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.”
Bertrand Russell
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 10 of 15 (613 Views)

Re: Need assistance to capture the exchange metrics

Thanks again! Here is the screenshot of the output. I would like to fetch the values of all columns and rows.

 

Regards,

Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Valued Contributor
pafreire
Posts: 140
Registered: ‎01-10-2011
Message 11 of 15 (610 Views)

Re: Need assistance to capture the exchange metrics

Hello Sujith,

 

Could you please send a text file of output that you want to parse?

 

 

Regards,

 

Paulo

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.”
Bertrand Russell
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 12 of 15 (602 Views)

Re: Need assistance to capture the exchange metrics

Here you go. The text file is pretty much the same as the outpur screenshot I have attached. The last column "Error" will have data only if there is any issue on exchange server.

 

Regards,

Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Valued Contributor
pafreire
Posts: 140
Registered: ‎01-10-2011
Message 13 of 15 (597 Views)

Re: Need assistance to capture the exchange metrics

Hello Sujith,

 

Follows the conditions to:

 

1. Get line with latency greather than X (in this case 100):

 

<*.CasServer>      <*.LocalSite>    <*.Scenario>    Success    <<#.Latency> -gt 100>.<#.AfterPoint>

 

2. Get line with error message:

 

<*.CasServer>      <*.LocalSite>    <*.Scenario>    <*.Result>    <*.Latency>    <*.Error>

 

 

HTH,

 

Paulo

 

“The greatest challenge to any thinker is stating the problem in a way that will allow a solution.”
Bertrand Russell
Honored Contributor
Sujith Kumar C.S
Posts: 868
Registered: ‎04-07-2010
Message 14 of 15 (551 Views)

Re: Need assistance to capture the exchange metrics

Thank you pafreire. I will check your solution shortly and post back the result. Currently I am facing some access issues on exchange server which needs to be sorted out before I proceed further.

 

Regards,

Sujith

Close the thread if your issue is resolved to make the thread meaningful and complete. Do show gratitude to people who helped you by assigning points.
Occasional Advisor
Manoj_Mohanan
Posts: 12
Registered: ‎03-20-2013
Message 15 of 15 (543 Views)

Re: Need assistance to capture the exchange metrics

Hi Sujith,

 

It seems you are trying to monitor Exchange Server using OM Policies. Is there any reason you have not tried the same using SPI for Microsoft Exchange.

 

Thanks and Regards

Manoj Mohanan

R&D Software Engineer
HP Operations Management Packs and Content Packs
HP Software, Bangalore, India
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.