Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nickel

How to use run-script to get IPS information on a VS of VSX?

I am trying to use run-script to get IPS information on a VS of VSX. Say VS 3 on cli I could do following:

vsenv 3

ips stat

But if I put it in run-script as follow, api could not find vsenv command.

mgmt_cli -r true -d Mydomain -VSX run-script script-name test script "vsenv3; ips stat" targets.1 vsx1 -f json

 

Also tried to put the two commands in a script, test.sh:

#!/bin/bash

vsenv 3

ips stat

then run

mgmt_cli -r true -d Mydomain -VSX run-script script-name test script "/mydir/test.sh" targets.1 vsx1 -f json

it does not work either.

 Any idea how to get this to work or any way that can get IPS info on VS?

0 Kudos
2 Replies
Highlighted
Pearl

You need to source the Check Point environment at first.

if [[ -e /etc/profile.d/CP.sh ]]; then source /etc/profile.d/CP.sh; fi
if [[ -e /etc/profile.d/vsenv.sh ]]; then source /etc/profile.d/vsenv.sh; fi
Highlighted
Nickel

 
0 Kudos