{"id":84,"date":"2013-04-18T12:56:14","date_gmt":"2013-04-18T11:56:14","guid":{"rendered":"http:\/\/blog.beufa.net\/?p=84"},"modified":"2014-09-01T19:38:13","modified_gmt":"2014-09-01T18:38:13","slug":"raspberry-pi-munin-monitoring-temperature","status":"publish","type":"post","link":"https:\/\/beufa.net\/fr\/blog\/raspberry-pi-munin-monitoring-temperature\/","title":{"rendered":"Raspberry Pi &#038; Munin, monitoring temp\u00e9rature"},"content":{"rendered":"<p>Suite \u00e0 l&#8217;installation d&#8217;un Raspberry Pi dans ma salon avec <a title=\"RaspBMC\" href=\"http:\/\/www.raspbmc.com\/\" target=\"_blank\">raspbmc<\/a>, et ayant d\u00e9j\u00e0 une solution de monitoring Munin @Home, je suis tomb\u00e9 sur cet article fort int\u00e9ressant pour surveiller la temp\u00e9rature de ce boitier.<\/p>\n<p>Pour cela, une fois munin-node install\u00e9 sur le raspberry, il suffit de cr\u00e9er un plugin bas\u00e9 sur la commande <a title=\"vcgencmd command\" href=\"http:\/\/elinux.org\/RPI_vcgencmd_usage\" target=\"_blank\"><strong><em>vcgencmd<\/em> <\/strong><\/a>permettant d&#8217;obtenir la temp\u00e9rature.<\/p>\n<pre class=\"brush:shell\">root@raspbmc:\/home\/pi# vim \/usr\/share\/munin\/plugins\/pi_temp\r\n\r\n#!\/bin\/sh\r\n#\r\n# Plugin to monitor raspberry pi internal Temperature\r\n# version: 2013-01-18\r\n# author: Dju\r\n#\r\n# install the plugin :\r\n# save it in \/usr\/share\/munin\/plugins, then activate it with a symbolic link\r\n# ln -s \/usr\/share\/munin\/plugins\/pi_temp \/etc\/munin\/plugins\/\r\n#\r\n# Magic markers (optional - only used by munin-config and some installation scripts):\r\n#%# family=contrib\r\n\r\nVCG=\/opt\/vc\/bin\/vcgencmd\r\nWARN=70\r\nCRIT=75\r\n\r\nif [ \"$1\" = \"autoconf\" ]; then\r\n        if [ -x $VCG ]; then\r\n                echo yes\r\n                exit 0\r\n        else\r\n                echo no\r\n                exit 1\r\n        fi\r\nelif [ \"$1\" = \"config\" ]; then\r\n        echo \"graph_title Pi Temperature\"\r\n        echo \"graph_args --base 1000\"\r\n        echo \"graph_vlabel Celsius\"\r\n        echo \"graph_category sensors\"\r\n        echo \"graph_info This graph shows Temperatur data from $LOCATION\"\r\n        echo \"temp.label temp\"\r\n        echo \"temp.type GAUGE\"\r\n        echo \"temp.info Celsius.\"\r\n        echo \"temp.colour 00ff00\"\r\n        echo \"temp.warning $WARN\"\r\n        echo \"temp.critical $CRIT\"\r\n        exit 0\r\nfi\r\n\r\ntemp=$($VCG measure_temp | cut -d'=' -f2 | cut -d\"'\" -f1)\r\necho \"temp.value $temp\"<\/pre>\n<p>Une fois ce plugin cr\u00e9\u00e9, faire un chmod +x du fichier puis activez le plugin avec un lien symbolique :<\/p>\n<pre class=\"brush:shell\">chmod +x \/usr\/share\/munin\/plugins\/pi_temp\r\nln -s \/usr\/share\/munin\/plugins\/pi_temp \/etc\/munin\/plugins\/<\/pre>\n<p>Il vous suffit alors de r\u00e9d\u00e9marrer le service munin-node et attendre quelques minutes pour voir apparaitre le graphique :<\/p>\n<figure id=\"attachment_86\" aria-describedby=\"caption-attachment-86\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/beufa.net\/wp-content\/uploads\/2013\/04\/pi_sensors_temperature.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-86\" src=\"https:\/\/beufa.net\/wp-content\/uploads\/2013\/04\/pi_sensors_temperature.png\" alt=\"Raspberry PI Temperature Munin Graph\" width=\"300\" height=\"182\" \/><\/a><figcaption id=\"caption-attachment-86\" class=\"wp-caption-text\">Raspberry PI Temperature Munin Graph<\/figcaption><\/figure>\n<p>Pour plus de d\u00e9tails sur la source de ce plugin et le fonctionnement du Raspberry Pi, voir ici : <a href=\"http:\/\/blog.crifo.org\/post\/2013\/01\/19\/reception-et-installation-du-raspberry-pi\" target=\"_blank\">http:\/\/blog.crifo.org\/post\/2013\/01\/19\/reception-et-installation-du-raspberry-pi<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suite \u00e0 l&#8217;installation d&#8217;un Raspberry Pi dans ma salon avec raspbmc, et ayant d\u00e9j\u00e0 une solution de monitoring Munin @Home, je suis tomb\u00e9 sur cet&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/beufa.net\/fr\/blog\/raspberry-pi-munin-monitoring-temperature\/\">Continue reading<span class=\"screen-reader-text\">Raspberry Pi &#038; Munin, monitoring temp\u00e9rature<\/span><\/a><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,23],"tags":[59,60,118,71],"class_list":["post-84","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberrypi","tag-munin","tag-munin-node","tag-raspberrypi","tag-raspbmc","entry"],"_links":{"self":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/84","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/comments?post=84"}],"version-history":[{"count":1,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/84\/revisions"}],"predecessor-version":[{"id":2493,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/84\/revisions\/2493"}],"wp:attachment":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/media?parent=84"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/categories?post=84"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/tags?post=84"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}