aprsd 3.4.4__py3-none-any.whl → 4.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aprsd/cli_helper.py +12 -5
- aprsd/client/aprsis.py +31 -9
- aprsd/client/base.py +13 -2
- aprsd/client/drivers/aprsis.py +6 -3
- aprsd/client/drivers/fake.py +15 -20
- aprsd/client/factory.py +0 -2
- aprsd/client/fake.py +0 -2
- aprsd/client/kiss.py +17 -2
- aprsd/client/stats.py +1 -3
- aprsd/cmds/completion.py +7 -4
- aprsd/cmds/dev.py +38 -42
- aprsd/cmds/fetch_stats.py +140 -143
- aprsd/cmds/healthcheck.py +5 -3
- aprsd/cmds/list_plugins.py +140 -134
- aprsd/cmds/listen.py +13 -9
- aprsd/cmds/server.py +53 -27
- aprsd/conf/__init__.py +1 -2
- aprsd/conf/client.py +3 -4
- aprsd/conf/common.py +19 -93
- aprsd/conf/log.py +2 -4
- aprsd/conf/opts.py +5 -4
- aprsd/conf/plugin_common.py +11 -121
- aprsd/exception.py +2 -0
- aprsd/log/log.py +7 -46
- aprsd/main.py +10 -4
- aprsd/packets/__init__.py +14 -4
- aprsd/packets/core.py +57 -67
- aprsd/packets/log.py +8 -8
- aprsd/packets/packet_list.py +9 -6
- aprsd/plugin.py +22 -11
- aprsd/plugins/notify.py +1 -4
- aprsd/plugins/weather.py +10 -8
- aprsd/stats/collector.py +5 -2
- aprsd/threads/__init__.py +3 -2
- aprsd/threads/aprsd.py +12 -7
- aprsd/threads/{keep_alive.py → keepalive.py} +14 -45
- aprsd/threads/registry.py +3 -3
- aprsd/threads/rx.py +9 -6
- aprsd/threads/stats.py +2 -2
- aprsd/threads/tx.py +3 -4
- aprsd/utils/__init__.py +42 -10
- aprsd/utils/json.py +9 -4
- aprsd/utils/keepalive_collector.py +55 -0
- aprsd/utils/trace.py +0 -2
- aprsd-4.0.1.dist-info/AUTHORS +1 -0
- {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/METADATA +307 -408
- aprsd-4.0.1.dist-info/RECORD +74 -0
- {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/WHEEL +1 -1
- aprsd/cmds/admin.py +0 -57
- aprsd/cmds/webchat.py +0 -662
- aprsd/conf/plugin_email.py +0 -105
- aprsd/plugins/email.py +0 -715
- aprsd/plugins/location.py +0 -181
- aprsd/threads/log_monitor.py +0 -121
- aprsd/web/__init__.py +0 -0
- aprsd/web/admin/__init__.py +0 -0
- aprsd/web/admin/static/css/index.css +0 -84
- aprsd/web/admin/static/css/prism.css +0 -4
- aprsd/web/admin/static/css/tabs.css +0 -35
- aprsd/web/admin/static/images/Untitled.png +0 -0
- aprsd/web/admin/static/images/aprs-symbols-16-0.png +0 -0
- aprsd/web/admin/static/images/aprs-symbols-16-1.png +0 -0
- aprsd/web/admin/static/images/aprs-symbols-64-0.png +0 -0
- aprsd/web/admin/static/images/aprs-symbols-64-1.png +0 -0
- aprsd/web/admin/static/images/aprs-symbols-64-2.png +0 -0
- aprsd/web/admin/static/js/charts.js +0 -235
- aprsd/web/admin/static/js/echarts.js +0 -465
- aprsd/web/admin/static/js/logs.js +0 -26
- aprsd/web/admin/static/js/main.js +0 -231
- aprsd/web/admin/static/js/prism.js +0 -12
- aprsd/web/admin/static/js/send-message.js +0 -114
- aprsd/web/admin/static/js/tabs.js +0 -28
- aprsd/web/admin/templates/index.html +0 -196
- aprsd/web/chat/static/css/chat.css +0 -115
- aprsd/web/chat/static/css/index.css +0 -66
- aprsd/web/chat/static/css/style.css.map +0 -1
- aprsd/web/chat/static/css/tabs.css +0 -41
- aprsd/web/chat/static/css/upstream/bootstrap.min.css +0 -6
- aprsd/web/chat/static/css/upstream/font.woff2 +0 -0
- aprsd/web/chat/static/css/upstream/google-fonts.css +0 -23
- aprsd/web/chat/static/css/upstream/jquery-ui.css +0 -1311
- aprsd/web/chat/static/css/upstream/jquery.toast.css +0 -28
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/icons.woff +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/icons.woff2 +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/outline-icons.woff +0 -0
- aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- aprsd/web/chat/static/images/Untitled.png +0 -0
- aprsd/web/chat/static/images/aprs-symbols-16-0.png +0 -0
- aprsd/web/chat/static/images/aprs-symbols-16-1.png +0 -0
- aprsd/web/chat/static/images/aprs-symbols-64-0.png +0 -0
- aprsd/web/chat/static/images/aprs-symbols-64-1.png +0 -0
- aprsd/web/chat/static/images/aprs-symbols-64-2.png +0 -0
- aprsd/web/chat/static/images/globe.svg +0 -3
- aprsd/web/chat/static/js/gps.js +0 -84
- aprsd/web/chat/static/js/main.js +0 -45
- aprsd/web/chat/static/js/send-message.js +0 -612
- aprsd/web/chat/static/js/tabs.js +0 -28
- aprsd/web/chat/static/js/upstream/bootstrap.bundle.min.js +0 -7
- aprsd/web/chat/static/js/upstream/jquery-3.7.1.min.js +0 -2
- aprsd/web/chat/static/js/upstream/jquery-ui.min.js +0 -13
- aprsd/web/chat/static/js/upstream/jquery.toast.js +0 -374
- aprsd/web/chat/static/js/upstream/semantic.min.js +0 -11
- aprsd/web/chat/static/js/upstream/socket.io.min.js +0 -7
- aprsd/web/chat/templates/index.html +0 -139
- aprsd/wsgi.py +0 -322
- aprsd-3.4.4.dist-info/AUTHORS +0 -13
- aprsd-3.4.4.dist-info/RECORD +0 -134
- {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/LICENSE +0 -0
- {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/entry_points.txt +0 -0
- {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/top_level.txt +0 -0
aprsd/cmds/fetch_stats.py
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
import logging
|
3
3
|
|
4
4
|
import click
|
5
|
-
from oslo_config import cfg
|
6
5
|
import requests
|
6
|
+
from oslo_config import cfg
|
7
7
|
from rich.console import Console
|
8
8
|
from rich.table import Table
|
9
9
|
|
@@ -13,31 +13,32 @@ from aprsd import cli_helper
|
|
13
13
|
from aprsd.main import cli
|
14
14
|
from aprsd.threads.stats import StatsStore
|
15
15
|
|
16
|
-
|
17
16
|
# setup the global logger
|
18
17
|
# log.basicConfig(level=log.DEBUG) # level=10
|
19
|
-
LOG = logging.getLogger(
|
18
|
+
LOG = logging.getLogger('APRSD')
|
20
19
|
CONF = cfg.CONF
|
21
20
|
|
22
21
|
|
23
22
|
@cli.command()
|
24
23
|
@cli_helper.add_options(cli_helper.common_options)
|
25
24
|
@click.option(
|
26
|
-
|
25
|
+
'--host',
|
26
|
+
type=str,
|
27
27
|
default=None,
|
28
|
-
help=
|
28
|
+
help='IP address of the remote aprsd admin web ui fetch stats from.',
|
29
29
|
)
|
30
30
|
@click.option(
|
31
|
-
|
31
|
+
'--port',
|
32
|
+
type=int,
|
32
33
|
default=None,
|
33
|
-
help=
|
34
|
+
help='Port of the remote aprsd web admin interface to fetch stats from.',
|
34
35
|
)
|
35
36
|
@click.pass_context
|
36
37
|
@cli_helper.process_standard_options
|
37
38
|
def fetch_stats(ctx, host, port):
|
38
39
|
"""Fetch stats from a APRSD admin web interface."""
|
39
40
|
console = Console()
|
40
|
-
console.print(f
|
41
|
+
console.print(f'APRSD Fetch-Stats started version: {aprsd.__version__}')
|
41
42
|
|
42
43
|
CONF.log_opt_values(LOG, logging.DEBUG)
|
43
44
|
if not host:
|
@@ -45,114 +46,110 @@ def fetch_stats(ctx, host, port):
|
|
45
46
|
if not port:
|
46
47
|
port = CONF.admin.web_port
|
47
48
|
|
48
|
-
msg = f
|
49
|
+
msg = f'Fetching stats from {host}:{port}'
|
49
50
|
console.print(msg)
|
50
51
|
with console.status(msg):
|
51
|
-
response = requests.get(f
|
52
|
+
response = requests.get(f'http://{host}:{port}/stats', timeout=120)
|
52
53
|
if not response:
|
53
54
|
console.print(
|
54
|
-
f
|
55
|
-
style=
|
55
|
+
f'Failed to fetch stats from {host}:{port}?',
|
56
|
+
style='bold red',
|
56
57
|
)
|
57
58
|
return
|
58
59
|
|
59
60
|
stats = response.json()
|
60
61
|
if not stats:
|
61
62
|
console.print(
|
62
|
-
f
|
63
|
-
style=
|
63
|
+
f'Failed to fetch stats from aprsd admin ui at {host}:{port}',
|
64
|
+
style='bold red',
|
64
65
|
)
|
65
66
|
return
|
66
67
|
|
67
68
|
aprsd_title = (
|
68
|
-
|
69
|
-
f
|
70
|
-
f
|
71
|
-
f
|
69
|
+
'APRSD '
|
70
|
+
f'[bold cyan]v{stats["APRSDStats"]["version"]}[/] '
|
71
|
+
f'Callsign [bold green]{stats["APRSDStats"]["callsign"]}[/] '
|
72
|
+
f'Uptime [bold yellow]{stats["APRSDStats"]["uptime"]}[/]'
|
72
73
|
)
|
73
74
|
|
74
|
-
console.rule(f
|
75
|
-
console.print(
|
75
|
+
console.rule(f'Stats from {host}:{port}')
|
76
|
+
console.print('\n\n')
|
76
77
|
console.rule(aprsd_title)
|
77
78
|
|
78
79
|
# Show the connection to APRS
|
79
80
|
# It can be a connection to an APRS-IS server or a local TNC via KISS or KISSTCP
|
80
|
-
if
|
81
|
-
title = f
|
81
|
+
if 'aprs-is' in stats:
|
82
|
+
title = f'APRS-IS Connection {stats["APRSClientStats"]["server_string"]}'
|
82
83
|
table = Table(title=title)
|
83
|
-
table.add_column(
|
84
|
-
table.add_column(
|
85
|
-
for key, value in stats[
|
84
|
+
table.add_column('Key')
|
85
|
+
table.add_column('Value')
|
86
|
+
for key, value in stats['APRSClientStats'].items():
|
86
87
|
table.add_row(key, value)
|
87
88
|
console.print(table)
|
88
89
|
|
89
|
-
threads_table = Table(title=
|
90
|
-
threads_table.add_column(
|
91
|
-
threads_table.add_column(
|
92
|
-
for name, alive in stats[
|
90
|
+
threads_table = Table(title='Threads')
|
91
|
+
threads_table.add_column('Name')
|
92
|
+
threads_table.add_column('Alive?')
|
93
|
+
for name, alive in stats['APRSDThreadList'].items():
|
93
94
|
threads_table.add_row(name, str(alive))
|
94
95
|
|
95
96
|
console.print(threads_table)
|
96
97
|
|
97
|
-
packet_totals = Table(title=
|
98
|
-
packet_totals.add_column(
|
99
|
-
packet_totals.add_column(
|
100
|
-
packet_totals.add_row(
|
101
|
-
packet_totals.add_row(
|
98
|
+
packet_totals = Table(title='Packet Totals')
|
99
|
+
packet_totals.add_column('Key')
|
100
|
+
packet_totals.add_column('Value')
|
101
|
+
packet_totals.add_row('Total Received', str(stats['PacketList']['rx']))
|
102
|
+
packet_totals.add_row('Total Sent', str(stats['PacketList']['tx']))
|
102
103
|
console.print(packet_totals)
|
103
104
|
|
104
105
|
# Show each of the packet types
|
105
|
-
packets_table = Table(title=
|
106
|
-
packets_table.add_column(
|
107
|
-
packets_table.add_column(
|
108
|
-
packets_table.add_column(
|
109
|
-
for key, value in stats[
|
110
|
-
packets_table.add_row(key, str(value[
|
106
|
+
packets_table = Table(title='Packets By Type')
|
107
|
+
packets_table.add_column('Packet Type')
|
108
|
+
packets_table.add_column('TX')
|
109
|
+
packets_table.add_column('RX')
|
110
|
+
for key, value in stats['PacketList']['packets'].items():
|
111
|
+
packets_table.add_row(key, str(value['tx']), str(value['rx']))
|
111
112
|
|
112
113
|
console.print(packets_table)
|
113
114
|
|
114
|
-
if
|
115
|
-
count = len(stats[
|
116
|
-
plugins_table = Table(title=f
|
117
|
-
plugins_table.add_column(
|
118
|
-
plugins_table.add_column(
|
119
|
-
plugins_table.add_column(
|
120
|
-
plugins_table.add_column(
|
121
|
-
plugins_table.add_column(
|
122
|
-
plugins = stats[
|
123
|
-
for key,
|
115
|
+
if 'plugins' in stats:
|
116
|
+
count = len(stats['PluginManager'])
|
117
|
+
plugins_table = Table(title=f'Plugins ({count})')
|
118
|
+
plugins_table.add_column('Plugin')
|
119
|
+
plugins_table.add_column('Enabled')
|
120
|
+
plugins_table.add_column('Version')
|
121
|
+
plugins_table.add_column('TX')
|
122
|
+
plugins_table.add_column('RX')
|
123
|
+
plugins = stats['PluginManager']
|
124
|
+
for key, _ in plugins.items():
|
124
125
|
plugins_table.add_row(
|
125
126
|
key,
|
126
|
-
str(plugins[key][
|
127
|
-
plugins[key][
|
128
|
-
str(plugins[key][
|
129
|
-
str(plugins[key][
|
127
|
+
str(plugins[key]['enabled']),
|
128
|
+
plugins[key]['version'],
|
129
|
+
str(plugins[key]['tx']),
|
130
|
+
str(plugins[key]['rx']),
|
130
131
|
)
|
131
132
|
|
132
133
|
console.print(plugins_table)
|
133
134
|
|
134
|
-
seen_list
|
135
|
-
|
136
|
-
if seen_list:
|
135
|
+
if seen_list := stats.get('SeenList'):
|
137
136
|
count = len(seen_list)
|
138
|
-
seen_table = Table(title=f
|
139
|
-
seen_table.add_column(
|
140
|
-
seen_table.add_column(
|
141
|
-
seen_table.add_column(
|
137
|
+
seen_table = Table(title=f'Seen List ({count})')
|
138
|
+
seen_table.add_column('Callsign')
|
139
|
+
seen_table.add_column('Message Count')
|
140
|
+
seen_table.add_column('Last Heard')
|
142
141
|
for key, value in seen_list.items():
|
143
|
-
seen_table.add_row(key, str(value[
|
142
|
+
seen_table.add_row(key, str(value['count']), value['last'])
|
144
143
|
|
145
144
|
console.print(seen_table)
|
146
145
|
|
147
|
-
watch_list
|
148
|
-
|
149
|
-
if watch_list:
|
146
|
+
if watch_list := stats.get('WatchList'):
|
150
147
|
count = len(watch_list)
|
151
|
-
watch_table = Table(title=f
|
152
|
-
watch_table.add_column(
|
153
|
-
watch_table.add_column(
|
148
|
+
watch_table = Table(title=f'Watch List ({count})')
|
149
|
+
watch_table.add_column('Callsign')
|
150
|
+
watch_table.add_column('Last Heard')
|
154
151
|
for key, value in watch_list.items():
|
155
|
-
watch_table.add_row(key, value[
|
152
|
+
watch_table.add_row(key, value['last'])
|
156
153
|
|
157
154
|
console.print(watch_table)
|
158
155
|
|
@@ -160,27 +157,27 @@ def fetch_stats(ctx, host, port):
|
|
160
157
|
@cli.command()
|
161
158
|
@cli_helper.add_options(cli_helper.common_options)
|
162
159
|
@click.option(
|
163
|
-
|
160
|
+
'--raw',
|
164
161
|
is_flag=True,
|
165
162
|
default=False,
|
166
|
-
help=
|
163
|
+
help='Dump raw stats instead of formatted output.',
|
167
164
|
)
|
168
165
|
@click.option(
|
169
|
-
|
170
|
-
default=[
|
171
|
-
help=
|
172
|
-
|
173
|
-
|
166
|
+
'--show-section',
|
167
|
+
default=['All'],
|
168
|
+
help='Show specific sections of the stats. '
|
169
|
+
' Choices: All, APRSDStats, APRSDThreadList, APRSClientStats,'
|
170
|
+
' PacketList, SeenList, WatchList',
|
174
171
|
multiple=True,
|
175
172
|
type=click.Choice(
|
176
173
|
[
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
174
|
+
'All',
|
175
|
+
'APRSDStats',
|
176
|
+
'APRSDThreadList',
|
177
|
+
'APRSClientStats',
|
178
|
+
'PacketList',
|
179
|
+
'SeenList',
|
180
|
+
'WatchList',
|
184
181
|
],
|
185
182
|
case_sensitive=False,
|
186
183
|
),
|
@@ -190,122 +187,122 @@ def fetch_stats(ctx, host, port):
|
|
190
187
|
def dump_stats(ctx, raw, show_section):
|
191
188
|
"""Dump the current stats from the running APRSD instance."""
|
192
189
|
console = Console()
|
193
|
-
console.print(f
|
190
|
+
console.print(f'APRSD Dump-Stats started version: {aprsd.__version__}')
|
194
191
|
|
195
|
-
with console.status(
|
192
|
+
with console.status('Dumping stats'):
|
196
193
|
ss = StatsStore()
|
197
194
|
ss.load()
|
198
195
|
stats = ss.data
|
199
196
|
if raw:
|
200
|
-
if
|
197
|
+
if 'All' in show_section:
|
201
198
|
console.print(stats)
|
202
199
|
return
|
203
200
|
else:
|
204
201
|
for section in show_section:
|
205
|
-
console.print(f
|
202
|
+
console.print(f'Dumping {section} section:')
|
206
203
|
console.print(stats[section])
|
207
204
|
return
|
208
205
|
|
209
|
-
t = Table(title=
|
210
|
-
t.add_column(
|
211
|
-
t.add_column(
|
212
|
-
for key, value in stats[
|
206
|
+
t = Table(title='APRSD Stats')
|
207
|
+
t.add_column('Key')
|
208
|
+
t.add_column('Value')
|
209
|
+
for key, value in stats['APRSDStats'].items():
|
213
210
|
t.add_row(key, str(value))
|
214
211
|
|
215
|
-
if
|
212
|
+
if 'All' in show_section or 'APRSDStats' in show_section:
|
216
213
|
console.print(t)
|
217
214
|
|
218
215
|
# Show the thread list
|
219
|
-
t = Table(title=
|
220
|
-
t.add_column(
|
221
|
-
t.add_column(
|
222
|
-
t.add_column(
|
223
|
-
t.add_column(
|
224
|
-
t.add_column(
|
225
|
-
for name, value in stats[
|
216
|
+
t = Table(title='Thread List')
|
217
|
+
t.add_column('Name')
|
218
|
+
t.add_column('Class')
|
219
|
+
t.add_column('Alive?')
|
220
|
+
t.add_column('Loop Count')
|
221
|
+
t.add_column('Age')
|
222
|
+
for name, value in stats['APRSDThreadList'].items():
|
226
223
|
t.add_row(
|
227
224
|
name,
|
228
|
-
value[
|
229
|
-
str(value[
|
230
|
-
str(value[
|
231
|
-
str(value[
|
225
|
+
value['class'],
|
226
|
+
str(value['alive']),
|
227
|
+
str(value['loop_count']),
|
228
|
+
str(value['age']),
|
232
229
|
)
|
233
230
|
|
234
|
-
if
|
231
|
+
if 'All' in show_section or 'APRSDThreadList' in show_section:
|
235
232
|
console.print(t)
|
236
233
|
|
237
234
|
# Show the plugins
|
238
|
-
t = Table(title=
|
239
|
-
t.add_column(
|
240
|
-
t.add_column(
|
241
|
-
t.add_column(
|
242
|
-
t.add_column(
|
243
|
-
t.add_column(
|
244
|
-
for name, value in stats[
|
235
|
+
t = Table(title='Plugin List')
|
236
|
+
t.add_column('Name')
|
237
|
+
t.add_column('Enabled')
|
238
|
+
t.add_column('Version')
|
239
|
+
t.add_column('TX')
|
240
|
+
t.add_column('RX')
|
241
|
+
for name, value in stats['PluginManager'].items():
|
245
242
|
t.add_row(
|
246
243
|
name,
|
247
|
-
str(value[
|
248
|
-
value[
|
249
|
-
str(value[
|
250
|
-
str(value[
|
244
|
+
str(value['enabled']),
|
245
|
+
value['version'],
|
246
|
+
str(value['tx']),
|
247
|
+
str(value['rx']),
|
251
248
|
)
|
252
249
|
|
253
|
-
if
|
250
|
+
if 'All' in show_section or 'PluginManager' in show_section:
|
254
251
|
console.print(t)
|
255
252
|
|
256
253
|
# Now show the client stats
|
257
|
-
t = Table(title=
|
258
|
-
t.add_column(
|
259
|
-
t.add_column(
|
260
|
-
for key, value in stats[
|
254
|
+
t = Table(title='Client Stats')
|
255
|
+
t.add_column('Key')
|
256
|
+
t.add_column('Value')
|
257
|
+
for key, value in stats['APRSClientStats'].items():
|
261
258
|
t.add_row(key, str(value))
|
262
259
|
|
263
|
-
if
|
260
|
+
if 'All' in show_section or 'APRSClientStats' in show_section:
|
264
261
|
console.print(t)
|
265
262
|
|
266
263
|
# now show the packet list
|
267
|
-
packet_list = stats.get(
|
268
|
-
t = Table(title=
|
269
|
-
t.add_column(
|
270
|
-
t.add_column(
|
271
|
-
t.add_row(
|
272
|
-
t.add_row(
|
273
|
-
|
274
|
-
if
|
264
|
+
packet_list = stats.get('PacketList')
|
265
|
+
t = Table(title='Packet List')
|
266
|
+
t.add_column('Key')
|
267
|
+
t.add_column('Value')
|
268
|
+
t.add_row('Total Received', str(packet_list['rx']))
|
269
|
+
t.add_row('Total Sent', str(packet_list['tx']))
|
270
|
+
|
271
|
+
if 'All' in show_section or 'PacketList' in show_section:
|
275
272
|
console.print(t)
|
276
273
|
|
277
274
|
# now show the seen list
|
278
|
-
seen_list = stats.get(
|
275
|
+
seen_list = stats.get('SeenList')
|
279
276
|
sorted_seen_list = sorted(
|
280
277
|
seen_list.items(),
|
281
278
|
)
|
282
|
-
t = Table(title=
|
283
|
-
t.add_column(
|
284
|
-
t.add_column(
|
285
|
-
t.add_column(
|
279
|
+
t = Table(title='Seen List')
|
280
|
+
t.add_column('Callsign')
|
281
|
+
t.add_column('Message Count')
|
282
|
+
t.add_column('Last Heard')
|
286
283
|
for key, value in sorted_seen_list:
|
287
284
|
t.add_row(
|
288
285
|
key,
|
289
|
-
str(value[
|
290
|
-
str(value[
|
286
|
+
str(value['count']),
|
287
|
+
str(value['last']),
|
291
288
|
)
|
292
289
|
|
293
|
-
if
|
290
|
+
if 'All' in show_section or 'SeenList' in show_section:
|
294
291
|
console.print(t)
|
295
292
|
|
296
293
|
# now show the watch list
|
297
|
-
watch_list = stats.get(
|
294
|
+
watch_list = stats.get('WatchList')
|
298
295
|
sorted_watch_list = sorted(
|
299
296
|
watch_list.items(),
|
300
297
|
)
|
301
|
-
t = Table(title=
|
302
|
-
t.add_column(
|
303
|
-
t.add_column(
|
298
|
+
t = Table(title='Watch List')
|
299
|
+
t.add_column('Callsign')
|
300
|
+
t.add_column('Last Heard')
|
304
301
|
for key, value in sorted_watch_list:
|
305
302
|
t.add_row(
|
306
303
|
key,
|
307
|
-
str(value[
|
304
|
+
str(value['last']),
|
308
305
|
)
|
309
306
|
|
310
|
-
if
|
307
|
+
if 'All' in show_section or 'WatchList' in show_section:
|
311
308
|
console.print(t)
|
aprsd/cmds/healthcheck.py
CHANGED
@@ -13,13 +13,15 @@ from oslo_config import cfg
|
|
13
13
|
from rich.console import Console
|
14
14
|
|
15
15
|
import aprsd
|
16
|
-
from aprsd import
|
17
|
-
|
16
|
+
from aprsd import ( # noqa: F401
|
17
|
+
cli_helper,
|
18
|
+
conf,
|
19
|
+
)
|
20
|
+
|
18
21
|
# local imports here
|
19
22
|
from aprsd.main import cli
|
20
23
|
from aprsd.threads import stats as stats_threads
|
21
24
|
|
22
|
-
|
23
25
|
# setup the global logger
|
24
26
|
# log.basicConfig(level=log.DEBUG) # level=10
|
25
27
|
CONF = cfg.CONF
|