Menu
  • About me
  • IT
    • General IT
    • Monitoring Tools
    • Vmware
    • Professional
  • General
    • Politics
    • Day to Day
  • Fun
    • Gaming
      • General Gaming
      • World of Warcraft
    • Music
    • Guitar
    • Travel
    • Places of touristic interest
The Mythryll Log

Εγκατάσταση Nagios 4.1.0 σε Ubuntu Server 14.04.3 LTS με plugins, check_nrpe, check_esxi_hardware και nagiosgraph

Posted on August 19, 2015

Σήμερα έπιασα ξανά το θέμα του upgrade σε Nagios 4 και έμαθα ότι στις 18/8 (χθες) βγήκε το Nagios 4.1.0 stable.

Ξεκίνησα (μετά από δοκιμή για upgrade) ένα clean install στον ubunagios03 με εγκατάσταση από την αρχή του Ubuntu Server 14.04.3 LTS και nagios core 4.1.0 & nagios plugins v.2.1.1

Πρώτα ενεργοποίησα το χρήστη root με sudo passwd root.

Μετά με το χρήστη root ενεργοποίησα το ssh login για το root κάνοντας edit στο /etc/ssh/sshd_config το PermitRootLogin σε yes.

Για την εγκατάσταση βρήκα διάφορα strings για τα προαπαιτούμενα αλλά αυτό που τελικά χρειάζεται είναι το :

apt-get install wget build-essential apache2 apache2-utils php5-gd libgd2-xpm-dev libapache2-mod-php5 libssl-dev zip

Μετά

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data

 

Κάνουμε μεταφορά των tar.gz των core & plugins στο /usr/local/src.

tar -zxf nagios-4.1.0.tar.gz
cd nagios-4.1.0/

./configure –with-nagios-group=nagios –with-command-group=nagcmd –with-mail=/usr/sbin/sendmail –with-httpd_conf=/etc/apache2/conf-available

Στη συνέχεια:

make all

make install

make install-init

make install-config

make install-commandmode

make install-webconf

cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Πάμε για τα plugins
cd ..
mv /tmp/nagios-plugins-2.1.1.tar.gz ./
ls
tar -zxf nagios-plugins-2.1.1.tar.gz
ls
cd nagios-
cd nagios-plugins-2.1.1/
ls
./configure –with-nagios-user=nagios –with-nagios-group=nagios –enable-perl-modules –enable-extra-opts
make
make install

Ενεργοποιούμε το cgi module στον Apache2

a2enmod cgi

Δημιουργούμε password για το χρήστη nagiosadmin για την πρόβαση στο nagios gui.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Ανοίγουμε το παρακάτω αρχείο

vim /etc/apache2/sites-enabled/000-default.conf

Και προσθέτουμε την εξης γραμμή:

Include conf-available/nagios.conf

Κάνουμε restart το apache2 service και ενεργοποιούμε το nagios service.

service apache2 restart
service nagios start

Έτοιμο το βασικό κομμάτι του Nagios. Έχουμε όμως και ένα αριθμό από plugins.

Συγκεκριμένα χρειαζόμαστε το Check_NRPE, το Check_esxi_hardware και το nagiosgraph.

Για το check_nrpe πρέπει εγκατασταθεί το nrpe αλλά μόνο το κομμάτι του plugin (όχι ο server). Έτσι κατεβάζουμε το NRPE από το sourceforge (έκδοση 2.15 εδώ και δύο χρόνια) και το αποσυμπιέζουμε:

 mv /tmp/nrpe-2.15.tar.gz /usr/local/src
cd /usr/local/src/
tar -zxf nrpe-2.15.tar.gz
cd nrpe-2.15/

Εγκαθιστούμε:

 ./configure –with-ssl=/usr/bin/openssl –with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all
make install-plugin

To plugin check_nrpe είναι έτοιμο για χρήση.

Το check_esxi_hardware το κατεβάζουμε από το nagios exchange.

Στη συνέχεια:

mv /tmp/check_esxi_hardware.py /usr/local/nagios/libexec/
chown nagios:nagios check_esxi_hardware.py
chmod g+w check_esxi_hardware.py

Κανονικά χρειαζόταν εγκατάσταση και downgrade του pywbem. Τώρα απλώς εγκαθιστούμε:
apt install python-pywbem

Έτοιμο το plugin.

 

April 2021
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930  
« Mar    

Categories

  • Automation
  • Education
  • Fun
  • Gaming
  • Health
  • IT
  • Monitoring Tools
  • Professional
  • Travel
  • Uncategorized
  • Vmware
  • World of Warcraft

Recent Posts

  • How to clean up tags in your malfunctioning TIG stack for SNMP monitoring – or chasing runaway tags with InfluxQL, grep and a Python script
  • Onboarding the network in Netbox – a series of talks with myself and a little story telling – Part2
  • Onboarding the network in Netbox – a series of talks with myself and a little story telling – Part 1
  • Ansible playbooks for Nagios Installation on Ubuntu 18.04.4 LTS / 20.04 LTS
  • Monitor VPN Users on Check Point Firewall with the help of Netmiko and Python, InfluxDB and Grafana
©2021 The Mythryll Log | WordPress Theme by Superbthemes.com