Skip to content

Commit

Permalink
fix asnnames mon
Browse files Browse the repository at this point in the history
  • Loading branch information
juztas committed Mar 11, 2024
1 parent a16639b commit 9e8228e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xrootd/xrootd-stageout-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN pip3 install pyasn psutil
RUN mkdir -p /opt/pyasn
RUN pyasn_util_download.py --latestv46 --filename /opt/pyasn/GeoIPASNum.rib && \
pyasn_util_convert.py --single /opt/pyasn/GeoIPASNum.rib /opt/pyasn/GeoIPASNum.dat && \
pyasn_util_asnames.py --output asnnames && \
pyasn_util_asnames.py --output /opt/pyasn/asnnames && \
rm -f /opt/pyasn/GeoIPASNum.rib


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Global]
onmissing = passthrough
#audience = https://wlcg.cern.ch/jwt/v1/any,k8s-redir.ultralight.org,k8s-redir-stageout.ultralight.org
audience = https://wlcg.cern.ch/jwt/v1/any,k8s-redir.ultralight.org,k8s-redir-stageout.ultralight.org

[Issuer CMS_IAM]
issuer = https://cms-auth.web.cern.ch/
Expand Down
6 changes: 2 additions & 4 deletions xrootd/xrootd-stageout-server/config/default/opt/xroot-mon.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def __init__(self, logger):
def __prepareASNs(self):
"""Prepare ASNs."""
self.asndb = pyasn.pyasn('/opt/pyasn/GeoIPASNum.dat')
self.asnnames = {}
if os.path.isfile('/opt/pyasn/asnnames'):
with open('/opt/pyasn/asnnames', 'r', encoding='utf-8') as fd:
tmpasns = json.load(fd)
Expand Down Expand Up @@ -236,9 +235,8 @@ def parseAllConnections(self):
for lasn, rasns in asns.items():
for rasn, countstats in rasns.items():
for status, countstat in countstats.items():
self.connectionGauge.labels(self.hostname, lasn, rasn, iptype,
countstat['name'], countstat['country'],
status, self.monlable).set(int(countstat['count']))
self.connectionGauge.labels(self.hostname, lasn, rasn, countstat['name'], countstat['country'],
status, iptype, self.monlable).set(int(countstat['count']))

def main(self):
""" Main Method"""
Expand Down

0 comments on commit 9e8228e

Please sign in to comment.