Cleanup + Update Actions
This commit is contained in:
parent
57ce843887
commit
8371523e28
10
.github/workflows/DockerBuildAndPush.yml
vendored
10
.github/workflows/DockerBuildAndPush.yml
vendored
@ -10,16 +10,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v2
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
-
|
-
|
||||||
name: Login to GitHub Container Registry
|
name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@ -32,7 +32,7 @@ jobs:
|
|||||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
|||||||
117
main.py
117
main.py
@ -23,7 +23,7 @@ class NetgearLTEMetrics:
|
|||||||
self.app_port = app_port
|
self.app_port = app_port
|
||||||
self.polling_interval_seconds = polling_interval_seconds
|
self.polling_interval_seconds = polling_interval_seconds
|
||||||
|
|
||||||
#NetgearLTE
|
#Netgear LTE
|
||||||
self.rx_level = Gauge("netgear_lte_rx_level", "RX Level")
|
self.rx_level = Gauge("netgear_lte_rx_level", "RX Level")
|
||||||
self.tx_level = Gauge("netgear_lte_tx_level", "TX Level")
|
self.tx_level = Gauge("netgear_lte_tx_level", "TX Level")
|
||||||
self.radio_quality = Gauge("netgear_lte_radio_quality", "Radio Quality")
|
self.radio_quality = Gauge("netgear_lte_radio_quality", "Radio Quality")
|
||||||
@ -53,10 +53,6 @@ class NetgearLTEMetrics:
|
|||||||
new values.
|
new values.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Fetch raw status data from the application
|
|
||||||
# resp = requests.get(url=f"http://localhost:{self.app_port}/status")
|
|
||||||
# status_data = resp.json()
|
|
||||||
|
|
||||||
jar = aiohttp.CookieJar(unsafe=True)
|
jar = aiohttp.CookieJar(unsafe=True)
|
||||||
websession = aiohttp.ClientSession(cookie_jar=jar)
|
websession = aiohttp.ClientSession(cookie_jar=jar)
|
||||||
|
|
||||||
@ -67,7 +63,6 @@ class NetgearLTEMetrics:
|
|||||||
|
|
||||||
await websession.close()
|
await websession.close()
|
||||||
|
|
||||||
|
|
||||||
self.rx_level.set(result.rx_level)
|
self.rx_level.set(result.rx_level)
|
||||||
self.tx_level.set(result.tx_level)
|
self.tx_level.set(result.tx_level)
|
||||||
self.radio_quality.set(result.radio_quality)
|
self.radio_quality.set(result.radio_quality)
|
||||||
@ -88,106 +83,6 @@ class NetgearLTEMetrics:
|
|||||||
|
|
||||||
await websession.close()
|
await websession.close()
|
||||||
|
|
||||||
# async def get_information():
|
|
||||||
# """Example of printing the current upstream."""
|
|
||||||
# jar = aiohttp.CookieJar(unsafe=True)
|
|
||||||
# websession = aiohttp.ClientSession(cookie_jar=jar)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# modem = eternalegypt.Modem(hostname=os.getenv("MODEM_HOST"), websession=websession)
|
|
||||||
# await modem.login(password=os.getenv("MODEM_PASS"))
|
|
||||||
|
|
||||||
# result = await modem.information()
|
|
||||||
# # if len(sys.argv) == 3:
|
|
||||||
# print("serial_number: {}".format(result.serial_number))
|
|
||||||
# print("usage: {}".format(result.usage))
|
|
||||||
# print("upstream: {}".format(result.upstream))
|
|
||||||
# print("wire_connected: {}".format(result.wire_connected))
|
|
||||||
# print("mobile_connected: {}".format(result.mobile_connected))
|
|
||||||
# print("connection_text: {}".format(result.connection_text))
|
|
||||||
# print("connection_type: {}".format(result.connection_type))
|
|
||||||
# print("current_nw_service_type: {}".format(result.current_nw_service_type))
|
|
||||||
# print("current_ps_service_type: {}".format(result.current_ps_service_type))
|
|
||||||
# print("register_network_display: {}".format(result.register_network_display))
|
|
||||||
# print("roaming: {}".format(result.roaming))
|
|
||||||
# print("radio_quality: {}".format(result.radio_quality))
|
|
||||||
# print("rx_level: {}".format(result.rx_level))
|
|
||||||
# print("tx_level: {}".format(result.tx_level))
|
|
||||||
# print("current_band: {}".format(result.current_band))
|
|
||||||
# print("cell_id: {}".format(result.cell_id))
|
|
||||||
# # else:
|
|
||||||
# # key = sys.argv[3]
|
|
||||||
# # print("{}: {}".format(key, result.items.get(key)))
|
|
||||||
|
|
||||||
# await modem.logout()
|
|
||||||
# except eternalegypt.Error:
|
|
||||||
# print("Could not login")
|
|
||||||
|
|
||||||
# await websession.close()
|
|
||||||
|
|
||||||
# async def debugStuff():
|
|
||||||
# jar = aiohttp.CookieJar(unsafe=True)
|
|
||||||
# websession = aiohttp.ClientSession(cookie_jar=jar)
|
|
||||||
|
|
||||||
# modem = eternalegypt.Modem(hostname="xxx", websession=websession)
|
|
||||||
# await modem.login(password="xxx")
|
|
||||||
# await modem.delete_sms(sms_id=0)
|
|
||||||
# await modem.delete_sms(sms_id=1)
|
|
||||||
# await modem.delete_sms(sms_id=2)
|
|
||||||
# await modem.sms(message="Thisisatest",phone="xxx")
|
|
||||||
# await modem.logout()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# @autologin
|
|
||||||
# async def information(self):
|
|
||||||
# """Return the current information."""
|
|
||||||
# url = self._url('model.json')
|
|
||||||
# async with self.websession.get(url) as response:
|
|
||||||
# data = json.loads(await response.text())
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# result = self._build_information(data)
|
|
||||||
# _LOGGER.debug("Did read information: %s", data)
|
|
||||||
# except KeyError as ex:
|
|
||||||
# _LOGGER.debug("Failed to read information (%s): %s", ex, data)
|
|
||||||
# raise Error()
|
|
||||||
|
|
||||||
# self._sms_events(result)
|
|
||||||
|
|
||||||
# return result
|
|
||||||
|
|
||||||
# data['sms']['unreadMsgs']
|
|
||||||
# data['sms']['msgCount']
|
|
||||||
# data['general']['appVersion']
|
|
||||||
|
|
||||||
# result.serial_number
|
|
||||||
# result.usage
|
|
||||||
# result.upstream
|
|
||||||
# result.wire_connected
|
|
||||||
# result.mobile_connected
|
|
||||||
# result.connection_text
|
|
||||||
# result.connection_type
|
|
||||||
# result.current_nw_service_type
|
|
||||||
# result.current_ps_service_type
|
|
||||||
# result.register_network_display
|
|
||||||
# result.roaming
|
|
||||||
# result.radio_quality
|
|
||||||
# result.rx_level
|
|
||||||
# result.tx_level
|
|
||||||
# result.current_band
|
|
||||||
# result.cell_id
|
|
||||||
|
|
||||||
# async def login():
|
|
||||||
# jar = aiohttp.CookieJar(unsafe=True)
|
|
||||||
# websession = aiohttp.ClientSession(cookie_jar=jar)
|
|
||||||
|
|
||||||
# modem = eternalegypt.Modem(hostname="xxx", websession=websession)
|
|
||||||
# await modem.login(password="xxx")
|
|
||||||
|
|
||||||
|
|
||||||
# await websession.close()
|
|
||||||
# return modem
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point"""
|
"""Main entry point"""
|
||||||
@ -196,16 +91,6 @@ def main():
|
|||||||
app_port = int(os.getenv("APP_PORT", "80"))
|
app_port = int(os.getenv("APP_PORT", "80"))
|
||||||
exporter_port = int(os.getenv("EXPORTER_PORT", "9877"))
|
exporter_port = int(os.getenv("EXPORTER_PORT", "9877"))
|
||||||
|
|
||||||
# asyncio.get_event_loop().run_until_complete(get_information())
|
|
||||||
|
|
||||||
# modem = asyncio.get_event_loop().run_until_complete(login())
|
|
||||||
|
|
||||||
# asyncio.get_event_loop().run_until_complete(debugStuff())
|
|
||||||
|
|
||||||
# while(True):
|
|
||||||
# asyncio.get_event_loop().run_until_complete(get_information())
|
|
||||||
# time.sleep(2)
|
|
||||||
|
|
||||||
app_metrics = NetgearLTEMetrics(
|
app_metrics = NetgearLTEMetrics(
|
||||||
app_port=app_port,
|
app_port=app_port,
|
||||||
polling_interval_seconds=polling_interval_seconds
|
polling_interval_seconds=polling_interval_seconds
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user