- CheckMates
- :
- Products
- :
- Quantum
- :
- Security Gateways
- :
- Using cpinfo and cphaprob in a script
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using cpinfo and cphaprob in a script
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
- Labels:
-
Gaia
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to refer using source to the CP environment variables, see for details Calling a Bash Script in Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
