From 71fd2c6c641b5d90f9770380e030c7a9065a2670 Mon Sep 17 00:00:00 2001 From: cn Date: Sun, 2 Jun 2013 23:14:07 +0200 Subject: [PATCH] Fiat lux --- README.md | 16 ++++++++++++++++ pcsensor | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 README.md create mode 100755 pcsensor diff --git a/README.md b/README.md new file mode 100644 index 0000000..6da2292 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +munin-pcsensor +============== + +Creates Munin graphs from the data delivered from an attached TEMPer USB Thermometer. +For data collection the `pcsensor` utility is needed (by default it resides in */usr/local/bin/*), it can be obtained in source or binary form from different places like [here](https://github.com/jeroensteenhuis/pcsensor). +Script was tested with pcsensor version 1.0.1. + +Install +------- + +Clone this repository or download the pcsensor file and create a +symlink as *root* in /etc/munin/plugins by using e.g.: + + cd /etc/munin/plugins; ln -s /path/to/pcsensor + +**Don't forget to restart your munin-node deamon.** diff --git a/pcsensor b/pcsensor new file mode 100755 index 0000000..55d3c17 --- /dev/null +++ b/pcsensor @@ -0,0 +1,23 @@ +#!/bin/bash + +# Where is pcsensor located? +PCSENSOR="/usr/local/bin/pcsensor" + +if [ ! -e ${PCSENSOR} ]; then + echo "pcsensor executable not found" >&2 + exit -1 +fi + +if [ "${1}" = "config" ]; then + echo "graph_title TEMPer USB Thermometer" + echo "graph_scale no" + echo "graph_vlabel Celsius" + echo "graph_category sensors" + echo "graph_info This graph shows the temperature reported by the first attached TEMPer USB Thermometer" + + echo "temp.label temperatue" + echo "temp.type GAUGE" +else + echo -n "temp.value " + ${PCSENSOR} -cm | head -n1 +fi