-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from maklaut/master
Add munin plugins
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
# -*- sh -*- | ||
|
||
: << =cut | ||
=head1 NAME | ||
co2mon - Plugin to monitor MT8057 (RAD-0301) CO2 ppm values. | ||
=head1 NOTES | ||
=head1 CONFIGURATION | ||
The following environment variables are used by this plugin: | ||
warning - Warning CO2 ppm (Default: 800) | ||
critical - Critical CO2 ppm (Default: 1200) | ||
=head1 MAGIC MARKERS: | ||
#%# family=auto | ||
#%# capabilities=autoconf | ||
=cut | ||
|
||
. $MUNIN_LIBDIR/plugins/plugin.sh | ||
|
||
print_values() { | ||
co2=$(dbus-send --system --dest=io.github.dmage.CO2Mon --type=method_call --print-reply /io/github/dmage/CO2Mon io.github.dmage.CO2Mon.GetCO2 | grep -F uint16 | awk '{print $2}' ) | ||
[ ! -z "${co2}" ] && echo "co2.value ${co2}" | ||
} | ||
|
||
if [ "$1" = "autoconf" ]; then | ||
if [ -z "$(print_values)" ] ; then | ||
echo no | ||
else | ||
echo yes | ||
fi | ||
exit 0 | ||
fi | ||
|
||
if [ "$1" = "config" ]; then | ||
echo "graph_title CO2 ppm" | ||
# echo 'graph_args --upper-limit 3000 -l 0' | ||
echo 'graph_vlabel ppm' | ||
# echo 'graph_scale no' | ||
echo 'graph_category sensors' | ||
echo "co2.label CO2 ppm" | ||
warning=${warning:-800} | ||
print_warning co2 | ||
critical=${critical:-1200} | ||
print_critical co2 | ||
exit 0 | ||
fi | ||
|
||
print_values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/sh | ||
# -*- sh -*- | ||
|
||
: << =cut | ||
=head1 NAME | ||
co2mon_temp - Plugin to monitor MT8057 (RAD-0301) CO2 temperature values. | ||
=head1 NOTES | ||
=head1 CONFIGURATION | ||
The following environment variables are used by this plugin: | ||
warning - Warning temp (Default: 30) | ||
critical - Critical temp (Default: 35) | ||
=head1 MAGIC MARKERS: | ||
#%# family=auto | ||
#%# capabilities=autoconf | ||
=cut | ||
|
||
. $MUNIN_LIBDIR/plugins/plugin.sh | ||
|
||
print_values() { | ||
temp=$(dbus-send --system --dest=io.github.dmage.CO2Mon --type=method_call --print-reply /io/github/dmage/CO2Mon io.github.dmage.CO2Mon.GetTemperature | grep -F double | awk '{print $2}' ) | ||
[ ! -z "${temp}" ] && echo "temp.value ${temp}" | ||
} | ||
|
||
if [ "$1" = "autoconf" ]; then | ||
if [ -z "$(print_values)" ] ; then | ||
echo no | ||
else | ||
echo yes | ||
fi | ||
exit 0 | ||
fi | ||
|
||
if [ "$1" = "config" ]; then | ||
echo "graph_title Temperature" | ||
# echo 'graph_args --upper-limit 100 -l -10' | ||
echo 'graph_vlabel Degreess Celsius' | ||
# echo 'graph_scale no' | ||
echo 'graph_category sensors' | ||
echo "temp.label temp" | ||
warning=${warning:-30} | ||
print_warning temp | ||
critical=${critical:-35} | ||
print_critical temp | ||
exit 0 | ||
fi | ||
|
||
print_values |