If you are not required to use an op script, you may get the same result using an RPM probe which allows you to ping based on a routing instance ... plus it gives you options for a lot of other features too...
An example below:
yardiel@srx-14# show services rpm probe rm-srx-ge-0
probe rm-srx-ge-0 {
test if-ping-test {
probe-type icmp-ping-timestamp;
target address 10.10.10.2;
probe-count 15;
probe-interval 1;
test-interval 60;
routing-instance test-1;
}
}
Yardiel