Ryan Ferreri Honored Contributor.
Honored Contributor.
283 views

Script monitor, value labels, python output

Jump to solution

I have set up a script monitor that runs a python script. That script returns two values like this:

[15,6]

I have set up the Match Value Labels and Match Expressions fields to map those values to variables. However, when it's run, I only get a value in the first variable, and it's the return code of the python command (0), not the values that are sent to stdout using the python print function.

How do I configure the monitor to look at the script output instead of the command return code?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Ryan Ferreri Honored Contributor.
Honored Contributor.

Re: Script monitor, value labels, python output

Jump to solution

OK so I did figure this out. It turns out I just needed a better regex in my Match Expression field.

For the output [15,6], I have valueA,valueB in "Match value labels," and the following in "Match expression:"

/\[(.*)\,(.*)\]/s

This returns "valueA=15,valueB=6", which is exactly what I want.

0 Likes
1 Reply
Highlighted
Ryan Ferreri Honored Contributor.
Honored Contributor.

Re: Script monitor, value labels, python output

Jump to solution

OK so I did figure this out. It turns out I just needed a better regex in my Match Expression field.

For the output [15,6], I have valueA,valueB in "Match value labels," and the following in "Match expression:"

/\[(.*)\,(.*)\]/s

This returns "valueA=15,valueB=6", which is exactly what I want.

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.