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

  • 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.

  • Verified Answer

    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.

     

     

  • 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.