- Products
- Learn
- Local User Groups
- Partners
- More
MVP 2026: Submissions
Are Now Open!
What's New in R82.10?
Watch NowOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hello
I run a script every day on our VSX platform clusters with extracts a number of metrics for reporting about usage for each of our customers.
I wanted to expand the script to get the interface-values to make sure our documentation are up to date, but when I include this command to the bash-script:
ifconfig | grep -A1 Ethernet | grep -v '\-\-' | paste -sd ' \n' | awk '{ print $1","$7","$9 }' | awk -v vsname=$VS_NAME -F '[,:]' '{ print vsname","$1","$3"/"$5 }' >> /var/tmp/$Ldate-cp_facts_vs_interfaces_output-$1.txt
I get a different output, than if I run the command manually. The output in the script match what the \ifconfig puts out.
Example output:
Running command manually on a vs:
vs-customer1,bond1.3237,10.50.237.240/255.255.255.0
vs-customer1,bond3.1349,47.29.2.60/255.255.255.248
vs-customer1,wrp384,200.83.4.25/255.255.255.0
Running command in script on a vs:
vs-customer1,bond1.3237,100.127.48.1/255.255.255.240
vs-customer1,bond3.1349,100.127.48.17/255.255.255.240
vs-customer1,wrp384,100.127.48.33/255.255.255.240
Do I need to set a parameter in the script for ifconfig to give me the correct output, like with using specific checkpoint commands in scripts: source /etc/profile.d/CP.sh; ?
On VSX in interactive shells, 'ifconfig' is intercepted by the alias you saw above, which returns false results based on the cluster VIPs. Real 'ifconfig'—which your headless script is using—returns the real data.
To get the fake data via your script, you can source /etc/profile.d/CP.sh, then call /bin/cp-ifconfig.sh instead of ifconfig.
I suspect you’re ultimately referencing a different ifconfig in your script:
Use the command “which ifconfig” to see the precise location of the ifconfig binary you use on the CLI.
Use that in your script to ensure you are calling the same ifconfig binary.
Running which in the command gives this:
# which ifconfig
alias ifconfig='/bin/cp-ifconfig.sh'
/bin/cp-ifconfig.sh
So its a CP-script. So perhaps I need the source /etc/profile.d/CP.sh; in my script after all.
use "/sbin/ifconfig" in the script.
Nope, that gives the undesired result.
Try adding source /etc/profile.d/vsenv.sh to your script.
Nope, doesn't work either.
its source /etc/profile.d/CP.sh, then call /bin/cp-ifconfig.sh instead of ifconfig as Bob_Zimmerman describes.
On VSX in interactive shells, 'ifconfig' is intercepted by the alias you saw above, which returns false results based on the cluster VIPs. Real 'ifconfig'—which your headless script is using—returns the real data.
To get the fake data via your script, you can source /etc/profile.d/CP.sh, then call /bin/cp-ifconfig.sh instead of ifconfig.
This worked! Thanks!
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 19 | |
| 17 | |
| 13 | |
| 8 | |
| 7 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
Tue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY