Munin Temperature Monitoring


5 posts
by twem » Sat Sep 29, 2012 9:43 pm
I installed Munin on my PI today and wanted to see if i could get it to monitor the temperature.

I could not find a conclusive guide on how to set this up so i thought i would post my notes in case it helped anyone else.

Install munin as per normal.

Within the munin plugins folder
Code: Select all
/etc/munin/plugins

Write a new file, I called mine "temp"

Copy the below into the file
Code: Select all
#!/bin/sh

case $1 in
   config)
        cat <<'EOM'

graph_title Temperature
graph_vlabel temp in C
graph_args --base 1000 -l 0
graph_category Temperature
temp.label Temperature
temp.warning 60
temp.critical 85


EOM
        exit 0;;
esac
temp=`sudo /opt/vc/bin/vcgencmd measure_temp | cut -d"=" -f 2 | cut -d"'" -f 1`
echo "temp.value "$temp""


Then you need to change the sudoers file to allow the command to run, i kept getting
Code: Select all
VCHI initialization failed
for a long time before i worked this out.

Code: Select all
sudo visudo

Change the below
Code: Select all
#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL

to
Code: Select all
#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL
nobody ALL=(ALL) NOPASSWD: /opt/vc/bin/vcgencmd


To save and quit
Ctrl+x
y
Enter

its now ready to test
Code: Select all
munin-run temp


It should display the current temperature of your pi, after 5 min the new graph should show up in the munin web screens.

Code snippets are pulled from lots of different sites on the web I would give credit but I have forgotten where it all come from

Commends, Criticism, Improvements are all welcome
Posts: 3
Joined: Sun Jul 08, 2012 12:04 pm
by val » Sun Nov 04, 2012 3:09 pm
Hey,

just wanted to tell you that the the usage of sudo + sudoers is not really the way to do things for munin-node.

You can specify the user under which the script is run in the plugin configuration.

Create a file with the plugin name: /etc/munin/plugin-conf.d/temp

Put this inside the file:
Code: Select all
[ptemp]
user root


Cheers,
Val
Posts: 2
Joined: Sun Nov 04, 2012 2:58 pm
by val » Sun Nov 04, 2012 3:57 pm
val wrote:
Code: Select all
[ptemp]
user root

Woops.. copy+paste error (my plugin was named ptemp). This is the correct content of the file:

Code: Select all
[temp]
user root
Posts: 2
Joined: Sun Nov 04, 2012 2:58 pm
by sanchomuzax » Tue Apr 23, 2013 11:44 am
Can you help me?

What is it? I don't know that "this by eating or drinking". :mrgreen:
Code: Select all
VCHI initialization failed

What is the problem?
Code: Select all
$ munin-run temp
# Unknown service 'temp'

List of folder:
Image
Thank you for your help!
Posts: 6
Joined: Tue Apr 09, 2013 9:36 pm
by karlos13 » Wed May 01, 2013 3:52 am
I get the same thing, The standard graphs work though.

Its like the plugin is not enabled and it does not show up when I do the munin configure command.

This one also does not work either:
https://github.com/perception101/pisense

I get the impression I'm doing something wrong or is the plugin amiss?

EDIT: A permissions change on the /cache/plugins new plugin enabled it and all is good
Posts: 8
Joined: Wed May 01, 2013 3:36 am