{"id":90,"date":"2015-05-13T18:37:23","date_gmt":"2015-05-13T16:37:23","guid":{"rendered":"https:\/\/blog.unetresgrossebite.com\/?p=90"},"modified":"2015-05-14T01:17:36","modified_gmt":"2015-05-13T23:17:36","slug":"munin","status":"publish","type":"post","link":"https:\/\/blog.unetresgrossebite.com\/?p=90","title":{"rendered":"Munin"},"content":{"rendered":"<p>Munin is a popular supervision solution mostly based on perl.<\/p>\n<p>As of most supervision and monitoring solution, munin relies on an agent you would install on hosts to track metrics from, and a server gathering metrics and serving them via CGI, generating graphics from collected data.<br \/>\nAs of most supervision and monitoring solutions, munin uses loadable probes (plugins) to extract metrics.<\/p>\n<p>The server side consists of a crontab. Iterating on all your hosts, it would list and execute all available probes, store the results into RRD.<br \/>\nOver thousand hosts, you may need to export munin working root to some tmpfs storage, adding a crontab to regularly rsync the content from this tmpfs to a persistent directory. In any case, hosting your filesystem on some SSD is relevant.<\/p>\n<p>The main advantage of munin over its alternatives, I think, is its simplicity.<br \/>\nMain concurrent here being Collectd, which default web front end is particularly ugly and unpractical. And alternate front ends such as SickMuse are nice-looking, but still lack from simplicity, while some require excessively redundant configuration before being able to present something comparable to munin, in terms of relevance and efficiency.<\/p>\n<p>It is also very easy, to implement your own probes. From scripts to binaries, with a simple way to set contextual variables &#8211; evaluated when the plugin name matches the context expression &#8211; and requiring a single declaration on the server to collect all metrics served by a node: I don&#8217;t know of any supervision solution easier to deploy. And to incorporate to your orchestration infrastructure.<\/p>\n<p>Finally, debugging probes is conceptually easy: all you need is telnet.<\/p>\n<p><code>muninone:~# telnet 10.42.242.98 4949<br \/>\nTrying 10.42.242.98...<br \/>\nConnected to 10.42.242.98.<br \/>\nEscape character is '^]'.<br \/>\n# munin node at cronos.adm.intra.unetresgrossebite.com<br \/>\nlist<br \/>\ncpu df load memory ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off open_files processes users vmstat<br \/>\nfetch cpu<br \/>\nuser.value 3337308<br \/>\nnice.value 39168<br \/>\nsystem.value 13389003<br \/>\ninterrupt.value 6679408<br \/>\nidle.value 701005749<br \/>\n.<br \/>\nquit<br \/>\nConnection closed by foreign host.<br \/>\nmuninone:~#<\/code><\/p>\n<p><a href=\"https:\/\/gitlab.unetresgrossebite.com\/DevOps\/puppet\/tree\/master\/modules\/muninnode\/files\/custom_plugins\">Here is a bunch of plugins I use<\/a>, that you won&#8217;t find in default installations. Most of them being copied from public repositories such as github.<\/p>\n<p>Let&#8217;s introduce the few probes I wrote, starting with <i>pool_<\/i>. You may use it to wrap any munin probe. Its main advantage being it consists on a single cat, it answers quickly, and prevent you from generating discontinuous graphics.<br \/>\nI used it in conjunction with the <i>esx_<\/i> probe (found somewhere \/ patched, mostly not mine), which may take several seconds to complete. When a probe takes time to answer, munin times out, discarding data. Using a crontab pooling and keeping your metrics to temporary files independently from munin traditional metrics retrieval process, and using the <i>pool_<\/i> probe to present these temporary file is a way to deal with these probes, requiring unusual processing time.<\/p>\n<p>Less relevant, the <i>freebox_<\/i> probe, for Freebox V5 (inspired by a similar probe, dealing with Freebox V6):<\/p>\n<p><code># munin node at cronos.adm.intra.unetresgrossebite.com<br \/>\nfetch freebox_atm<br \/>\natm_down.value 6261<br \/>\natm_up.value 1025<br \/>\n.<br \/>\nfetch freebox_attenuation<br \/>\nattenuation_down.value 44.00<br \/>\nattenuation_up.value 24.80<br \/>\n.<br \/>\nfetch freebox_snr<br \/>\nsnr_down.value 6.40<br \/>\nsnr_up.value 7.20<br \/>\n.<br \/>\nfetch freebox_status<br \/>\nstatus.value 1<br \/>\n.<br \/>\nfetch freebox_uptime<br \/>\nuptime.value 131.73<br \/>\n.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Munin is a popular supervision solution mostly based on perl. As of most supervision and monitoring solution, munin relies on an agent you would install on hosts to track metrics from, and a server gathering metrics and serving them via CGI, generating graphics from collected data. As of most supervision and monitoring solutions, munin uses [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/90"}],"collection":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=90"}],"version-history":[{"count":5,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=\/wp\/v2\/posts\/90\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unetresgrossebite.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}