- Products
- Learn
- Local User Groups
- Partners
- More
What's New in R82.10?
Register HereWhen the Agents Attack
A Live Look at Agentic Exposure Validation
AI Security Masters E8:
Claude Mythos: New Era in Cyber Security
CheckMates Go:
CheckMates Fest
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 |
|---|---|
| 26 | |
| 5 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
Tue 23 Jun 2026 @ 05:00 PM (CEST)
Under the Hood: Check Point Cloud Firewall | Securing all of your clouds: Art of the possibleThu 25 Jun 2026 @ 10:00 AM (PDT)
AI Security Masters E10: READY OR NOT: Securing the AI Enterprise 2/5 - AI Red TeamingThu 02 Jul 2026 @ 06:00 PM (CST)
Revolucionando la Seguridad con IA Generativa: Prevención Inteligente en Tiempo RealThu 09 Jul 2026 @ 11:00 AM (CEST)
The Cloud Architects Series: Check Point Edge Protection SD-WAN & SASETue 14 Jul 2026 @ 10:00 AM (PDT)
AI Security Masters E11: READY OR NOT: Securing the AI Enterprise 3/5 - AI Workforce SecurityTue 23 Jun 2026 @ 05:00 PM (CEST)
Under the Hood: Check Point Cloud Firewall | Securing all of your clouds: Art of the possibleThu 25 Jun 2026 @ 10:00 AM (PDT)
AI Security Masters E10: READY OR NOT: Securing the AI Enterprise 2/5 - AI Red TeamingTue 14 Jul 2026 @ 10:00 AM (PDT)
AI Security Masters E11: READY OR NOT: Securing the AI Enterprise 3/5 - AI Workforce SecurityThu 30 Jul 2026 @ 10:00 AM (PDT)
AI Security Masters E12: READY OR NOT: Securing the AI Enterprise 4/5 - AI GatewayThu 20 Aug 2026 @ 10:00 AM (PDT)
AI Security Masters E13: READY OR NOT: Securing the AI Ent 5/5 - AI Research & Threat LandscapeThu 02 Jul 2026 @ 06:00 PM (CST)
Revolucionando la Seguridad con IA Generativa: Prevención Inteligente en Tiempo RealAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY