Open 130s opened 4 years ago
Following https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickstart.html for server side installation.
$ sudo a2enmod cgisudo ufw allow Apache
ERROR: Module cgisudo does not exist!
ERROR: Module ufw does not exist!
ERROR: Module allow does not exist!
ERROR: Module Apache does not exist!
Today looking at the same page https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html#Ubuntu again, I can't find an instruction that requires $ sudo a2enmod cgisudo ufw allow Apache
.
Just to make sure wsgi is installed, which it hasn't been.
$ sudo apt-get install libapache2-mod-wsgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libapache2-mod-wsgi
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 77.5 kB of archives.
After this operation, 248 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapache2-mod-wsgi amd64 4.3.0-1.1ubuntu1 [77.5 kB]
Fetched 77.5 kB in 0s (382 kB/s)
Selecting previously unselected package libapache2-mod-wsgi.
(Reading database ... 653349 files and directories currently installed.)
Preparing to unpack .../libapache2-mod-wsgi_4.3.0-1.1ubuntu1_amd64.deb ...
Unpacking libapache2-mod-wsgi (4.3.0-1.1ubuntu1) ...
Setting up libapache2-mod-wsgi (4.3.0-1.1ubuntu1) ...
apache2_invoke: Enable module wsgi
$ sudo a2enmod cgisudo ufw allow Apache
ERROR: Module cgisudo does not exist!
ERROR: Module ufw does not exist!
ERROR: Module allow does not exist!
ERROR: Module Apache does not exist!
Moving on, it looks to me all passed.
$ sudo a2enmod rewrite
Module rewrite already enabled
$ sudo a2enmod cgi
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Module cgi already enabled
$ sudo ufw allow Apache
Skipping adding existing rule
Skipping adding existing rule (v6)
$ sudo ufw reload
Firewall not enabled (skipping reload)
$ sudo systemctl restart apache2.service
$ a2enmod cgi
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Module cgi already enabled
iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT
apt-get install -y iptables-persistent
Asking this, type in y.
Current iptables rules can be saved to the configuration file /etc/iptables/rules.v4. These rules will then be loaded automatically during system startup.
Rules are only saved automatically during package installation. See the manual page of iptables-save(8) for instructions on keeping the rules file up-to-date.
Save current IPv4 rules?
http://localhost/nagios works from a web browser.
Nagios plugins installation
sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
So I think installation of nagios core and plugins are done. But on web i/f I get the following on almost all links there.
Error: Could not read object configuration data!
$ sudo dpkg -l selinux*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============================================-============================-============================-==================================================================================================
un selinux-policy-default <none> <none> (no description available)
$ service nagios status
● nagios.service - Nagios Core 4.4.5
Loaded: loaded (/lib/systemd/system/nagios.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: https://www.nagios.org/documentation
$ ps -aef | grep nagios.cfg
n130s 7494 18234 0 07:31 pts/13 00:00:00 grep --color=auto nagios.cfg
$ grep nag /etc/group
nagios:x:135:
$ grep -i www /etc/group
www-data:x:33:
$ ls -la /usr/local/nagios/sbin
total 5296
drwxrwxr-x 2 nagios nagios 4096 Aug 31 00:01 .
drwxr-xr-x 8 root root 4096 Aug 31 00:03 ..
-rwxrwxr-x 1 nagios nagios 328856 Aug 31 00:01 archivejson.cgi
-rwxrwxr-x 1 nagios nagios 318336 Aug 31 00:01 avail.cgi
-rwxrwxr-x 1 nagios nagios 305752 Aug 31 00:01 cmd.cgi
-rwxrwxr-x 1 nagios nagios 277296 Aug 31 00:01 config.cgi
-rwxrwxr-x 1 nagios nagios 326496 Aug 31 00:01 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 273392 Aug 31 00:01 histogram.cgi
-rwxrwxr-x 1 nagios nagios 252776 Aug 31 00:01 history.cgi
-rwxrwxr-x 1 nagios nagios 248664 Aug 31 00:01 notifications.cgi
-rwxrwxr-x 1 nagios nagios 326552 Aug 31 00:01 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 244528 Aug 31 00:01 outages.cgi
-rwxrwxr-x 1 nagios nagios 244544 Aug 31 00:01 showlog.cgi
-rwxrwxr-x 1 nagios nagios 326520 Aug 31 00:01 status.cgi
-rwxrwxr-x 1 nagios nagios 324696 Aug 31 00:01 statusjson.cgi
-rwxrwxr-x 1 nagios nagios 269360 Aug 31 00:01 statusmap.cgi
-rwxrwxr-x 1 nagios nagios 265088 Aug 31 00:01 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 248672 Aug 31 00:01 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 269192 Aug 31 00:01 summary.cgi
-rwxrwxr-x 1 nagios nagios 261008 Aug 31 00:01 tac.cgi
-rwxrwxr-x 1 nagios nagios 277496 Aug 31 00:01 trends.cgi
$ ls -la /usr/local/nagios/var
total 20
drwxrwxr-x 5 nagios nagios 4096 Aug 31 00:03 .
drwxr-xr-x 8 root root 4096 Aug 31 00:03 ..
drwxrwxr-x 2 nagios nagios 4096 Aug 31 00:01 archives
drwxrwsr-x 2 nagios nagios 4096 Aug 31 00:03 rw
drwxr-xr-x 3 root root 4096 Aug 31 00:01 spool
Ok nagios was not running.
$ sudo systemctl start nagios.service
$ ps -aef | grep nagios.cfg
nagios 7705 1 0 07:35 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 7725 7705 0 07:36 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
n130s 7732 18234 0 07:36 pts/13 00:00:00 grep --color=auto nagios.cfg
Since I only have 1 host where nagios-core runs, what I see is limited. I'll have to install it on other hosts to see its capability better.
BTW, found many packages regarding nagios
are available from apt
but they are so old compared to the latest release (somewhere in 4.4 at the time of writing), e.g. on bionic version series seems to still be in 3.
For home automation sector this is also interesting https://www.home-assistant.io/integrations/snmp/ particularly worth looking as a HASS user.
Blindly start using
nagios
.Requirement (to be updated):