Nagios 4
Contents
This section describes the installation of Nagios 4 Core from standard Debian packages
To understand available packages see: (or similar search)
# aptitude search '^nagios' p nagios-check-xmppng - monitoring plugin to check XMPP servers p nagios-images - Collection of images and icons for the nagios system p nagios-nrpe-plugin - Nagios Remote Plugin Executor Plugin p nagios-nrpe-server - Nagios Remote Plugin Executor Server p nagios-plugin-check-multi - run nagios checks as a group v nagios-plugins - v nagios-plugins-basic - p nagios-plugins-contrib - Plugins for nagios compatible monitoring systems p nagios-plugins-rabbitmq - Set of Nagios checks useful for monitoring a RabbitMQ server v nagios-plugins-standard - p nagios-snmp-plugins - SNMP Plugins for nagios p nagios4 - host/service/network monitoring and management system p nagios4-cgi - cgi files for nagios4 p nagios4-common - support files for nagios4 p nagios4-core - host/service/network monitoring and management system core files p nagios4-dbg - debugging symbols and debug stuff for nagios4
# root@buster:~# aptitude install nagios4
As there are dependencies to apache, exim, php and samba this will also install 130MB of dependencies. This make it difficult to install nagios with nginx.
apache2 apache2-bin apache2-data apache2-utils bsd-mailx dirmngr dnsutils exim4-base exim4-config exim4-daemon-light gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm javascript-common libapache2-mod-php libapache2-mod-php7.3 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libarchive13 libassuan0 libbrotli1 libcurl4 libdbi1 libevent-2.1-6 libgnutls-dane0 libgpgme11 libirs161 libjansson4 libjs-jquery libksba8 libldb1 liblockfile1 liblua5.2-0 libnet-snmp-perl libnpth0 libpq5 libpython2.7 libradcli4 libsmbclient libsodium23 libtalloc2 libtdb1 libtevent0 libtirpc-common libtirpc3 libunbound8 libwbclient0 monitoring-plugins monitoring-plugins-basic monitoring-plugins-common monitoring-plugins-standard nagios-images nagios4 nagios4-cgi nagios4-common nagios4-core php-common php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline pinentry-curses psmisc python-crypto python-gpg python-ldb python-samba python-talloc python-tdb rpcbind samba-common samba-common-bin samba-dsdb-modules samba-libs smbclient snmp sudo
Depending on your samba strategy answer 'yes' or 'no' (if you have any)
┌──────────────────────┤ Samba server and utilities ├───────────────────────┐ │ │ │ If your computer gets IP address information from a DHCP server on the │ │ network, the DHCP server may also provide information about WINS servers │ │ ("NetBIOS name servers") present on the network. This requires a change │ │ to your smb.conf file so that DHCP-provided WINS settings will │ │ automatically be read from /var/lib/samba/dhcp.conf. │ │ │ │ The dhcp-client package must be installed to take advantage of this │ │ feature. │ │ │ │ Modify smb.conf to use WINS settings from DHCP? │ │ │ │ <Yes> <No> │ │ │ └───────────────────────────────────────────────────────────────────────────┘
After this also the apache2 web server should be started. Test it with http://localhost. However this installation has some issue which can be seen in the terminal of installation when the installation script tries to restart apache2.
apache2_invoke: Enable configuration nagios4-cgi apache2_reload: Your configuration is broken. Not reloading Apache 2 apache2_reload: AH00526: Syntax error on line 37 of \ /etc/apache2/conf-enabled/nagios4-cgi.conf: apache2_reload: Invalid command 'AuthDigestDomain', perhaps misspelled or \ defined by a module not included in the server configuration
Restarting would not fix the issue (of course).
# /etc/init.d/apache2 restart [....] Restarting apache2 (via systemctl): apache2.serviceJob for \ apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. failed!
The error can be seen with apache2 commands
# apachectl configtest AH00526: Syntax error on line 37 of /etc/apache2/conf-enabled/nagios4-cgi.conf: Invalid command 'AuthDigestDomain', perhaps misspelled or defined by a module \ not included in the server configuration Action 'configtest' failed. The Apache error log may have more information
The command is unknown to apache2 because modules have not been enabled.
# a2enmod auth_digest Considering dependency authn_core for auth_digest: Module authn_core already enabled Enabling module auth_digest. To activate the new configuration, you need to run: systemctl restart apache2
It is good practice to test the configuration again
# apachectl configtest AH00526: Syntax error on line 40 of /etc/apache2/conf-enabled/nagios4-cgi.conf: Invalid command 'AuthGroupFile', perhaps misspelled or defined by a module \ not included in the server configuration Action 'configtest' failed. The Apache error log may have more information.
And again one module is missing
# a2enmod authz_groupfile Considering dependency authz_core for authz_groupfile: Module authz_core already enabled Enabling module authz_groupfile. To activate the new configuration, you need to run: systemctl restart apache2
And again test the configuration
# apachectl configtest Syntax OK
Start/ restart the web server
# systemctl restart apache2
Unfortunately the installation gives not hint where too look for Nagios. Looking in the configuration reveals it is http://localhost/nagios4/.
WARNING: Be aware that this installation installs Nagios without any password. So this site is visible to the network. It also installs this on port 80, so no transport encryption of any kind.
Pros And Cons
Pros |
Cons |
* Easy installation |
* 2 Apache modules not activated |
* Fast installation |
* No password for Nagios access |
* Automatic configuration for localhost |
* No Nagios site encryption |
|
* No information about landing page |
|
* Dependency to Apache (not Nginx) |
|
* Dependency to Samba |
Unknown issues: Would installation work with postfix as MTA?
|