Lieutenant Commander
Lieutenant Commander
233 views

process policy: use regular expressions to extract a string from process parameters

Hello,

I deployed a process policy and would like to extract a string in the parameters of a process to help resolve to a CI. the process is: 

"processABC -f /someDir/abc.conf"

in the policy template's parameters, i used the following: 

<*><*.var>.conf<*> 

but it did not work. Anyone knows the correct syntax to extract a value from the params and store it in a variable?

 

thanks,

Nabil

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Hello,

Service/Process Monitoring policies are not based on pattern matching. You would need to take a different approach for your requirement, for instance a measurement threshold policy with an embedded script that scans the process list and sets the necessary session variables that you can refer to in your start action.

A lazy approach would be to use a logfile policy configured with a preprocessing task that executes "ps -ef" and writes it to the logfile that the policy monitors. The rules of the policy could then implement the necessary pattern matching to read the process arguments into variables.

Regards,
Thierry.

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Fleet Admiral Fleet Admiral
Fleet Admiral

What you can try is to use Policy Parameters and split the path into parts like

processABC -f -f /someDir%%PARAMTERABC%%.conf"

Then you are ablt to use %%PARAMTERABC%% for the CI Resolution.

Other way may be  to create a CMA that like  PROCESS="processABC -f /someDir/abc.conf" then use a EPI Script to cut out "abc" and use it for CI Resolution.

 

 

0 Likes
Fleet Admiral Fleet Admiral
Fleet Admiral

What you can try is to use Policy Parameters and split the path into parts like

processABC -f -f /someDir%%PARAMTERABC%%.conf"

Then you are abltet o use %%PARAMTERABC%% for the CI Resolution directly in the Policy.

Other way may be  to create a CMA that like  PROCESS="processABC -f /someDir/abc.conf" then use a EPI Script to cut out "abc" and use it for CI Resolution.

It my be possible to set the CMA with the $MSG_APPL> Variable. like PROCESS=$MSG_APPL>, But i am not sure if this variable contains all the information you need. Of course you need an EPI Script to use this for CIResolution.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.