[[monitoring|Monitoring]] Tool. [[icinga|Icinga]] ist ein Fork davon. [[Nconf]] ist ein Konfigurationstool für Nagios. =====Installation===== 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 =====Konfiguration===== 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 } =====Links===== * https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html * https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/toc.html * https://www.linuxtechi.com/add-windows-linux-host-to-nagios-server/ * https://subscription.packtpub.com/book/networking-and-servers/9781849515566/1/ch01lvl1sec09/creating-a-new-network-host * https://kifarunix.com/add-hosts-to-nagios-server-for-monitoring/ * https://www.thomas-krenn.com/de/wiki/Nagios_Installation_in_Debian_5.0_Lenny * https://www.youtube.com/watch?v=Uzo6yiJG6dc