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

Find host objects that share the same IP-address / Duplicate objects (bash script)

Overview

List all host objects that share the same IP-address

Description

A bash script that uses a Check Point package that handles all the communication with the Check Point management server.

Instructions

Attaching two different scripts that do the same thing. Which one is better and easier to understand? I don't know...

Let me know which one do you prefer?

A short script with more "tricks" in it or a longer straight forward script

Code Version

Code version 1.0.0

Tested on version

R80, API version 1.0

NOTICE: By using this sample code you agree to terms and conditions in this Terms and Conditions

...

7 Replies
SD_Networking
Contributor

Hello Great Script, can you also add "duplicate object" in your title, it took me quite while to search this page.

0 Kudos
Uri_Bialik

Done 🙂

0 Kudos
Marco_Valenti
Advisor

Hey there , any feedback on the use of that script?

0 Kudos
the_rock
Legend
Legend

I just tried running this script on my mgmt server R80.40 and it fails with below...not sure why, but it generated couple of files that dont show anything (ip_addresses.txt and host_objects.csv...

 

[Expert@cp-test-mgmt:0]# ./find_dup_ip2.sh
Please enter your username and password
Enter username and press [ENTER]: admin
Enter password and press [ENTER]:
Failed to parse login output file [id.txt]
show hosts failed.
[Expert@cp-test-mgmt:0]#

0 Kudos
the_rock
Legend
Legend

Never mind...layer 8 issue, haha. I tried on different mgmt and worked fine...so probably something wrong on a VM one I tested first.

 

Andy

0 Kudos
Devilmac
Explorer

Hello,

I cant find the $CPDIR/jp/jp directory.  Is this folder not present in a CMA/DOMAIN of a MDS.?

Thanks

0 Kudos
S_E_
Advisor

hi
for me, it works on SMS R80.40 but not on MDS R80.40


As mentioned in the script
# relies on having the jq utility
JQ=${CPDIR}/jq/jq

which seems to be on a MDS in /opt/CPshrd-R80.40/bin/jq

I do not see any 'domain' command in the script which I would expect (with my limited API knowledge)

Regards

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events