Monitoring Tool. Icinga ist ein Fork davon. Nconf ist ein Konfigurationstool für Nagios.
sudo apt install -y autoconf gcc libc6 make wget unzip apache2 php libapache2-mod-php libgd-dev cd /tmp wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.6.tar.gz tar xzf nagioscore.tar.gz cd /tmp/nagioscore-nagios-4.4.6/ sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled sudo make all sudo make install-groups-users sudo usermod -a -G nagios www-data sudo make install sudo make install-daemoninit sudo make install-commandmode sudo make install-config sudo make install-webconf sudo a2enmod rewrite sudo a2enmod cgi sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin service nagios start # Plugins sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext cd /tmp wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.3.3.tar.gz tar zxf nagios-plugins.tar.gz cd nagios-plugins-release-2.3.3/ sudo ./tools/setup sudo ./configure sudo make sudo make install
Die Hauptkonfiguration von nagios befindet sich unter
/usr/local/nagios/etc/nagios.cfg
und die Konfigurationen für die zu überwachenden Objekte im Unterordner „objects“.
/usr/local/nagios/etc/objects/
Möchte man weitere Hosts anlegen so muss man nagios diese mitteilen. Dazu legt man eine Konfigurationsdatei an, z.B „my-host.cfg“.
define host { host_name myhost.example.com alias myhost address 192.168.0.2 max_check_attempts 3 check_period 24x7 check_command check-host-alive contacts nagiosadmin notification_interval 60 notification_period 24x7 }
und schreibt diese in die Hauptkonfiguration.
cfg_dir=/usr/local/nagios/etc/objects/my-host.cfg
Nachdem man eine Konfiguration geändert hat den Service neu laden.
Möchte man nun einen Service auf dem neuen Host überwachen, muss man die Konfiguration bearbeiten.
define service { use local-service ; service template to use host_name myhost service_description HTTP check_command check_http notifications_enabled 0 }