- CheckMates
- :
- CheckMates Toolbox
- :
- Scripts
- :
- Transceiver & Line Card Inventory - One-liner
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Transceiver & Line Card Inventory - One-liner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


Champion
🚀 Runs on all Check Point Gaia systems.
🎓 Referenced in sk180812
One-liner (Bash) to show the inventory of plugged transceivers, DAC cables and line cards.
In expert mode run:
echo;if [[ -f "/etc/cp-release" ]] && ! [[ `grep Embed /etc/cp-release` ]];then stat=`cpstat os`;tput bold;echo -n "$stat"|grep "Appliance Name:"|sed 's/Appliance Name://'|tr -s ' '|tr -d '\n';if [[ `echo "$stat"|grep "Maestro"` ]] && [[ `grep original_name /etc/appliance_config.xml|tr '<>' '\n'|grep "Check Point"` ]];then echo; echo -n " ";grep original_name /etc/appliance_config.xml|tr '<>' '\n'|grep "Check Point"|tr -d '\n';fi;tput sgr0;if [[ `echo "$stat"|grep Manufacturer|grep CheckPoint` ]];then echo -n " (Serial: `echo "$stat"|grep "Appliance SN"|awk '{print $NF}'`, MAC: `dmidecode -t1|grep UUID|awk '{print $NF}' FS=-|sed 's/../&:/g; s/:$//'`)";fi;echo;echo;sfps=0;tput bold;echo " Line cards";tput sgr0;if [[ `find /sys/class/net -name eth*-01 2>/dev/null` ]]; then find /sys/class/net -name eth*-01 2>/dev/null|while read line;do grep `cat $line'/device/subsystem_vendor'` /etc/hw_info/linecard.lst|grep `cat $line'/device/subsystem_device'`|awk -F ',' '{print "Model: "$3" Type: "$4}'|tr -d '"'|tr -s " "|tr -d "\t"|sed "s/\bModel\b/\x1b[1;\t1m&\x1b[m/g;s/\bType\b/\x1b[1;1m&\x1b[m/g;";done;else echo -e "\n\t-";fi;echo;phys=`find /sys/class/net/*/device|awk -F '/' '{print $5}'|wc -l`;echo "`find /sys/class/net/*/device|awk -F '/' '{print $5}'`"|while read line;do if [[ `ethtool -m $line 2>/dev/null` ]];then sfps=1;tput bold;echo " "$line;tput sgr0;etht=`ethtool -m $line 2>/dev/null|awk '/Transceiver type/ && ++count==1{sub(/Transceiver type/,"Transceiver_type")} 1'|grep 'Identifier\|Transceiver_type\|Length\|Vendor name\|Vendor SN\|Vendor PN'|sed 's/Transceiver_type/Transceiver type/'|grep -v ': 0m\|: 0km'`;file=`find /etc/hcp/tests -name hcp_optic_info.json|head -n1`;data=`cat $file|$CPDIR/jq/jq -e -r ".transceivers.CheckPoint_PartNumber[\"$(ethtool -m $line 2>/dev/null|grep 'Vendor PN'|awk '{print $NF}')\"]"`;if [[ $? -eq 1 ]];then echo "$etht";if [[ `echo "$stat"|grep "Appliance Name"|grep "Check Point"` ]];then echo -e "\n\tSKU auto-detect failed. Manually retrieve SKU with this command:";tput bold;echo -e "\tgrep SKU $file|grep -v \"TBD\"";tput sgr0;fi;else echo "$etht$data"|sed "s/^[ \t]*//"|tr -d '"{},'|tr -s " "|sed "s/:/@:/"|column -t -s '@'|sed "s/^/\t/"|grep -v "TBD"$;fi;echo;fi;((phys--));if [[ $phys -eq 0 ]] && [[ sfps -eq 0 ]];then echo -e " \033[1;31mNo SFPs/DACs found! \033[m\n";fi;done;unset stat sfps phys etht line data file;else echo -e " \033[1;31mUnsupported OS! \033[m\n";fi
Integrated with our ccc script.
🚀 Runs on all Check Point Gaia systems.
🎓 Referenced in sk180812
One-liner (Bash) to show the inventory of plugged transceivers, DAC cables and line cards.
In expert mode run:
echo;if [[ -f "/etc/cp-release" ]] && ! [[ `grep Embed /etc/cp-release` ]];then stat=`cpstat os`;tput bold;echo -n "$stat"|grep "Appliance Name:"|sed 's/Appliance Name://'|tr -s ' '|tr -d '\n';if [[ `echo "$stat"|grep "Maestro"` ]] && [[ `grep original_name /etc/appliance_config.xml|
Disclaimer: Check Point does not provide maintenance services or technical or customer support for third party content provided on this Site, including in CheckMates Toolbox. See also our Third Party Software Disclaimer.
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oliver_Fink

Advisor
2022-11-28
05:48 AM
Cool script. It noteworthy that it does not run on R80.30 (I know, that R80.30 is EoS!). Seems to work only on actual releases. Can you name the minimal version it runs on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


Champion
2022-11-28
05:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Employee
2024-09-03
11:01 AM
A link to this CheckMates post was added in https://support.checkpoint.com/results/sk/sk180812
A link to this CheckMates post was added in https://support.checkpoint.com/results/sk/sk180812
;