{"id":694,"date":"2011-02-13T17:55:50","date_gmt":"2011-02-13T23:55:50","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=694"},"modified":"2011-02-12T18:13:02","modified_gmt":"2011-02-13T00:13:02","slug":"writing-a-munin-plugin","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/694","title":{"rendered":"Writing a munin plugin"},"content":{"rendered":"<p>Recently, we&#8217;ve run into some stability issues with our main web application.\u00a0 It&#8217;s a small company, so even though I&#8217;m definitely not the ops guy, everyone is pitching in with ideas and suggestions.\u00a0 One thing that the ops guy did install that has been super useful is <a href=\"http:\/\/munin-monitoring.org\/\">munin<\/a>.\u00a0 This graphing software lets you monitor, over time, many different aspects of your web application and\/or servers.\u00a0 It has been invaluable in letting us know what the effects of the various changes we&#8217;ve made have been.<\/p>\n<p>Questions that munin helps you answer can pretty impressive.\u00a0 For example, does doubling the amount of memory available to your webapp container help stability?\u00a0 How can you know unless you&#8217;re measuring stability?\u00a0 What happens if you prohibit certain bots from visiting your website?\u00a0 When during the day or week is your server running hottest?<\/p>\n<p>We have a watchdog that monitors our main application server, and if it is not responsive, restarts it.\u00a0 The watchdog also records when the restart occurred.\u00a0 I decided, as a fun project, to write a plugin for munin that would graph the number of restarts per day, as a high level &#8216;are we more stable yet&#8217; graph.<\/p>\n<p>Writing a plugin was trivial&#8211;it&#8217;s a shell script that follows certain output formatting. All I really needed was this <a href=\"http:\/\/munin-monitoring.org\/wiki\/HowToWritePlugins\">HOWTO<\/a> and this <a href=\"http:\/\/munin-monitoring.org\/wiki\/fieldname.type\">explanation of the types of data sources<\/a>, though <a href=\"http:\/\/munin-monitoring.org\/wiki\/faq\">the FAQ<\/a> is, as per usual, worth a scan.<\/p>\n<p>Munin is by no means perfect (my dream feature would be the ability to annotate graphs at a certain moment in time; &#8216;this is when we released version 2.1&#8217;), but it is a huge hammer in the IT toolbox for understanding current and historic behavior of your application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently, we&#8217;ve run into some stability issues with our main web application.\u00a0 It&#8217;s a small company, so even though I&#8217;m definitely not the ops guy, everyone is pitching in with [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,20],"tags":[],"class_list":["post-694","post","type-post","status-publish","format-standard","hentry","category-useful-tools","category-web-applications"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=694"}],"version-history":[{"count":2,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/694\/revisions"}],"predecessor-version":[{"id":696,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/694\/revisions\/696"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}