06-07-2013 05:06 AM
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.
06-07-2013 05:08 AM
06-07-2013 07:23 AM - edited 06-07-2013 07:25 AM
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.
06-07-2013 07:48 AM
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.
06-10-2013 08:59 AM
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)
06-11-2013 07:49 AM
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.
06-12-2013 10:43 PM
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.
06-12-2013 11:24 PM
06-13-2013 12:49 PM
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.
06-18-2013 12:24 AM
Thanks again! Here is the screenshot of the output. I would like to fetch the values of all columns and rows.
06-18-2013 07:27 AM
Could you please send a text file of output that you want to parse?
06-18-2013 11:51 PM
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.
06-19-2013 08:24 AM
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>
07-09-2013 05:05 AM
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.
07-10-2013 11:58 PM
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
HP Operations Management Packs and Content Packs
HP Software, Bangalore, India