- changed version to 5.14
How to check multiple condition in "If Failed port"
We want to run a bash script when any of 3 port failed. like below
if failed port 9001 or 9002 or 9003 type tcp then exec "/bin/bash -c 'script.sh'"
is this possible?
thanks arasu.b
Comments (8)
-
reporter -
repo owner - changed status to closed
You need to test each port separately:
if failed port 9001 then exec "/bin/bash -c 'script.sh'" if failed port 9002 then exec "/bin/bash -c 'script.sh'" if failed port 9003 then exec "/bin/bash -c 'script.sh'"
(note: the "type tcp" is default, so it's not necessary to use this option)
-
reporter Hi team,
The issue in case of 2 ports failed, the same script will execute 2 times. Number of ports will increase to 10 from 3.
Thanks arasu.b
-
reporter - changed status to open
Hi team,
The issue in case of 2 ports failed, the same script will execute 2 times. Number of ports will increase to 10 from 3.
Thanks arasu.b
-
repo owner Testing of multiple ports with one statement is not supported currently.
It is true the script will be executed once for each failed port - if it is important to execute it only once, as a workaround the script can be modified to track the execution time and skip if it was executed recently.
-
repo owner -
assigned issue to
- marked as enhancement
-
assigned issue to
-
reporter Thanks for taking up this enhancement, In the mean time i also will try to contribute to this feature.
thanks arasu.b
-
repo owner - removed version
Removing version: 5.14 (automated comment)
- Log in to comment