Closed OrEg0n closed 1 year ago
Hey @OrEg0n,
it's been a while since I've switched to persistent whois connection (9 months according to Git blame), so if the script ever worked in the last 9 months and only recently stopped working, I would assume that something odd is going on with your MacOS/homebrew/shell installation or configuration. I've found this thread where somebody reports a similar behavior, do you mind trying to reinstall hombrew (or bash
at least, since exec
is an integrated command) or trying the "safe mode" proposed solution?
Sorry but I don't have a MacOS machine handy, maybe @Antonio-Prado has seen / knows about this issue and could share some insight or suggestion on how to proceed?
As a last resort, I may supply you with a test version of asn
that reverts to the old (non-persistent whois connection) behavior, in order to confirm it is indeed what's breaking it.
Let me know
Hello @nitefood,
I very much appreciate your response! I strongly believe the issue is indeed with my MacOS/homebrew/shell installation or configuration. Perhaps a recent Homebrew update/upgrade caused it, but I will have more time over the weekend to try it all out, and I will update you on my findings. Hopefully, what I find can help others too.
Nonetheless, if you would not mind supplying a test version of asn that reverts to the older and non-persistent Whois connection, I would very much appreciate it. I would love to confirm if that is indeed what is breaking it, and I will share the results with you as soon as I run it.
Again, thank you so much! You did an outstanding job with this script, and it helps a lot.
Please find it attached, bear in mind it will probably give bogus output on some lookups (didn't have enough time to fully clean up the code, sorry) - but the purpose here is only to confirm the issue is gone. Let me know asn_nopersist.txt
Hi @nitefood,
Thank you for the test script, it worked perfectly, and that confirms the issue with the persistent connection indeed.
I will see if I can sort out, and I will paste my finding here soon ;).
Again, I very much appreciate it. Cheers!
Hello @nitefood! I hope all is well with you.
It is my understanding that the most recent update of Homebrew Core resolved the issue reported above. I can run the script again without issues, just as I did before I reported the issue above. It is possible that it may break again with future Homebrew Core updates, but I no longer have the issue at this time.
I very much appreciate your support and assistance. You have done brilliant work here, cheers!
Awesome, glad you got it sorted out :-)
Hello there!
I am not an expert, and it might not be an issue with the code, but something changed because your amazing script stopped working for me since yesterday. I am running it on MacOS Ventura 13.1 with Homebrew.
Below is what happens:
sudo ./asn -n 40021
╭──────────────────────╮ │ ASN lookup for 40021 │ ╰──────────────────────╯
AS Number ──> 40021 AS Name ──> CONTABO, US Organization ──> CONTABO (Contabo Inc.) Abuse contact ──> abuse@contabo.de AS Reg. date ──> 2019-12-25 01:26:48 Peering @IXPs ──> NONE
╭────────────────────────────────────────────╮ │ BGP informations for AS40021 (CONTABO, US) │ ╰────────────────────────────────────────────╯
Retrieving prefix allocations and announcements for AS40021 (CONTABO, US) (press CTRL-C to cancel)...zsh: killed sudo ./asn -n 40021
In an effort to pinpoint the issue, I also got the following:
bash -x asn -v 40021 137 ⨯
(I removed the long list of ports)
╭──────────────────────╮ │ ASN lookup for 40021 │ ╰──────────────────────╯
tput sgr 0
'[' false = true ']'
'[' false = true ']' ++ echo 40021 ++ sed 's/\/.*//g' ++ grep -Eo '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))'
input=
'[' -z '' ']' ++ echo 40021 ++ sed 's/[a|A][s|S]//g' ++ grep -E '^[0-9]*$'
asn=40021
'[' -z 40021 ']'
json_target_type=asn
WhoisASN 40021 ++ host -t TXT AS40021.asn.cymru.com ++ grep -v NXDOMAIN ++ awk '-F|' 'NR==1{print substr($NF,2,length($NF)-2)}'
found_asname='CONTABO, US'
'[' -n 'CONTABO, US' ']'
(( json_resultcount++ )) ++ whois -h whois.pwhois.org 'registry source-as=40021'
pwhois_full_asn_info='Org-Record: 0 Org-ID: CONTA-48 Org-Name: Contabo Inc. Can-Allocate: 0 Source: ARIN Street-1: 710 N Tucker Blvd. STE 420 City: St. Louis State: MO Postal-Code: 63101 Country: US Register-Date: 2019-12-23 Update-Date: 2020-02-17 Create-Date: Dec 25 2019 01:26:48 Modify-Date: Jan 12 2023 03:12:36 Admin-0-Handle: WINTZ1-ARIN NOC-0-Handle: CONTA393-ARIN Abuse-0-Handle: CAD61-ARIN Tech-0-Handle: CONTA392-ARIN' ++ tac ++ grep -m1 -E '^Org-Name'
pwhois_asn_info='Org-Name: Contabo Inc.'
pwhois_asn_info+='\n' ++ tac ++ grep -m1 -E '^Create-Date'
pwhois_asn_info+='Create-Date: Dec 25 2019 01:26:48' ++ docurl -m5 -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ DebugPrint 'curl -m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r 'select (.data.holder != null) | .data.holder' +++ echo -e 'curl -m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:18] DEBUG curl -m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn' [2023-01-12 16:45:18] DEBUG curl -m5 -s https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn ++ curl -m5 -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS40021&sourceapp=nitefood-asn'
found_holder=CONTABO ++ awk '-F - ' '{ if ( $2 ) {print $2} else {print} }'
found_holder=CONTABO ++ echo -e 'Org-Name: Contabo Inc.\nCreate-Date: Dec 25 2019 01:26:48' ++ grep -E '^Org-Name:' ++ cut -d : -f 2 ++ sed 's/^[ \t]*//'
found_org='Contabo Inc.'
[[ -z Contabo Inc. ]] ++ docurl -m5 -s 'https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ DebugPrint 'curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r 'select (.data.abuse_contacts[0] != null) | .data.abuse_contacts[0]' +++ echo -e 'curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:19] DEBUG curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn' [2023-01-12 16:45:19] DEBUG curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn ++ curl -m5 -s 'https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=AS40021&sourceapp=nitefood-asn'
found_abuse_contact=abuse@contabo.de
[[ -z abuse@contabo.de ]] ++ echo -e 'Org-Name: Contabo Inc.\nCreate-Date: Dec 25 2019 01:26:48' ++ grep -E '^Create-Date:' ++ cut -d : -f 2- ++ sed 's/^[ \t]*//'
pwhois_createdate='Dec 25 2019 01:26:48'
'[' false = true ']'
[[ -z Dec 25 2019 01:26:48 ]] ++ date -d 'Dec 25 2019 01:26:48' '+%Y-%m-%d %H:%M:%S' ++ gdate -d 'Dec 25 2019 01:26:48' '+%Y-%m-%d %H:%M:%S'
found_createdate='2019-12-25 01:26:48'
'[' -z 'CONTABO, US' ']'
target_asname='CONTABO, US'
'[' false = true ']'
echo -en '\n AS Number ──> 40021'
AS Number ──> 40021+ '[' false = true ']'
echo ''
echo -en ' AS Name ──> CONTABO, US' AS Name ──> CONTABO, US+ '[' false = true ']'
printf '\n'
echo -e ' Organization ──> CONTABO (Contabo Inc.)' Organization ──> CONTABO (Contabo Inc.)
echo -e ' Abuse contact ──> abuse@contabo.de' Abuse contact ──> abuse@contabo.de
echo -e ' AS Reg. date ──> 2019-12-25 01:26:48' AS Reg. date ──> 2019-12-25 01:26:48
echo -en ' Peering @IXPs ──> ' Peering @IXPs ──> + GetIXPresence 40021
asn=40021
ixps=
outputix=
json_ixps= ++ docurl -s 'https://www.peeringdb.com/api/net?asn__in=40021' ++ '[' true = true ']' ++ parm='-s https://www.peeringdb.com/api/net?asn__in=40021' ++ DebugPrint 'curl -s https://www.peeringdb.com/api/net?asn__in=40021' ++ '[' true = true ']' ++ jq -r '.data[].id' +++ echo -e 'curl -s https://www.peeringdb.com/api/net?asn__in=40021' +++ tr -d '\r\n' ++ dbgstring='curl -s https://www.peeringdb.com/api/net?asn__in=40021' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:20] DEBUG curl -s https://www.peeringdb.com/api/net?asn__in=40021' [2023-01-12 16:45:20] DEBUG curl -s https://www.peeringdb.com/api/net?asn__in=40021 ++ curl -s 'https://www.peeringdb.com/api/net?asn__in=40021'
netlist=
'[' -n '' ']'
outputix=' NONE '
'[' false = true ']'
echo -e ' NONE \n' NONE
BoxHeader 'BGP informations for AS40021 (CONTABO, US)'
[[ false = true ]]
local 'message=BGP informations for AS40021 (CONTABO, US)'
'[' false = true ']'
'[' false = true ']'
echo -e '\n╭────────────────────────────────────────────╮\n│ BGP informations for AS40021 (CONTABO, US) │\n╰────────────────────────────────────────────╯'
╭────────────────────────────────────────────╮ │ BGP informations for AS40021 (CONTABO, US) │ ╰────────────────────────────────────────────╯
tput sgr 0
echo ''
QueryRipestat 40021
StatusbarMessage 'Retrieving BGP data for AS40021 (CONTABO, US)'
[[ false = true ]]
'[' true = true ']'
return ++ docurl -m5 -s 'https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ DebugPrint 'curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' +++ echo -e 'curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:21] DEBUG curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn' [2023-01-12 16:45:21] DEBUG curl -m5 -s https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn ++ curl -m5 -s 'https://stat.ripe.net/data/routing-status/data.json?resource=AS40021&sourceapp=nitefood-asn'
ripestat_routing_data='{ "messages": [ [ "info", "Results exclude routes with very low visibility (less than 10 RIS full-feed peers seeing)." ], [ "warning", "Given query time (2023-01-12 16:00:00 UTC) has been changed because it is earlier than the time there is data available for!" ] ], "see_also": [], "version": "3.4", "data_call_name": "routing-status", "data_call_status": "supported - connecting to ursa", "cached": true, "data": { "first_seen": { "prefix": "72.166.7.0/24", "origin": "40021", "time": "2006-06-15T00:00:00" }, "last_seen": { "prefix": "85.239.240.0/21", "origin": "40021", "time": "2023-01-12T16:00:00" }, "visibility": { "v4": { "ris_peers_seeing": 371, "total_ris_peers": 371 }, "v6": { "ris_peers_seeing": 372, "total_ris_peers": 373 } }, "announced_space": { "v4": { "prefixes": 51, "ips": 72960 }, "v6": { "prefixes": 4, "48s": 262144 } }, "observed_neighbours": 5, "resource": "40021", "query_time": "2023-01-12T16:00:00" }, "query_id": "20230112214522-867191d5-4cf1-47d1-a01b-003412b0bc5c", "process_time": 3, "server_id": "app131", "build_version": "live.2022.12.15.141", "status": "ok", "status_code": 200, "time": "2023-01-12T21:45:22.330576" }'
'[' -n '{ "messages": [ [ "info", "Results exclude routes with very low visibility (less than 10 RIS full-feed peers seeing)." ], [ "warning", "Given query time (2023-01-12 16:00:00 UTC) has been changed because it is earlier than the time there is data available for!" ] ], "see_also": [], "version": "3.4", "data_call_name": "routing-status", "data_call_status": "supported - connecting to ursa", "cached": true, "data": { "first_seen": { "prefix": "72.166.7.0/24", "origin": "40021", "time": "2006-06-15T00:00:00" }, "last_seen": { "prefix": "85.239.240.0/21", "origin": "40021", "time": "2023-01-12T16:00:00" }, "visibility": { "v4": { "ris_peers_seeing": 371, "total_ris_peers": 371 }, "v6": { "ris_peers_seeing": 372, "total_ris_peers": 373 } }, "announced_space": { "v4": { "prefixes": 51, "ips": 72960 }, "v6": { "prefixes": 4, "48s": 262144 } }, "observed_neighbours": 5, "resource": "40021", "query_time": "2023-01-12T16:00:00" }, "query_id": "20230112214522-867191d5-4cf1-47d1-a01b-003412b0bc5c", "process_time": 3, "server_id": "app131", "build_version": "live.2022.12.15.141", "status": "ok", "status_code": 200, "time": "2023-01-12T21:45:22.330576" }' ']' ++ jq -r .data.announced_space.v4.prefixes
ripestat_ipv4=51 ++ jq -r .data.announced_space.v6.prefixes
ripestat_ipv6=4 ++ jq -r .data.observed_neighbours
ripestat_bgp=5
StatusbarMessage 'Retrieving peering data for AS40021 (CONTABO, US)'
[[ false = true ]]
'[' true = true ']'
return ++ docurl -m5 -s 'https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ DebugPrint 'curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' true = true ']' +++ echo -e 'curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:22] DEBUG curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn' [2023-01-12 16:45:22] DEBUG curl -m5 -s https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn ++ curl -m5 -s 'https://stat.ripe.net/data/asn-neighbours/data.json?resource=AS40021&sourceapp=nitefood-asn'
ripestat_neighbours_data='{ "messages": [ [ "info", "Query time has been set to the latest available time (2023-01-12 00:00 UTC)" ] ], "see_also": [], "version": "3.2", "data_call_name": "asn-neighbours", "data_call_status": "supported - connecting to ursa", "cached": false, "data": { "resource": "40021", "query_starttime": "2023-01-12T00:00:00", "query_endtime": "2023-01-12T00:00:00", "latest_time": "2023-01-12T00:00:00", "earliest_time": "2015-12-21T00:00:00", "neighbour_counts": { "left": 4, "right": 1, "unique": 5, "uncertain": 0 }, "neighbours": [ { "asn": 174, "type": "left", "power": 995, "v4_peers": 19084, "v6_peers": 1622 }, { "asn": 3356, "type": "left", "power": 346, "v4_peers": 5333, "v6_peers": 210 }, { "asn": 46887, "type": "left", "power": 433, "v4_peers": 381, "v6_peers": 382 }, { "asn": 62943, "type": "left", "power": 219, "v4_peers": 612, "v6_peers": 0 }, { "asn": 6428, "type": "right", "power": 582, "v4_peers": 5843, "v6_peers": 712 } ] }, "query_id": "20230112214523-8d2459ad-8691-49de-947f-435b7acedade", "process_time": 124, "server_id": "app137", "build_version": "live.2022.12.15.141", "status": "ok", "status_code": 200, "time": "2023-01-12T21:45:23.371517" }' ++ jq -r '.data.neighbours | sort_by(.power) | reverse[] | select (.type=="left") | .asn'
upstream_peers='174 46887 3356 62943' ++ jq -r '.data.neighbours | sort_by(.power) | reverse[] | select (.type=="right") | .asn'
downstream_peers=6428 ++ jq -r '.data.neighbours | sort_by(.power) | reverse[] | select (.type=="uncertain") | .asn'
uncertain_peers=
'[' false = true ']'
RESOLVE_COUNT=8
OUTPUT_PEERS_PER_LINE=4 ++ echo '174 46887 3356 62943' ++ wc -l ++ gwc -l
upstream_peercount=4
resolved_upstream_peers=
count=0 ++ echo -e '174 46887 3356 62943' ++ head -n 8
for peer in $(echo -e "$upstream_peers" | head -n $RESOLVE_COUNT)
(( count++ )) ++ docurl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' ++ DebugPrint 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r .data.holder ++ sed 's/ - .*//' +++ echo -e 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:23] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn' [2023-01-12 16:45:23] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn ++ curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS174&sourceapp=nitefood-asn'
peername=COGENT-174
'[' false = true ']'
resolved_upstream_peers+=' COGENT-174 (174) '
[[ 1 -eq 0 ]]
for peer in $(echo -e "$upstream_peers" | head -n $RESOLVE_COUNT)
(( count++ )) ++ docurl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' ++ DebugPrint 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r .data.holder ++ sed 's/ - .*//' +++ echo -e 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:24] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn' [2023-01-12 16:45:24] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn ++ curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS46887&sourceapp=nitefood-asn'
peername=LIGHTOWER
'[' false = true ']'
resolved_upstream_peers+=' LIGHTOWER (46887) '
[[ 2 -eq 0 ]]
for peer in $(echo -e "$upstream_peers" | head -n $RESOLVE_COUNT)
(( count++ )) ++ docurl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' ++ DebugPrint 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r .data.holder ++ sed 's/ - .*//' +++ echo -e 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:25] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn' [2023-01-12 16:45:25] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn ++ curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS3356&sourceapp=nitefood-asn'
peername=LEVEL3
'[' false = true ']'
resolved_upstream_peers+=' LEVEL3 (3356) '
[[ 3 -eq 0 ]]
for peer in $(echo -e "$upstream_peers" | head -n $RESOLVE_COUNT)
(( count++ )) ++ docurl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' ++ DebugPrint 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' ++ jq -r .data.holder ++ '[' true = true ']' ++ sed 's/ - .*//' +++ echo -e 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:25] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn' [2023-01-12 16:45:25] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn ++ curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS62943&sourceapp=nitefood-asn'
peername=AS62943-BLUEBIRD-NETWORK
'[' false = true ']'
resolved_upstream_peers+=' AS62943-BLUEBIRD-NETWORK (62943) '
[[ 0 -eq 0 ]]
resolved_upstream_peers+='\n'
unresolved_peercount=-4
'[' -4 -ge 1 ']'
upstream_peers=' COGENT-174 (174) LIGHTOWER (46887) LEVEL3 (3356) AS62943-BLUEBIRD-NETWORK (62943) \n' ++ echo 6428 ++ wc -l ++ gwc -l
downstream_peercount=1
resolved_downstream_peers=
count=0 ++ echo -e 6428 ++ head -n 8
for peer in $(echo -e "$downstream_peers" | head -n $RESOLVE_COUNT)
(( count++ )) ++ docurl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' ++ DebugPrint 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r .data.holder ++ sed 's/ - .*//' +++ echo -e 'curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:26] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn' [2023-01-12 16:45:26] DEBUG curl -s https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn ++ curl -s 'https://stat.ripe.net/data/as-overview/data.json?resource=AS6428&sourceapp=nitefood-asn'
peername=CDM
'[' false = true ']'
resolved_downstream_peers+=' CDM (6428) '
[[ 1 -eq 0 ]]
unresolved_peercount=-7
'[' -7 -ge 1 ']'
downstream_peers=' CDM (6428) ' ++ echo '' ++ wc -l ++ gwc -l
uncertain_peercount=1
resolved_uncertain_peers=
count=0 ++ echo -e '' ++ head -n 8
unresolved_peercount=-7
'[' -7 -ge 1 ']'
uncertain_peers=
StatusbarMessage 'Retrieving prefix allocations and announcements for AS40021 (CONTABO, US)'
[[ false = true ]]
'[' true = true ']'
return
ipv4_inetnums=
ipv4_other_inetnums=
ipv6_inetnums=
json_ipv4_other_inetnums=
json_ipv6_other_inetnums= ++ docurl -m10 -s 'https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ parm='-m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' ++ DebugPrint 'curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' ++ '[' true = true ']' ++ jq -r '.data.prefixes[].prefix' +++ echo -e 'curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' +++ tr -d '\r\n' ++ dbgstring='curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' ++ '[' false = false ']' +++ date '+%F %T' +++ gdate '+%F %T' ++ echo -e '[2023-01-12 16:45:27] DEBUG curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn' [2023-01-12 16:45:27] DEBUG curl -m10 -s https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn ++ curl -m10 -s 'https://stat.ripe.net/data/announced-prefixes/data.json?resource=40021&sourceapp=nitefood-asn'
ripe_prefixes='209.126.70.0/24 85.239.232.0/21 154.53.56.0/21 85.239.240.0/21 154.12.240.0/21 66.94.120.0/21 66.94.116.0/23 144.126.152.0/21 144.126.144.0/22 89.117.144.0/21 86.48.28.0/22 45.137.192.0/24 207.244.224.0/20 85.239.250.0/24 154.53.40.0/21 85.239.230.0/23 206.225.31.0/24 2605:a142::/32 154.12.248.0/22 185.187.235.0/24 66.94.119.0/24 154.53.32.0/21 209.126.79.0/24 209.145.48.0/20 2605:a141::/32 154.12.224.0/21 154.53.48.0/21 207.244.240.0/20 154.12.252.0/22 86.48.16.0/22 85.239.248.0/23 89.117.72.0/21 86.48.24.0/22 2605:a140::/32 209.126.0.0/20 154.38.160.0/21 144.126.148.0/22 66.94.104.0/21 66.94.118.0/24 86.48.20.0/22 209.126.80.0/21 194.113.67.0/24 38.105.232.0/24 38.105.209.0/24 144.126.128.0/20 45.137.194.0/24 154.12.232.0/21 66.94.112.0/22 209.126.77.0/24 66.94.96.0/21 5.180.151.0/24 176.57.165.0/24 89.117.16.0/21 194.140.196.0/22 2605:a143::/32' ++ jq -cM --slurp --raw-input 'split("\n") | map(select(length > 0)) | {v4:map(select(contains(":")|not)), v6:map(select(contains(":")))}'
json_ripe_prefixes='{"v4":["209.126.70.0/24","85.239.232.0/21","154.53.56.0/21","85.239.240.0/21","154.12.240.0/21","66.94.120.0/21","66.94.116.0/23","144.126.152.0/21","144.126.144.0/22","89.117.144.0/21","86.48.28.0/22","45.137.192.0/24","207.244.224.0/20","85.239.250.0/24","154.53.40.0/21","85.239.230.0/23","206.225.31.0/24","154.12.248.0/22","185.187.235.0/24","66.94.119.0/24","154.53.32.0/21","209.126.79.0/24","209.145.48.0/20","154.12.224.0/21","154.53.48.0/21","207.244.240.0/20","154.12.252.0/22","86.48.16.0/22","85.239.248.0/23","89.117.72.0/21","86.48.24.0/22","209.126.0.0/20","154.38.160.0/21","144.126.148.0/22","66.94.104.0/21","66.94.118.0/24","86.48.20.0/22","209.126.80.0/21","194.113.67.0/24","38.105.232.0/24","38.105.209.0/24","144.126.128.0/20","45.137.194.0/24","154.12.232.0/21","66.94.112.0/22","209.126.77.0/24","66.94.96.0/21","5.180.151.0/24","176.57.165.0/24","89.117.16.0/21","194.140.196.0/22"],"v6":["2605:a142::/32","2605:a141::/32","2605:a140::/32","2605:a143::/32"]}' ++ grep -v : ++ grep -Ev '^\n' ++ sort
ipv4_ripe_prefixes='144.126.128.0/20 144.126.144.0/22 144.126.148.0/22 144.126.152.0/21 154.12.224.0/21 154.12.232.0/21 154.12.240.0/21 154.12.248.0/22 154.12.252.0/22 154.38.160.0/21 154.53.32.0/21 154.53.40.0/21 154.53.48.0/21 154.53.56.0/21 176.57.165.0/24 185.187.235.0/24 194.113.67.0/24 194.140.196.0/22 206.225.31.0/24 207.244.224.0/20 207.244.240.0/20 209.126.0.0/20 209.126.70.0/24 209.126.77.0/24 209.126.79.0/24 209.126.80.0/21 209.145.48.0/20 38.105.209.0/24 38.105.232.0/24 45.137.192.0/24 45.137.194.0/24 5.180.151.0/24 66.94.104.0/21 66.94.112.0/22 66.94.116.0/23 66.94.118.0/24 66.94.119.0/24 66.94.120.0/21 66.94.96.0/21 85.239.230.0/23 85.239.232.0/21 85.239.240.0/21 85.239.248.0/23 85.239.250.0/24 86.48.16.0/22 86.48.20.0/22 86.48.24.0/22 86.48.28.0/22 89.117.144.0/21 89.117.16.0/21 89.117.72.0/21' ++ wc -l ++ gwc -l
ipv4_ripe_prefixes_count=51 ++ grep : ++ grep -Ev '^\n' ++ sort
ipv6_ripe_prefixes='2605:a140::/32So 2605:a141::/32 2605:a142::/32 2605:a143::/32' ++ wc -l ++ gwc -l
ipv6_ripe_prefixes_count=4
exec zsh: killed bash -x asn -v 40021
Sorry for the long output, I hope it helps. Looking at the script, I have the impression the problem is when it tries to open a persistent connection to RIPE Whois.
Thank you for the amazing script!