summaryrefslogtreecommitdiffstats
path: root/doc/stats_dabmod_munin.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-18 16:24:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-18 16:24:03 +0200
commit4399f65e6174da785ebb673fe753f1bc61b57ebf (patch)
tree7c7398c5b25499db0adc8d8bab602a65d4fe212c /doc/stats_dabmod_munin.py
parent9df483045b5622af8902c07b54c7f985e12b1671 (diff)
downloaddabmod-4399f65e6174da785ebb673fe753f1bc61b57ebf.tar.gz
dabmod-4399f65e6174da785ebb673fe753f1bc61b57ebf.tar.bz2
dabmod-4399f65e6174da785ebb673fe753f1bc61b57ebf.zip
Add num SVs and holdover to munin
Diffstat (limited to 'doc/stats_dabmod_munin.py')
-rwxr-xr-xdoc/stats_dabmod_munin.py37
1 files changed, 33 insertions, 4 deletions
diff --git a/doc/stats_dabmod_munin.py b/doc/stats_dabmod_munin.py
index b9e2295..2f88d5d 100755
--- a/doc/stats_dabmod_munin.py
+++ b/doc/stats_dabmod_munin.py
@@ -142,15 +142,31 @@ frames.label Number of SoapySDR/UHD frames
frames.type DERIVE
frames.min 0"""
+# One GAUGE multigraph
+# sdr gpsdo_num_sv
+config_all += """
+multigraph sdr_gpsdo_sv_holdover
+graph_title Number of GNSS SVs used and holdover state
+graph_order num_sv holdover
+graph_vlabel Number of GNSS SVs and holdover state
+graph_category dabmod
+graph_info This graph shows the number of Satellite Vehicles the GNSS receiver uses (Field 7 of GNGGA NMEA sentence), and if it is in holdover
+
+num_sv.info Num SVs
+num_sv.label Num SVs
+num_sv.min 0
+num_sv.max 20
+
+holdover.info Holdover
+holdover.label Holdover
+holdover.min 0
+holdover.max 1"""
+
ctx = zmq.Context()
class RCException(Exception):
pass
-if not os.environ.get("MUNIN_CAP_MULTIGRAPH"):
- sys.stderr.write("This needs munin version 1.4 at least\n")
- sys.exit(1)
-
def do_transaction(message_parts, sock):
"""To a send + receive transaction, quit whole program on timeout"""
if isinstance(message_parts, str):
@@ -287,6 +303,19 @@ if len(sys.argv) == 1:
sdr_latepackets = get_rc_value("sdr", "latepackets", sock)
munin_values += handle_re("latepackets", re_int_value, sdr_latepackets)
+ munin_values += "multigraph sdr_gpsdo_sv_holdover\n"
+ try:
+ gps_num_sv = get_rc_value("sdr", "gpsdo_num_sv", sock)
+ munin_values += "num_sv.value {}\n".format(gps_num_sv)
+ except:
+ munin_values += "num_sv.value U\n"
+
+ try:
+ gps_holdover = get_rc_value("sdr", "gpsdo_holdover", sock)
+ munin_values += "holdover.value {}\n".format(gps_holdover)
+ except:
+ munin_values += "holdover.value U\n"
+
munin_values += "multigraph sdr_frames\n"
sdr_frames = get_rc_value("sdr", "frames", sock)
munin_values += handle_re("frames", re_int_value, sdr_frames)