Monitoring

MPDL,EDV

=Introduction=


 * Step-by-step instruction for installing Icinga2 on the monitoring server

=Teil 1=

The server's standard installation
mcedit /etc/apt/sources.list apt-get update apt-cache search icinga2 apt-get install apache2 apt-get install icinga2

apt-get -t wheezy-backports install libjs-jquery-ui apt-get install icinga-cgi-bin apt-get install icinga2-classicui
 * abändern, kein BACKPORTS

nachzulesen auf: http://www.thomas-krenn.com/de/wiki/Installation_von_Icinga2_unter_Ubuntu_Server_14.04

neue icinga2 Quelle http://debmon.org/instructions

=Teil 2=

http://www.postgresql.org/download/linux/debian/
 * download Postgres (what Debian version is installed on the server?) and follow the instruction on the website


 * Stop Postgres and move directory
 * /var/lib/postgresql/.../main nach /data_pg/db_94/main
 * abändern und check Postgresql.config and user rights
 * chmod 700 .../db_94/
 * chown postgres:postgres /data_archive/db_94/
 * Start Postgres


 * Postgresql.conf edit:
 * localhost
 * max_connections 200
 * wal_level=archive
 * archive_mode = on
 * archive_command = cp %p /data_archive/db_94/%f
 * client_min_messages=notice
 * log_min_error=error
 * log_checkpoints on
 * log_connections on
 * log_disconnections on
 * log_duration off (!!)
 * log_hostname on
 * log_line_prefix %e%%%t
 * log_statement ddl
 * track_counts on
 * track_functions pl
 * autovacuum on
 * autovacumm_naptime 1min (besser ggf. groesser!! - bis 10 Minuten)

-> yes

https://github.com/Icinga/icingaweb2/blob/master/doc/installation.md


 * git clone git://git.icinga.org/icingaweb2.git


 * incingaweb2.conf add the following below the section "AllowOverride None":
 * and then in the terminal again:
 * copy somewhatofatoken


 * edit in Apache2 - php5 config (nano /etc/php5/apache2/php.ini)
 * date.timezone= "Europe/Berlin"

http://mpdl-monitoring.mpdl.mpg.de/icingaweb2 Log in in gui with user and pw ...


 * go through the steps filling in the following:
 * Datenbank:
 * Ressourcename icingaweb_db
 * Host: localhost
 * Port 5432
 * Db name icingaweb_db
 * username _icingaweb_db
 * password: 


 * create USER _icingaweb_db with password 'you know where to find that';
 * create DATABASE icingaweb_db;
 * alter DATABASE icingaweb_db owner to _icingaweb_db;
 * exit (exit postgres user)


 * again in web-GUI: Weiter, weiter, weiter
 * in setup then choose "livestatus""

somewhatofatoken


 * again in web-GUI
 * add IDO (Configuration -> Ressource)
 * then add under Module - Monitoring live and ido ... and deactivate live!

=Teil 3=

www-data in gruppe Nagios usermod -G nagios www-data

pnp4nagios.conf mit richtiger htaccess aus icinga2-classicui.conf

ToDo: apache2 wg. rrdcached in gruppe Nagios ==> ???

https://wiki.icinga.org/display/howtos/PNP4Nagios+in+Classic-UI https://tipstricks.itmatrix.eu/installing-icinga2-in-debian-wheezy/

1) eigenes Template pnp_templates.conf template Host "pnp-hst" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=_HOST_" } template Service "pnp-svc" { action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/popup?host=$HOSTNAME$&srv=$SERVICEDESC$" } ==> Templates ergänzen in /etc/icinga2/conf.d/templates template Host "generic-host" { max_check_attempts = 5 check_interval = 1m retry_interval = 30s check_command = "hostalive" import "pnp-hst" }

template Service "generic-service" { max_check_attempts = 3 check_interval = 1m retry_interval = 30s import "pnp-svc" }

cd /usr/share/icinga ln -s htdocs/ssi ssi dann /usr/share/doc/pnp4nagios/examples/status-header nach ssi

icinga2 restart apache2 restart

Auf SRV01 im YAST unter Software Repositories folgenden Link einfügen http://download.opensuse.org/repositories/home:/hornos/SLE_11_SP3/ Dann im Software Management FreeIPMI installieren

Plugin Runterladen check_ipmi_sensor: git clone http://git.thomas-krenn.com/check_ipmi_sensor_v2.git

Evtl git zuerst installieren Dann auf DRAC testen mit ca. dem hier

Version2: ./check_ipmi_sensor -H 192.168.99.54 -U nagios -P nagios -L user -T fan -O '-D LAN_2_0'

DRAC IPMI Benutzerberechtigungen auf benutzer benutzer im Interface konfigurieren seriell über LAN aktivieren DRAC auf Gastbenutzer IPMI Privilege level:     -L user enable DRAC over LAN evtl noch im Interface einstellen

nagios-remote user anlegen für DRAC-Rechner, die mit check_by_ssh geprüft werden z.B.: SRV01 dann auf mpdl-monitoring.mpdl.mpg.dem User Nagios (Icinga2 läuft unter Benutzer Nagios, siehe cat /etc/icinga2/init.conf ) su - nagios dem Benutzer einen ssh key generieren: ssh-keygen -t rsa (Passphrase empty!) ssh-copy-id -i ~/.ssh/id_rsa.pub nagios-remote@srv01.mpdl.mpg.de prüfen, ob es geht mit ssh 'nagios-remote@srv01.mpdl.mpg.de'

SRV01 ist unsere SONDE für die check_by_ssh Dienste dort sind die Plugins zu hinterlegen

auf SRV01 cp /root/check_ipmi/check_ipmi_sensor_v2/check_ipmi_sensor /usr/lib/nagios/plugins/

check_by_ssh auf mpdl-monitoring.mpdl.mpg.de über SRV01 auf DRAC su - nagios ./check_by_ssh -t 30 -l nagios-remote -H $HOSTADDRESS$ -C " "

nagios@mpdl-monitoring:/usr/lib/nagios/plugins$ ./check_by_ssh -t 30 -l nagios-remote -H srv01.mpdl.mpg.de -C "/usr/lib/nagios/plugins/check_ipmi_sensor -H 192.168.99.54 -U nagios -P nagios -L user -T fan -O '-D LAN_2_0'" Sensor Type 'fan' Status: OK | 'FAN MOD 1A RPM'=7575.000000 'FAN MOD 1B RPM'=7575.000000 'FAN MOD 1C RPM'=4950.000000 'FAN MOD 1D RPM'=4650.000000 'FAN MOD 2A R                    PM'=7350.000000 'FAN MOD 2B RPM'=7875.000000 'FAN MOD 2C RPM'=4875.000000 'FAN M                     OD 2D RPM'=4800.000000 'FAN MOD 3A RPM'=8025.000000 'FAN MOD 3B RPM'=7800.000000                      'FAN MOD 3C RPM'=4950.000000 'FAN MOD 3D RPM'=4950.000000 'FAN MOD 4A RPM'=7575                     .000000 'FAN MOD 4B RPM'=7725.000000 'FAN MOD 4C RPM'=5175.000000 'FAN MOD 4D RP                     M'=5025.000000

apt-get install mailutils apt-get install libnet-dns-perl check_dns_seconardy.pl