Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Mudderkagen
Explorer

Using cpinfo and cphaprob in a script

Jump to solution

Hi all,

I am running a script on my R81 gateways.
I want the output from "cpinfo -y all" and "cphaprob stat" to be directed into a textfile.

When I login to the gateways as expert and run the script, everything looks good.
When I login to Web GUI and configures the Job Scheduler to run the script, it doesn't look good.  ‌‌

"cpinfo -y all" says:
Warning: failed getting the list of all products installed on the machine.

"cphaprob stat" says:
This is Check Point CPinfo Build 914000215 for GAIA
No Checkpoint product on this machine
Upload mode only

What should I do, to make the CP commands see, that the machine is a R81 gateway? 

Kind regards 
  Jan

0 Kudos
1 Solution

Accepted Solutions
Danny
Champion
Champion

I recommend to add the line below on top of your script:

source /etc/profile.d/CP.sh;‍‍

In case you also wish to create similar scripts on VSX systems, just add this line as well:

source /etc/profile.d/vsenv.sh;‍‍

View solution in original post

4 Replies
Sorin_Gogean
Advisor

Hey,

 

Are you running the commands in CLISH ?

For result redirection to a file, I recommend to run them in bash (under expert mode) .

cpinfo -y all > mytextfile.log

cphaprob stat  > mytextfile.log

 

Or you can grab that response and email it, do whatever.....

0 Kudos
G_W_Albrecht
Legend
Legend

You need to refer using source to the CP environment variables, see for details Calling a Bash Script in Cron

CCSE CCTE SMB Specialist
Danny
Champion
Champion

I recommend to add the line below on top of your script:

source /etc/profile.d/CP.sh;‍‍

In case you also wish to create similar scripts on VSX systems, just add this line as well:

source /etc/profile.d/vsenv.sh;‍‍
Mudderkage
Participant

Thanks a lot for the precise info. 
Now I got it working on my R81 hardware gateway AND on my R81.10 VSX. 👍😊

Best regards 
  Jan

0 Kudos