{"id":1324,"date":"2020-10-12T15:15:55","date_gmt":"2020-10-12T02:15:55","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=1324"},"modified":"2020-10-13T13:38:58","modified_gmt":"2020-10-13T00:38:58","slug":"configuring-nagios-4-to-tinkerboard","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=1324","title":{"rendered":"Configuring Nagios 4 to Tinkerboard"},"content":{"rendered":"<h1>Installing Nagios<\/h1>\n<ol>\n<li>Update the system:\n<pre style=\"white-space: pre;\">sudo apt-get update &amp;&amp; sudo apt-get upgrade<\/pre>\n<\/li>\n<li>Install the dependencies:\n<pre style=\"white-space: pre;\">sudo apt-get install autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php libgd-dev libsasl2-modules mailutils -y<\/pre>\n<\/li>\n<li>Change the directory to your home directory:\n<pre style=\"white-space: pre;\">cd ~<\/pre>\n<\/li>\n<li>Download the <strong>nagios 4<\/strong> source codes:\n<pre style=\"white-space: pre;\">wget https:\/\/assets.nagios.com\/downloads\/nagioscore\/releases\/nagios-4.4.6.tar.gz<\/pre>\n<\/li>\n<li>Extract the downloaded source codes:\n<pre style=\"white-space: pre;\">tar xzf nagios-4.4.6.tar.gz<\/pre>\n<\/li>\n<li>Change to the directory of the newly extracted source codes:\n<pre style=\"white-space: pre;\">cd nagios-4.4.6<\/pre>\n<\/li>\n<li>Run the <strong>configure script<\/strong> with integration to <strong>apache2<\/strong>:\n<pre style=\"white-space: pre;\">.\/configure --with-httpd-conf=\/etc\/apache2\/sites-enabled<\/pre>\n<\/li>\n<li>Compile the source:\n<pre style=\"white-space: pre;\">sudo make all<\/pre>\n<\/li>\n<li>Install the nagios user and group:\n<pre style=\"white-space: pre;\">sudo make install-groups-users<\/pre>\n<\/li>\n<li>Make <strong>nagios user<\/strong> a member of the <strong>www-data group<\/strong>:\n<pre style=\"white-space: pre;\">sudo usermod -aG nagios www-data<\/pre>\n<\/li>\n<li>Install nagios.\n<pre style=\"white-space: pre;\">sudo make install<\/pre>\n<\/li>\n<li>Install the init script:\n<pre style=\"white-space: pre;\">sudo make install-init<\/pre>\n<\/li>\n<li>Initialize the init script:\n<pre style=\"white-space: pre;\">sudo make install-daemoninit<\/pre>\n<\/li>\n<li>Install and configures permissions on the directory for holding the external command:\n<pre style=\"white-space: pre;\">sudo make install-commandmode<\/pre>\n<\/li>\n<li>Install the <strong>sample config files<\/strong> on the <strong>\/usr\/local\/nagios\/etc<\/strong> directory:\n<pre style=\"white-space: pre;\">sudo make install-config<\/pre>\n<\/li>\n<li>Install the nagios config file to apache2:\n<pre style=\"white-space: pre;\">sudo make install-webconf<\/pre>\n<\/li>\n<li>Update the <strong>SUID<\/strong> of the <strong>ping command<\/strong>:\n<pre style=\"white-space: pre;\">sudo chmod 4755 \/bin\/ping<\/pre>\n<\/li>\n<\/ol>\n<h1>Installing the Nagios Plugins<\/h1>\n<ol>\n<li>Run the following command:\n<pre style=\"white-space: pre;\">sudo apt install nagios-plugins<\/pre>\n<\/li>\n<li>Update the <strong>$USER1$ property<\/strong> in the <strong>\/usr\/local\/nagios\/etc\/resource.cfg file<\/strong> to have <strong>\/usr\/lib\/nagios\/plugins<\/strong> like as follows:\n<pre style=\"white-space: pre;\">$USER1$=\/usr\/lib\/nagios\/plugins<\/pre>\n<\/li>\n<\/ol>\n<h1>Configuring Apache2 Web Server<\/h1>\n<ol>\n<li>Enable the <strong>rewrite module<\/strong>:\n<pre style=\"white-space: pre;\">sudo a2enmod rewrite<\/pre>\n<\/li>\n<li>Enable the <strong>CGI module<\/strong>:\n<pre style=\"white-space: pre;\">sudo a2enmod cgi<\/pre>\n<\/li>\n<li>Create <strong>nagiosadmin<\/strong> as a <strong>nagios web user<\/strong>:\n<pre style=\"white-space: pre;\">sudo htpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin<\/pre>\n<blockquote><p>Assign a strong password<\/p><\/blockquote>\n<\/li>\n<li>Restart the apache2 service:\n<pre style=\"white-space: pre;\">sudo systemctl restart apache2<\/pre>\n<\/li>\n<\/ol>\n<p><em><strong>Related Post<\/strong><\/em><br \/>\n<em><a href=\"https:\/\/www.ronella.xyz\/?p=1330\" target=\"_blank\" rel=\"noopener noreferrer\">Configuring NRPE 4 Daemon and Plugin to Ubuntu 20.04<\/a><\/em><br \/>\n<em><a href=\"https:\/\/www.ronella.xyz\/?p=1326\" target=\"_blank\" rel=\"noopener noreferrer\">Compiling NRPE 4 Plugin to Tinkerboard<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Nagios Update the system: sudo apt-get update &amp;&amp; sudo apt-get upgrade Install the dependencies: sudo apt-get install autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php libgd-dev libsasl2-modules mailutils -y Change the directory to your home directory: cd ~ Download the nagios 4 source codes: wget https:\/\/assets.nagios.com\/downloads\/nagioscore\/releases\/nagios-4.4.6.tar.gz Extract the downloaded source codes: tar xzf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[55,65,13,59,24,28],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1324"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1324"}],"version-history":[{"count":5,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1324\/revisions"}],"predecessor-version":[{"id":1337,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1324\/revisions\/1337"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}