--- /dev/null
+#!/bin/sh
+# -*- sh -*-
+
+: << =cut
+
+=head1 NAME
+
+co2mon - Plugin to monitor Atom Pro for radiation level
+
+=head1 NOTES
+
+
+=head1 CONFIGURATION
+
+The following environment variables are used by this plugin:
+
+ rad_warning - Warning CO2 ppm (Default: 50)
+ rad_critical - Critical CO2 ppm (Default: 100)
+
+=head1 MAGIC MARKERS:
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+. $MUNIN_LIBDIR/plugins/plugin.sh
+is_multigraph
+
+DATAFILE='/var/db/trinket/trinket.dat'
+
+print_values() {
+ rad=`/usr/bin/grep radlevel "$DATAFILE" | /usr/bin/sed -e 's/radlevel: //'`
+
+ echo 'multigraph rad'
+ echo "rad.value ${rad:-U}"
+}
+
+if [ "$1" = "autoconf" ]; then
+ if [ -s "$DATAFILE" ] ; then
+ echo yes
+ else
+ echo no
+ fi
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'multigraph rad'
+ echo "graph_title Radiation level, mkR/h"
+# echo 'graph_args --upper-limit 3000 -l 0'
+ echo 'graph_vlabel mkR/h'
+# echo 'graph_scale no'
+ echo 'graph_category sensors'
+ echo "rad.label Radiation level, mkR/h"
+ rad_warning=${rad_warning:-50}
+ rad_critical=${rad_critical:-100}
+ print_thresholds 'rad'
+
+ exit 0
+fi
+
+print_values