Skip to content

Commit

Permalink
Merge pull request #212 from wiedehopf/beta
Browse files Browse the repository at this point in the history
re-add adsbexchange feeder id lookup
  • Loading branch information
dirkhh authored May 18, 2024
2 parents 06c6134 + 2cd618c commit 7fd4cb1
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,39 @@ def check(self):
else:
print_err(f"airplanes.james returned {status}")
elif self._agg == "adsbx":
feeder_id = self._d.env_by_tags("adsbxfeederid").list_get(self._idx)
if not feeder_id or len(feeder_id) != 12:
# get the adsbexchange feeder id for the anywhere map / status things
print_err(f"don't have the adsbX Feeder ID for {self._idx}, yet")
container_name = (
"ultrafeeder"
if self._idx == 0
else f"ultrafeeder_stage2_{self._idx}"
)
try:
result = subprocess.run(
f"docker logs {container_name} | grep 'www.adsbexchange.com/api/feeders' | tail -1",
shell=True,
capture_output=True,
text=True,
)
output = result.stdout
except:
print_err("got exception trying to look at the adsbx logs")
return
match = re.search(
r"www.adsbexchange.com/api/feeders/\?feed=([^&\s]*)",
output,
)
if match:
adsbx_id = match.group(1)
self._d.env_by_tags("adsbxfeederid").list_set(self._idx, adsbx_id)
else:
print_err(
f"ran: docker logs {container_name} | grep 'www.adsbexchange.com/api/feeders' | tail -1"
)
print_err(f"failed to find adsbx ID in response {output}")

self._last_check = datetime.now()
# let's check the ultrafeeder net connector status to see if there is a TCP beast connection to adsbexchange
try:
Expand Down

0 comments on commit 7fd4cb1

Please sign in to comment.