{"id":1047,"date":"2020-05-17T23:44:04","date_gmt":"2020-05-17T21:44:04","guid":{"rendered":"http:\/\/www.mythryll.com\/?p=1047"},"modified":"2020-05-21T17:11:26","modified_gmt":"2020-05-21T15:11:26","slug":"ansible-plugins-for-nagios-installation-on-ubuntu-18-04-4-lts-20-04-lts","status":"publish","type":"post","link":"https:\/\/www.mythryll.com\/?p=1047","title":{"rendered":"Ansible playbooks for Nagios Installation on Ubuntu 18.04.4 LTS \/ 20.04 LTS"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJsAAAAlCAQAAAD\/qFMCAAAIvUlEQVRo3t2aa3RVxRXHTyC8FoiKYkjC+yFBWApCUXlprQ8CAi0ipBKhtqSNIDQJVAKC1WQVBEu6eJRFKZFACa0RKFgFeVkErECpIDEJYAAp5Q0TwgWSEsOvH+7lZPacc26Ci5Wb1Zlvs2fv2ec\/M\/s1x+Io6mYvVCvUDoVnL1aXlE+VB5lRHf2yylTz1WKVqY6GSoejFr5yZvAyCfSlERZhrMStlTGJSJoRSXcWc4PQtRFYgf4Y10Ojgs9C7bXV8PfurjO\/FnOWhAy0o9SxtWjAsdAooSzURwZs4ex0mfm+mNOZkhDBVqBpEUFxNa\/+3wrYNhqwWXRgC+UGw3IxowH\/CRFsN0ijKRYWtUit1pU\/5y2mk8YeP2zbqeUAzuLnBtMSQa1PYQit2zm28SF7q3XNXSQznfnMJYW9ykLl0sAFNotMwTZf0Gq7XuT\/31bOWxTSjz\/zFHmkuV9Sf7+TQxrjIoO6NsgSeiutktf1cZEivg0xOFcpRnGec1zAJyjXeJtSutGHNCBdWah1HrBZPKNBIC9pXb5yWfYb5jGaB+jKGCaQxFj60YaHeZ2vPVU9y2z60IJIoniIqfbMY0xjHBPIRhkcXzGFZJLJ4BsPmSXsYCd72M1aUvgjR7jC1aDbd4E36Ucrookiggia0YK+TGG3f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ezspoIW6qy+C790G1YfQN3VrLK4MBbUo2Dbb\/vZYYylBeJpz\/RRAR6JF2IZwyJJPILxjCaOPoRRSTN6Mi7t+l\/yv0M1NKb9sQzm98wgkgsWrC4pv5J47P0f3dRPlWklFKqSBWrMpe\/Vq8qnypWJbf1T9h89ReVpVaqT9VVe+yc2qBOhfgf4WD\/7v4PidvDefBu02AAAAAASUVORK5CYII=\" alt=\"\" width=\"222\" height=\"53\"\/><\/figure><\/div>\n\n\n\n<p>Hello all, this is <a href=\"https:\/\/twitter.com\/mythryll\">@mythryll<\/a> , I hope everyone is staying safe! This is going to be a long one, so strap in and enjoy the ride (hopefully)!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A little back story<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft\"><img decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAAC6CAMAAACUcy+jAAAAbFBMVEUaGRj\/\/\/8AAAD6+voYFxb39\/cSERDo6OjS0tLx8fHj4+Pu7u7AwMCMjIwUExFOTU19fHwMCggtLSvZ2dl0dHPMzMyzs7OCgoLGxsZpaWhgYF+goKC6urpbW1uampqmpqYkIyI0NDNGRkVAPz4N+LZ2AAANJklEQVR4nO2d3ZqqvA6AIZTyo4AFRVERkPu\/x10QbQsFaXT89sHK0XrWjPjSpmmSphnL\/kgc18v8Q36J9ueyTJLyXOxu+faQhYHrfPRgC\/9RN9tWx+Jew0NYL49\/1+15f7v63n\/AlR\/PbR0zYJRYE4kpA2qlyf62+R2XE\/hV0o1KrCGShJB+9HYHz\/0FV3YpGoBFImXogCXHrfGwmXJdzw3lU2QihLE6uRmOmQmXE964ksdGUE80gOJkgmbA5Ud3w5FS0KDe53\/AtTmmjKGpOokZKQ9f5vIi3ASOxwzK0zp7u4rLzZMvUPUCaRR+iytM6GczKEvM0uorXN7NwFqtIoPS\/5zLP3+wCGcEmrdD9obLqVJY3m1QQmH\/Zk9f5vL239L3sUBzwnP55V8M1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nrVyjufsNQdVXSU898DrtO6SGNHAVQEb943lXKI75BVSiSsASKqTn3Uu9E7OGSUK1xasy3a7vea3BixpWPVcXglNtM3C\/u+UZNbzRevRVct+vF73SVSuq3Q1R1GVMdezbc22kZte6bmuMZEIHlw+3HNI1DJFztVYMCiCypWD\/lBnlivgJOLpeq4K7hLAg2vPX6cdtT3jXLsLsKuGKwPQ57gXuKSbnHNcrbQ6eq6wrQ\/2bXQ82XEFxTAyKpfddTzSjdgcV9bKVxP1XIc6ln7HeqAWgZ01saL5HVe3TvtreSOuYEchLrzJwydchw0X79Ao76zncm4QH71enAfXpuzext2pDdk6Lsc+pP2Ujbhs59r9hZijP3r8ZD3WKRcGqj7O2AmuTYNUD64D7Wc\/h1I2fw8uPr1d86wxF1\/WeQOTPy4x5iKv0iz5PtYMV\/dAhevMjQQ3985duZ86cHWXUEMNF5fqzkdCSS5P5tHncTiXUyJ3r9Zz5cAKv\/\/toW57Ayw\/dxaJa7603T25vARKd6vjsoOqVcHm9N72GuknWq6gVG4TW10lZul6e0irDYBslQcu+8TgoufqT0PkyZ\/l4itYXE\/UcnlMeUOrW3Kdnb0BFHvpiqfg4iMMBdNz2bnSyfgTLjqqS8uHGtC8hVq+TiW4bL5TUplLeugN7mvGK2hN51F8vW+B3LRE4uJDqnBdo2fGu2qUr5hwDR\/ydkz4Jh2XNC9PuQA5Pr\/D21g+gacP4pyp1PVP4rLDRtYvtzc03PniWg+JbFvGXPRVxlmr9l7Ia\/LciAKQpCjbmltG6wailUQQyStS4rKVXd3xo\/NgaxLVgKlcYfr422WMtHtl770QRgeRlN3Jn0+t7zcr82WL50tfEx5C\/Q+6PwkW+qfr9XQYpZoz9ddCf5Bw5G5n\/kvk4Q6yQ\/\/UzHP\/B6riy+\/QGZVsAAAAAElFTkSuQmCC\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>A few years back I had started a <a href=\"https:\/\/twitter.com\/mythryll\/status\/1024075110234435584?s=20\">conversation<\/a> with the great <a href=\"https:\/\/twitter.com\/dnsmichi\">Michael  Friedrich<\/a> who was at the time working at Icinga (I think), about how that product seemed better organized and structured than Nagios and that it lacked generally available guides on how to reach a practical real-world installation that could get more people involved and help the community grow. Michael complained (rightfully) that they were very deeply involved with developing the product and didn&#8217;t have time for guides (of course that&#8217;s not a job for the developers, I would say it&#8217;s the marketing&#8217;s job to push for the product to become accepted), so he challenged me to produce any automation stuff I could about Nagios first. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMcAAABICAMAAAB1PRH5AAAAZlBMVEX\/\/\/8AAAD7+\/tQUFBeXl5JSUmIiIhxcXGmpqYiIiJ4eHiFhYVTU1MvLy\/w8PBubm6enp7p6enKysrBwcHj4+Pc3NzT09OOjo6WlpY2Nja0tLRYWFg+Pj5lZWUnJye7u7sREREZGRlRcSxHAAAGHUlEQVRoge1abZuyKhBO0jItS9TSUqv\/\/yeflAEGGHtZd7POde5Pq7A4N8w7zWb\/48vA\/batw2RqMcYi9nq0+dSCjMPOA1zY1KKMQeIpHKaWZQxCzWPzzQcSax7eN\/NY\/Ed4nDWN+dSyjMJV8ThOLcoocEnDn1qSkcg2PY1oajlGY7eIm3I\/tRTjUU8twO9gF04twUvYhwP+yHuvHCNR3ky5onLz8KuOIx\/0SZu3yzIGImwH7sBx935hRmA\/EOpYMJRUpXn6tyL9DH5\/HrjmYx2D80DRUXTzmw9kwsr5tigqLp6SMDpVQVMWDV2WF1AifiCRHqzuvBPTRcemIOfNYXj7XvFeQNSArUiUxKRCDrafeiA3B1V7JggL0Uw\/t4mSeDbOzhzFY\/O5Xa2Tw8MzhE354rSUZxZPJeVD7F0aWrNuHLb+gqeztBJx83OPIyJ4tJ24CY+b+YGDYafL62UVfy4N1hI8vP1Nl6oyM8Rmn2viM8rKe3Mu+Zf1fHKSx5Ope8rPZ04HTgsF5\/zOeXbDT60zCJoHlfPm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WJ4KPj6oTCdexzP+7BPOD7qACBN4fXeEC0Ru0DqE76zBWcruFNoXWiVLFYKRrX524DjD4D\/KsqHKFRJnb2eR6yZPWlWAz2uzc9yHRN8UpLhQrZSBu4Zr7PQ\/Y15uIjKoKxF3nIXxDWot3KpVDdIzhdq6YD+znpN\/0tbfX0T3vMPpw6zSAuI9mVAm\/5Ag99NdlGZaR0pD+O2Np5AByhsfuv3NSYPKg7RSnvKzzIZv+1sxdo0TkxAb78499OmjyofqfsFyAe8SMe5Ib0fhBUztUXYentT3nAgaqOhEOkkgYpjKcvE4QXNQO\/sAGlLtxeB9y5MISLWxwJY\/z5LygLa93MTAr0L4HSlZKGXbs\/TU+SWeqyNy9SArlOv2\/U3c3V2IcfEPHrLe5IJKVOUANczqfL2gfZk23g2xUZPwUR3mYW6gZurWMiOwQB6YXSZTAfQYNAkkXVpt0Eh5E\/9WU8rm\/r1Isp74h\/69Nfds39e\/gHqeRJN0coarEAAAAASUVORK5CYII=\" alt=\"\" width=\"244\" height=\"88\"\/><figcaption><a href=\"https:\/\/icinga.com\/\">https:\/\/icinga.com\/<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>As it happens, I didn&#8217;t have time for that either, but I did manage to produce an Ansible playbook for upgrading Nagios and posted it <a href=\"http:\/\/www.mythryll.com\/?p=857\">here<\/a> . That became the first in a series of posts about Automation and the reason to clean up my act in my blog here, so it can be a little more presentable and perhaps even helpful to others. <\/p>\n\n\n\n<p>As it happens, I was very much involved with projects and learning about network automation that I didn&#8217;t find the time to create an Ansible playbook for a clean Nagios Installation, as the necessary immersion in the Nagios development context seemed like a luxury. <\/p>\n\n\n\n<p>I am now at the point where I am working on an important project, combining tools from different worlds, so I need a way to reproduce a Nagios installation quickly, in a standard and documented way and without the risk of human error. So naturally I dug up my Ansible war axe and starting hacking at the problem..<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So what did you find?<\/h2>\n\n\n\n<p>I have found an older playbook about some of this <a href=\"https:\/\/github.com\/sahil-sharma\/Nagios-Playbook\">here<\/a> by Sahil -Sharma. I did change a lot of things and adapted some others. Anyway it was very useful as an example but it only depicts the installation process mentioned in the docs, as does mine of course, so nothing too fancy here. Feel free to use that with the Nagios versions that referenced however, as a lot of things no longer work that way (you will get failures with the current versions). Sahil&#8217;s work includes a role where a main.yml file invokes all the other ones. I assume you can follow the same path and do one for yourself. I didn&#8217;t really want to go that far. I am not claiming to be an Ansible expert (far from it) and some of the plugins do not satisfy a major Ansible advantage: itempotency. So be careful and use snapshots if using VMs for your infrastructure.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAACXCAMAAAAvQTlLAAAAb1BMVEX\/\/\/\/wUDPwTjDwSyz4t67wSCfvPxfwW0H95uPwRiT97uzxXUTycFz6ysPyaVP71tH+9vXxVzzyZU75w7vxYUn83trvQh33qp\/70sz2npHwVDfzd2T2pZrzfWv4sqjzgXD1kIHvOgz0iHjuMQD1l4mm7AD8AAAGiUlEQVR4nO2cXXuqOhBGTWJUUBRFEbVqtef\/\/8ZD0FI+JpMhCeDFfp9908eCi8UQwoTdycRL4s1px9j5clv42Z+nLO4y4IwxkW6\/xmapJJpJ9g6f7cKxcX6TccH+Ilfx2ECvRCln1cjlRxiLeB1LGfsAsKatDzHWtvURxiBbBdh8VLCIwVgjG8tSocEatcb0tkY1FgV6WwXYfhSw6IxjjWTMZGukGouYGYuxYGhjIXIljmpsqhlQW2BDG0sCItjgxohgg9dYIv8Z6xa6sd6n1tG0+tOUCBasezaWpbOk+jP9quzVWCI4l5bGenzi3ajBlKd1Y+PXWG5LfQMP6saoV2VfxrLfGQQPasaop1LuezGW\/D35NGtsTGOZrMwgbI357128a+vTjEWiMd9qXJVTKWWg\/hmmZZ6NRbz1fQ1jyeVrmiS30+qv5aQx5hEsgjQ0aux9rcXRCp8xSn9ggC3AWJkbXmzejGmwWjVWJs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c41JeStnWfGT2H+uYLVHeS\/G5LXe5OtYCq17oidj6b3xTH0wvw5SxQqIWB2NAY+uxrdgqli6Ud7RGD8D+6UuV5Fr6zfxmmosBdced8Qz2clWJ2MPcPFkSjssITWv0Tgbk09wa9roKqAaMGVBMhZolpBXBC4LWyokY7r3rJ7mba1sqSz2BGPW71kJYWVLhWDM+j0ra1sqi53JmOadX2NbTehE0xKajAX\/wdsZ3rNysqViMsbP4GaRAcvNlorJ2AMsMLzv5mzrBYY3q6A\/n3B44Fid7ol6MPTggTf5whVW9Z6wTMb4rDW0omfRG5bJGBf1sSJ8Yi1uj1hmY9+VrnOE\/q5XrBwMbw5L9r0J4zxhskL\/S4xgHq7Eahb4VcmD2fJyva4Yvvgrzs7jVjMGY6rM8piGU8+2VAzGCOnBlkps34Z6YYkebKm4GevJlorLAoSQPdlSsTfWoy0VW2O92lKxMya2vdpSsTHWuy2VcNXVGLmR5AjWtb8VDGCrAOtkbCBbBVgHYx0bSY5g5MYdqaXrEYxojNAA9wxGqrGBbRVgBGOD2yrAjDU2gq0CzDAfG8VWAYbW2IDjVjMxchPvbXZKArvqwEa0VYBpjA0yg0DBQGMj2yrAAGOD3hO1YC1jH2BLJV7X+zcdFu76TVx7n6vzUlR\/ideP38YEDz6htsoc56l6JUik7PtD\/lrtO4vpfc62l6Ovc\/g\/iRtmqR\/IOnwAAAAASUVORK5CYII=\" alt=\"\" width=\"142\" height=\"142\"\/><figcaption><a href=\"https:\/\/github.com\">https:\/\/github.com<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>I have tested the playbooks I will include below both with Ubuntu 18.04.4 LTS and Ubuntu 20.04 LTS. My initial target was to go with 20.04 all the way so that I can maintain the new car smell as much as possible.. Perl and Python and almost Ansible too foiled my plans at a few points. Here is what the installation includes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/support.nagios.com\/kb\/article\/nagios-core-installing-nagios-core-from-source-96.html#Ubuntu\">Nagios Core 4.4.5<\/a> (Latest at this point) &#8211; Here is the github <a href=\"https:\/\/github.com\/NagiosEnterprises\/nagioscore\">link<\/a>.<\/li><li><a href=\"https:\/\/support.nagios.com\/kb\/article.php?id=569#Ubuntu\">Nagios Plugins 2.3.3<\/a> (Latest at this point) &#8211; Here is the github <a href=\"https:\/\/github.com\/nagios-plugins\/nagios-plugins\">link<\/a>.<\/li><li><a href=\"https:\/\/github.com\/NagiosEnterprises\/nrpe\">NRPE v.4.0.2<\/a> (Latest at this point). &#8211; The playbook here is only about the plugin (architecture is reversed with NRPE, the Nagios Server is the NRPE client). The <a href=\"https:\/\/support.nagios.com\/kb\/article.php?id=515#Ubuntu\">documentation<\/a> describes how to install v3 from source. The version 4 is only on <a href=\"https:\/\/github.com\/NagiosEnterprises\/nrpe\">github<\/a>. There are sad news there.. Also watch the openssl part, nobody includes it properly in instructions. Finally, the windows component for nagios can launch an NRPE server module, but you may need to either activate encryption properly or deactivate it entirely (that broke some checks for me on my production system that was using NRPE 3.2.1). I will try to reproduce the rest of the process in a playbook for the NRPE servers (the distributed probes) and will update here.<\/li><li><a href=\"https:\/\/www.claudiokuenzler.com\/monitoring-plugins\/check_esxi_hardware.php\">check_esxi_hardware.py<\/a> plugin that can check ESXi standalone hosts for problems (including hardware issues)<\/li><li><a href=\"http:\/\/folk.uio.no\/trondham\/software\/check_hp_bladechassis.html\">check_hp_blade_chassis<\/a> &#8211; to check status for our HP Blade chassis in our DCs, I have yet to find and include a similar one for the Cisco UCS platform, they are heavy on PowerShell and Ansible, I am sure something can be built. Will check with Devnet&#8217;s John McDonough for that.<\/li><li><a href=\"https:\/\/www.thomas-krenn.com\/en\/wiki\/IPMI_Sensor_Monitoring_Plugin_setup\">check_ipmi_sensor<\/a> &#8211; this is to check on impi alerts and sensors on platforms that support the IPMI specification. It uses the free-ipmi library and can work with a lot of hardware appliances. Here is the github <a href=\"https:\/\/github.com\/thomas-krenn\/check_ipmi_sensor_v3\">link<\/a>. <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">So what didn&#8217;t work?<\/h2>\n\n\n\n<p>Well a couple of things.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> <a href=\"https:\/\/github.com\/mhoogveld\/check_cisco_ip_sla\">check_cisco_ip_sla<\/a>  &#8211; This plugin will only work on the 18.04.4 LTS version. There seem to  be issues with the <a href=\"https:\/\/easysnmp.readthedocs.io\/en\/latest\/\">easysnmp<\/a> python library when the python compliler  used is 3.7+. The python 3 version on Ubuntu 18.04.4 LTS is today 3.6.9.  I have found a bug <a href=\"https:\/\/github.com\/kamakazikamikaze\/easysnmp\/issues\/108\">here<\/a>. So although I didn&#8217;t make an Ansible playbook, it&#8217;s pretty easy to make one for Ubuntu 18.04.4, if you follow along the other ones. Just make sure you install the prereqs with APT and use the command Ansible module to install the easysnmp python library instead of the pip Ansible module.<\/li><li><a href=\"https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\">check_vmware_api<\/a> &#8211; This plugin is based on the <a href=\"https:\/\/www.vmware.com\/support\/developer\/viperltoolkit\/index.html\">Perl SDK<\/a> from Vmware, since version 4, the vmware vcli is included in the installation. There are versions <a href=\"https:\/\/code.vmware.com\/web\/sdk\/6.7\/vsphere-perl\">6.7<\/a> and <a href=\"https:\/\/code.vmware.com\/web\/sdk\/7.0\/vsphere-perl\">7.0<\/a>  of this SDK right now on Vmware. My tests were successful when the plugin was doing single checks using the new SDK versions. When I loaded configs on the server it started to timeout. Apparently there is an issue with a random number generator or something like that (I guess that&#8217;s used to separate sessions?).  These two posts helped me understand and make up my mind to drop this:<ul><li><a href=\"https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\/issues\/15\">https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\/issues\/15<\/a><\/li><li><a href=\"https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\/issues\/17\">https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\/issues\/17<\/a><\/li><\/ul><\/li><li>So I decided to drop that and switch to <a href=\"https:\/\/github.com\/BaldMansMojo\/check_vmware_esx\/\">check_vmware_esx<\/a>. which works but I had to change my commands as a lot of things are defined differently, some things are still accessible but need different commands, others have disappeared entirely (runtime net, io) and others are available that were not available before (snapshots). The problem is this plugin can not be installed via Ansible Playbook, I mean the plugin sure, the SDK no. There is a need for an interaction with the Perl SDK installer which needs a  series of keys to be pressed\/typed (Enter, q and yes) to proceed  with the installation, even when the default options are requested for a  silent installation. If I find a way to make this work, I will update  the post and include that playbook as well (provided the SDK is downloaded before hand). A possible solution could come from using the <a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/modules\/expect_module.html\">expect<\/a>  Ansible module. One thing to keep in mind here, is that the plugin will  not work if the connections to the VCenter servers are going through a  proxy. So no proxy please \ud83d\ude42 <\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Any other disclaimers?<\/h2>\n\n\n\n<p>No configuration for Nagios is included in this post. The post is about installing Nagios automatically. The nagios configuration can take up a lot of posts and none of it will be about automation, unless you are configuring an event handler to launch a task after an alert. I could include a post about that, however after my research here and even if I have the goal to move to an Icinga docker based installation for our infrastructure, I have the feeling that this whole ecosystem of plugins has served the industry for more than 10 years but is now old and sick and needs to be replaced. Perhaps Prometheus can serve as a replacement, I don&#8217;t know enough yet, but will research that in time.<br \/>Something else also not included is the https implementation for the Nagios server, as well as using AD credentials to login to the gui. Although I have deployed those in our production environment, I feel I would not do that task automatically (it&#8217;s that a big deal, it&#8217;s about changing a few lines in some configs, transferring files over to the Nagios server and restarting services). I will only do this once per server and prefer to do it manually.<\/p>\n\n\n\n<p>Finally, be advised that the pip module for Ansible remains broken since after version 2.6. You can read about it <a href=\"https:\/\/github.com\/ansible\/ansible\/issues\/47361\">here<\/a>, I used the same approach replacing pip module with command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enough words. The code?<\/h2>\n\n\n\n<p>So here is the code for the playbooks. I used a variable to define the target host for each playbook. The host provided with the command to run the playbook must be included in your hosts file. Be careful when copying the code as wordpress replaces the sequences of &#8216;-&#8216; with longer dashes. Every playbook starts with 3 dashes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ansible-playbook nagios-core-install.yml --extra-vars \"target_host=srv-nagios-01\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Nagios Core Installation<\/h3>\n\n\n\n<p>We start with the playbook for installing Nagios Core v.4.4.5:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: get rid of old installation dir\n    file:\n      path: \/tmp\/nagios\n      state: absent\n    become: true\n  - name: get rid of semi-created installation dir\n    file:\n      path: \/tmp\/nagios-4.4.5\n      state: absent\n    become: true\n  - name: get rid of old installation archive\n    file:\n      path: \/tmp\/nagios.tar.gz\n      state: absent\n    become: true\n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install nagios reqs\n    apt:\n      name: \n        - autoconf\n        - gcc\n        - libc6\n        - make\n        - wget\n        - unzip\n        - libssl-dev\n        - apache2\n        - php\n        - libapache2-mod-php*\n        - libgd-dev\n        - build-essential\n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: download and uncompress\n    shell: cd \/tmp;rm nagios*.tar.gz;wget -O nagios.tar.gz --no-check-certificate https:\/\/assets.nagios.com\/downloads\/nagioscore\/releases\/nagios-4.4.5.tar.gz;tar -zxf nagios.tar.gz;mv nagios-4.4.5 nagios\n    become: true\n  - name: configure and make all\n    shell: cd \/tmp\/nagios;.\/configure --with-mail=\/usr\/sbin\/sendmail --with-httpd-conf=\/etc\/apache2\/sites-enabled;make all;\n    become: true\n  - name: create users and groups\n    command: chdir=\/tmp\/nagios make install-groups-users\n    become: true\n  - name: create nagios user homedir\n    file:\n      path: \/home\/nagios\n      state: directory\n      owner: nagios\n      group: nagios\n      mode: 0775\n    become: true\n  - name: change nagios user home dir and add group members\n    command: \"{{ item }}\"\n    with_items: \n      - usermod --home \/home\/nagios nagios\n      - usermod -a -G nagios www-data\n    become: true\n  - name: make binaries\n    command: chdir=\/tmp\/nagios {{ item }}\n    with_items:\n      - make install\n      - make install-daemoninit \n      - make install-commandmode\n      - make install-config\n      - make install-webconf\n    become: true\n  - name: Enable apache2 modules\n    apache2_module: state=present name={{ item }}\n    with_items:\n      - cgi\n      - rewrite\n  - name: Restart Apache2 service\n    service:\n      name: apache2\n      state: restarted\n    become: true\n  - name: Create nagiosadmin User account (apache user)\n    command: htpasswd -cb \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin nagios\n    become: true\n  - name: copy event handlers\n    synchronize:\n      src: \/tmp\/nagios\/contrib\/eventhandlers\/\n      dest: \/usr\/local\/nagios\/libexec\n      recursive: yes\n      mode: push\n    delegate_to: \"{{ target_host }}\" \n  - name: change ownership and permisions\n    file:\n      path: \/usr\/local\/nagios\/libexec\/eventhandlers\/\n      owner: nagios\n      group: nagios\n      mode: u+rw,g+rw,o+r\n      recurse: true\n    become: true\n  - name: Start Nagios service\n    service:\n      name: nagios\n      state: restarted\n    become: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Nagios Utilities Installation<\/h3>\n\n\n\n<p>The playbook that follows installs Nagios Utilities version 2.3.3:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: get rid of old installation dir\n    file:\n      path: \/tmp\/nagios-plugins\n      state: absent\n    become: true\n  - name: get rid of semi-created installation dir\n    file:\n      path: \/tmp\/nagios-plugins-release-2.3.3\n      state: absent\n    become: true\n  - name: get rid of old installation archive\n    file:\n      path: \/tmp\/nagios-plugins.tar.gz\n      state: absent\n    become: true\n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install nagios plugins reqs\n    apt:\n      name: \n        - autoconf\n        - gcc\n        - libc6\n        - libmcrypt-dev\n        - make\n        - wget\n        - bc\n        - gawk\n        - dc\n        - snmp\n        - libssl-dev\n        - libnet-snmp-perl\n        - gettext\n        - libldap2-dev\n        - dnsutils\n        - build-essential\n        - smbclient\n        - fping\n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: download and uncompress\n    shell: cd \/tmp;rm nagios-plugin*.tar.gz;wget -O nagios-plugins.tar.gz --no-check-certificate https:\/\/github.com\/nagios-plugins\/nagios-plugins\/archive\/release-2.3.3.tar.gz;tar -zxf nagios-plugins.tar.gz;mv nagios-plugins-release-2.3.3 nagios-plugins\n    become: true\n  - name: configure and make all\n    command: chdir=\/tmp\/nagios-plugins {{ item }} \n    with_items:\n      - .\/tools\/setup\n      - .\/configure\n      - make\n      - make install\n    become: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install check_nrpe plugin<\/h3>\n\n\n\n<p>Here is the playbook for installing the check_nrpe plugin for NRPE v.4.0.2. I remind you that this is only for installing the plugin. With NRPE the architecture is reversed. The Nagios Core server is the client which connects to the NRPE servers in the probes to execute Nagios Plugins remotely and get back the results to be consumed by Nagios Core (reported by the GUI, fed to the alerting engine, etc).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: get rid of old installation dir\n    file:\n      path: \/tmp\/nrpe*\n      state: absent\n    become: true\n  - name: get rid of semi-created installation dir\n    file:\n      path: \/tmp\/nrpe-npre-4.0.2\n      state: absent\n    become: true\n  - name: get rid of old installation archive\n    file:\n      path: \/tmp\/nrpe.tar.gz\n      state: absent\n    become: true\n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install nrpe reqs\n    apt:\n      name: \n        - autoconf\n        - gcc\n        - libc6\n        - libmcrypt-dev\n        - make\n        - wget\n        - libssl-dev\n        - openssl \n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: download and uncompress\n    shell: cd \/tmp;rm nrp*.tar.gz;wget -O nrpe.tar.gz --no-check-certificate https:\/\/github.com\/NagiosEnterprises\/nrpe\/archive\/nrpe-4.0.2.tar.gz;tar -zxf nrpe.tar.gz;mv nrpe-nrpe-4.0.2 nrpe\n    become: true\n  - name: configure and make check_nrpe plugin then move it to plugins dir\n    command: chdir=\/tmp\/nrpe {{ item }} \n    with_items:\n      - .\/configure --enable-command-args --with-ssl=\/usr\/bin\/openssl --with-ssl-lib=\/usr\/lib\/x86_64-linux-gnu\n      - make check_nrpe\n      - make install-plugin\n    become: true\n  - name: add services definition\n    command: \"{{ item }}\"\n    with_items:\n      - sh -c \"echo >> \/etc\/services\"\n      - sh -c \"sudo echo '# Nagios services' >> \/etc\/services\"\n      - sh -c \"sudo echo 'nrpe    5666\/tcp' >> \/etc\/services\"\n    become: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install check_esxi_hardware.py plugin<\/h3>\n\n\n\n<p>Here is the playbook to install the check_esxi_hardware.py plugin. It uses the pywbem python module. It works with both 2.x and 3.x versions of Python. It was necessary to switch to using the command Ansible module for installing pywbem, due to the Ansible issue described <a href=\"https:\/\/github.com\/ansible\/ansible\/issues\/47361\">here<\/a> .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install pywbem reqs\n    apt:\n      name: \n        - python3-pip\n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: install pywbem\n    command: \/usr\/bin\/pip3 install pywbem\n    become: true\n  - name: download and copy\n    shell: cd \/usr\/local\/nagios\/libexec;rm check_esxi_hardware.py;wget --no-check-certificate https:\/\/www.claudiokuenzler.com\/monitoring-plugins\/check_esxi_hardware.py\n    become: true\n  - name: replace python interpreter\n    lineinfile:\n      path: \/usr\/local\/nagios\/libexec\/check_esxi_hardware.py\n      regexp: '^#!\/usr\/bin\/python'\n      line: '#!\/usr\/bin\/python3'\n  - name: ensure persmissions and ownership\n    file:\n      path: \/usr\/local\/nagios\/libexec\/check_esxi_hardware.py\n      state: file\n      owner: nagios\n      group: nagios\n      mode: u=rwx,g=rx,o=rx\n    become: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install check_bladechassis plugin<\/h3>\n\n\n\n<p>Here is the playbook to install the check_hp_bladechassis nagios plugin. This one uses SNMP to querry the blade controller for status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: get rid of old installation dir\n    file:\n      path: \/tmp\/check_hp_bladechassi*\n      state: absent\n    become: true\n  - name: get rid of semi-created installation dir\n    file:\n      path: \/tmp\/check_hp_bladechassis-1.0.1\n      state: absent\n    become: true\n  - name: get rid of old installation archive\n    file:\n      path: \/tmp\/check_hp_bladechassis.tar.gz\n      state: absent\n    become: true\n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install check_hp_bladechassis reqs\n    apt:\n      name: \n        - libnet-snmp-perl\n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: download and uncompress\n    shell: cd \/tmp;rm check_hp_bladechassis*.tar.gz;wget -O check_hp_bladechassis.tar.gz http:\/\/folk.uio.no\/trondham\/software\/files\/check_hp_bladechassis-1.0.1.tar.gz;tar -zxf check_hp_bladechassis.tar.gz;mv \/tmp\/check_hp_bladechassis-1.0.1\/ \/tmp\/check_hp_bladechassis\/\n    become: true\n  - name: copy exec\n    copy:\n      src: \/tmp\/check_hp_bladechassis\/check_hp_bladechassis\n      dest: \/usr\/local\/nagios\/libexec\/check_hp_bladechassis\n      remote_src: true\n      owner: nagios\n      group: nagios\n      mode: u=rwx,g=rx,o=rx\n    become: true\n  - name: copy man\n    copy:\n      src: \/tmp\/check_hp_bladechassis\/check_hp_bladechassis.8\n      dest: \/usr\/share\/man\/man8\n      remote_src: true\n    become: true<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install check_ipmi plugin<\/h3>\n\n\n\n<p>This one is the Ansible playbook to install the check_ipmi_sensor plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- hosts: \"{{ target_host }}\"\n  tasks: \n  - name: get rid of old installation dir\n    file:\n      path: \/tmp\/check_ipmi_sensor\n      state: absent\n    become: true\n  - name: get rid of semi-created installation dir\n    file:\n      path: \/tmp\/check_ipmi_sensor_v3-3.13\n      state: absent\n    become: true\n  - name: get rid of old installation archive\n    file:\n      path: \/tmp\/check_ipmi_sensor.tar.gz\n      state: absent\n    become: true\n  - name: refresh apt\n    apt: \n      name: '*'\n      update_cache: yes\n    become: true \n  - name: install check_ipmi_sensor reqs\n    apt:\n      name: \n        - libipc-run-perl\n        - freeipmi\n      state: latest\n      force: true\n      update_cache: true\n    become: true\n  - name: download and uncompress\n    shell: cd \/tmp;rm check_ipmi_sensor*.tar.gz;wget -O check_ipmi_sensor.tar.gz https:\/\/github.com\/thomas-krenn\/check_ipmi_sensor_v3\/archive\/v3.13.tar.gz;tar -zxf check_ipmi_sensor.tar.gz;mv check_ipmi_sensor_v3-3.13 check_ipmi_sensor\n    become: true\n  - name: copy exec\n    copy:\n      src: \/tmp\/check_ipmi_sensor\/check_ipmi_sensor\n      dest: \/usr\/local\/nagios\/libexec\/check_ipmi_sensor\n      remote_src: true\n      owner: nagios\n      group: nagios\n      mode: u=rwx,g=rx,o=rx\n    become: true\n  - name: copy conf\n    copy:\n      src: \/etc\/freeipmi\/freeipmi.conf\n      dest: \/etc\/freeipmi\/dnsipmi.conf\n      remote_src: true\n      owner: nagios\n      group: nagios\n      mode: u=rwx,g=rx,o=rx\n    become: true\n  - name: add credentials to conf\n    blockinfile:\n      path: \/etc\/freeipmi\/dnsipmi.conf\n      insertafter: EOF\n      block: |\n        username noc\n        password 6Cb506a!\n        privilege-level user<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What about the rest? Come on..<\/h2>\n\n\n\n<p>Well&#8230; ok. I will tell you how to install the check_vmware_api plugin. First make sure you install the prerequisites. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install lib32z1 lib32ncurses6 build-essential uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libmodule-build-perl libmoosex-types-path-class-perl libuuid-tiny-perl libarchive-zip-perl libmonitoring-plugin-perl libio-socket-inet6-perl libnet-inet6glue-perl<\/code><\/pre>\n\n\n\n<p>Then also install one more prerequisites using cpan.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cpan install UUID<\/code><\/pre>\n\n\n\n<p>Now go get the Perl SDK v.7.0 (yes it works with lower versions of VCenter too). Use the address I gave you before. I am afraid you need a login, so you have to register with VMWare (another reason you can&#8217;t automate this). Get it in \/usr\/local\/src. Then uncompress it and run the install.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -zxvf VMware-vSphere-Perl-SDK-7.0.0-15889270.x86_64.tar.gz\nvmware-vsphere-cli-distrib\/vmware-install.pl<\/code><\/pre>\n\n\n\n<p>Download the plugin and copy it to \/usr\/local\/nagios\/libexec. Make sure the ownership and attributes are set correctly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget --no-check-certificate https:\/\/github.com\/ITRS-Group\/system-addons-plugins-op5-check_vmware_api\/archive\/v2019.j.1.tar.gz\ntar -zxvf v2019.j.1.tar.gz\ncd system-addons-plugins-op5-check_vmware_api-2019.j.1\/\ncp check_vmware_api.pl \/usr\/local\/nagios\/libexec\/\ncd  \/usr\/local\/nagios\/libexec\/\nchmod 755 check_vmware_api.pl\nchown nagios:nagios check_vmware_api.pl<\/code><\/pre>\n\n\n\n<p>You are set! Read the doc and try it out (don&#8217;t forget about the issue with the proxy server or you will never find out what&#8217;s wrong). A basic command should be for example like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/check_vmware_api.pl -D vcenterserver -u user@domain -p password -l runtime -s status<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Done! What&#8217;s next?<\/h2>\n\n\n\n<p>Well.. working on that took a while. Using these to install Nagios from scratch should get you a working system within the day. I won&#8217;t say something fancy like 30 minutes. It&#8217;s possible. But sometimes package installations take a while, especially with cpan, and you may run into other issues that have nothing to do with the playbooks. The Ansible version is 2.9 btw.<\/p>\n\n\n\n<p>For the next steps I am thinking about dockerizing the Nagios Server but I have a feeling it will not be practical. First of all it&#8217;s difficult to get around the interactive part. Then I have a feeling that the container will be huge.. I may give it a try soon. If I do and succeed then you will get a sequel to this post. <br \/>My own plans include migrating to the Icinga platform (will use my friend&#8217;s Gian Paolo suggestions on that) but since the plugins are shared more or less.. I may seek a way to replace the whole thing with something totally different. Siming Yuan of Cisco Pyats has suggested Prometheus, so I intend to take a look at that too.<\/p>\n\n\n\n<p>Enjoy, and if you got questions you know where to find me (@mythryll on Twitter)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello all, this is @mythryll , I hope everyone is staying safe! This is going to be a long one, so strap in and enjoy the ride (hopefully)! A little back story A few years back I had started a conversation with the great Michael Friedrich who was at the time working at Icinga (I&#8230;<\/p>\n","protected":false},"author":1,"featured_media":770,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,14,21,7],"tags":[40,31,35,41],"class_list":["post-1047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation","category-it","category-monitoring-tools","category-professional","tag-ansible","tag-automation","tag-monitoring","tag-nagios"],"_links":{"self":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/1047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1047"}],"version-history":[{"count":23,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/1047\/revisions"}],"predecessor-version":[{"id":1071,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/posts\/1047\/revisions\/1071"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=\/wp\/v2\/media\/770"}],"wp:attachment":[{"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mythryll.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}