Fedora 30 -בו RHEL/CentOS 8/7 -ב Nagios 4.4.5 תא ןיקתהל דציכ


Nagios לכ לע רומשת דימתש רתוי הפיקמ רוטינ תביבס ךל קפסמ אוה ,םיהדמ חותפ דוק רוטינ ילכ אוה תותשרה/תונוכמה ךלש תונטקה תודבעמב קר וא ךלש םינותנה זכרמב אצמנ התא םא ןיב.

.םייקסעה םידספהה תאו התבשהה ןמז תא תיחפהל ונל רזוע הז .םישחרתמ םהש ינפל תויעב המכ תוהזל ונל רזוע רבד לש ופוסבש המ ,ךלש םיתרשב שבתשמ והשמ םא ןייצמו תורהזא הארמ הז .דיחי ןולחב םהיתוריש לעו ם

.2019 טסוגואב 20- ב Nagios 2.2.1 יפסות לש הנורחאה הביציה הרודהמה תאו Nagios Core 4.4.5 לש רתויב תוינכדעה תואסרגה תא Nagios האיצוה הנורחאל

.26-30 הרודפו RHEL 8/7/6, CentOS 8/7/6 תוצפהב (tarball) רוקממ ןורחאה Nagios Core 4.4.5 תא ןיקתהל דציכ תולק תוארוה םע ךתוא ךירדהל דעונ הז רמאמ

.ונימי לש סקוניל יתרש בורב 100% ב דובעתש תיסיסב הנקתה קר םדקתמ הנקתה ךילה ןיא ,ךלש תימוקמה הנוכמה רחא בוקעת תוקד 30 ךות

.CentOS 7.5 Linux תצפה לע ססבתהב תובותכ ןאכ וגצוהש הנקתהה תוארוה :בל ומיש

Nagios 2.2.1 ףסותו Nagios 4.4.5 תנקתה

.אבה עדימה תא לבקת ,הכלהכ הלא תוארוה רחא אלממ התא םא

    .לדחמה תרירב תוליבח ןיקתמב שמתשהל םילוכי ונא ,תאז תושעל ידכו .רוקמה םע Nagios 4.4.5 תנקתה ינפל הלש חותיפה תוירפס תאו GD תוירפסו gcc, glibc, glibc-common ומכ תוירפס המכו Apache, PHP תא ןיקת

     yum install -y httpd httpd-tools php gcc glibc glibc-common gd gd-devel make net-snmp
    
    -------------- On Fedora -------------- 
     dnf install -y httpd httpd-tools php gcc glibc glibc-common gd gd-devel make net-snmp
    

    .המסיס רדגהו nagcmd הצובקה ןובשחו useradd הדוקפה תועצמאב nagios לש שדח שמתשמ רוצ

     useradd nagios
     groupadd nagcmd

    .usermod הדוקפה תועצמאב nagcmd תצובקל apache -ה שמתשמו nagios שמתשמה תא ףסוה ,ןכמ רחאל

     usermod -G nagcmd nagios
     usermod -G nagcmd apache

    .הלש תוידיתעה תודרוהה לכו ךלש Nagios תנקתהל הירפס רוצ

     mkdir /root/nagios
     cd /root/nagios

    .wget תדוקפ םע Nagios 2.2.1 -ו Nagios Core 4.4.5 לש רתויב תוינכדעה תוליבחה תא תעכ דרוה

     wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.5.tar.gz
     wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
    

    .ןמקלדכ tar תדוקפ םע ודרוהש תוליבח ץלחל ונילע

     tar -xvf nagios-4.4.5.tar.gz
     tar -xvf nagios-plugins-2.2.1.tar.gz

    .וז הירפסב תושדח תויקית יתש ועיפוי ,tar תדוקפ תועצמאב הלא תפז ירודכ ץלחמ התא רשאכ

     ls -l
    total 13520
    drwxrwxr-x 18 root root     4096 Aug 20 17:43 nagios-4.4.5
    -rw-r--r--  1 root root 11101966 Aug 20 17:48 nagios-4.4.5.tar.gz
    drwxr-xr-x 15 root root     4096 Apr 19 12:04 nagios-plugins-2.2.1
    -rw-r--r--  1 root root  2728818 Apr 19 12:04 nagios-plugins-2.2.1.tar.gz
    

    .ןלהל האר אנא .אמגודל טלפכ רבד לש ופוסב טלפה תא גיצי הז ,רדסב ךלי לכה םאו הרוצתה ץבוק תא ץירהלו Nagios לש הירפסל רובעל ונילע תאז תושעל ידכו Nagios לש הבילה תא רידגנ תישאר ,תעכ

     cd nagios-4.4.5/
     ./configure --with-command-group=nagcmd
    Creating sample config files in sample-config/ ...
    
    
    *** Configuration summary for nagios 4.4.5 2019-08-20 ***:
    
     General Options:
     -------------------------
            Nagios executable:  nagios
            Nagios user/group:  nagios,nagios
           Command user/group:  nagios,nagcmd
                 Event Broker:  yes
            Install ${prefix}:  /usr/local/nagios
        Install ${includedir}:  /usr/local/nagios/include/nagios
                    Lock file:  /run/nagios.lock
       Check result directory:  /usr/local/nagios/var/spool/checkresults
               Init directory:  /lib/systemd/system
      Apache conf.d directory:  /etc/httpd/conf.d
                 Mail program:  /usr/bin/mail
                      Host OS:  linux-gnu
              IOBroker Method:  epoll
    
     Web Interface Options:
     ------------------------
                     HTML URL:  http://localhost/nagios/
                      CGI URL:  http://localhost/nagios/cgi-bin/
     Traceroute (used by WAP):  /usr/bin/traceroute
    
    
    Review the options above for accuracy.  If they look okay,
    type 'make all' to compile the main program and CGIs.
    

    .האלה ךישמהל לכונו ךלש בשחמב תושורדה תוירפסה לכ תא ןיקתת איה ,הנקתה תושעלו make all הדוקפה םע תויראניבה לכ תא ןיקתהלו ףוסאל ונילע ,הרוצתה תרדגה רחאל

     make all
     make install
    *** Compile finished ***
    
    If the main program and CGIs compiled without any errors, you
    can continue with testing or installing Nagios as follows (type
    'make' without any arguments for a list of all possible options):
    
      make test
         - This runs the test suite
    
      make install
         - This installs the main program, CGIs, and HTML files
    
      make install-init
         - This installs the init script in /lib/systemd/system
    
      make install-daemoninit
         - This will initialize the init script
           in /lib/systemd/system
    
      make install-groups-users
         - This adds the users and groups if they do not exist
    
      make install-commandmode
         - This installs and configures permissions on the
           directory for holding the external command file
    
      make install-config
         - This installs *SAMPLE* config files in /usr/local/nagios/etc
           You'll have to modify these sample files before you can
           use Nagios.  Read the HTML documentation for more info
           on doing this.  Pay particular attention to the docs on
           object configuration files, as they determine what/how
           things get monitored!
    
      make install-webconf
         - This installs the Apache config file for the Nagios
           web interface
    
      make install-exfoliation
         - This installs the Exfoliation theme for the Nagios
           web interface
    
      make install-classicui
         - This installs the classic theme for the Nagios
           web interface
    

    .Nagios רובע init םיטפירקס תא ןיקתת האבה הדוקפה

     make install-init

    .הדוקפה בצמ תא ןיקתהל ונילע הדוקפה תרושמ דובעל סויגאנל םורגל ידכ

     make install-commandmode

    .האבה הדוקפה תא לעפה אנא ,המגודל Nagios יצבק ןקתה ,ןכמ רחאל

     make install-config
    /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
    /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/objects
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg
    /usr/bin/install -c -b -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/templates.cfg /usr/local/nagios/etc/objects/templates.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/commands.cfg /usr/local/nagios/etc/objects/commands.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/contacts.cfg /usr/local/nagios/etc/objects/contacts.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/timeperiods.cfg /usr/local/nagios/etc/objects/timeperiods.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/localhost.cfg /usr/local/nagios/etc/objects/localhost.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/windows.cfg /usr/local/nagios/etc/objects/windows.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/printer.cfg /usr/local/nagios/etc/objects/printer.cfg
    /usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/switch.cfg /usr/local/nagios/etc/objects/switch.cfg
    
    *** Config files installed ***
    
    Remember, these are *SAMPLE* config files.  You'll need to read
    the documentation for more information on how to actually define
    services, hosts, etc. to fit your particular needs.
    

    .ל"אוד תוארתה תלבקל nagiosadmin רשקה שיא תרדגהל תכיושמה ל"אודה תבותכ תא רדגהו ךלש ךרועה תריחב םע "contacts.cfg" ץבוק תא חתפ

    # vi /usr/local/nagios/etc/objects/contacts.cfg
    ###############################################################################
    ###############################################################################
    #
    # CONTACTS
    #
    ###############################################################################
    ###############################################################################
    
    # Just one contact defined by default - the Nagios admin (that's you)
    # This contact definition inherits a lot of default values from the 'generic-contact'
    # template which is defined elsewhere.
    
    define contact{
           contact_name                    nagiosadmin             ; Short name of user
           use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
           alias                           Nagios Admin            ; Full name of user
    
           email                           [email linux-console.net     ; *** CHANGE THIS TO YOUR EMAIL ADDRESS ****
           }

    ."nagiosadmin"\רצוויי תשר להנמ שמתשמו Nagios רובע טנרטניא קשממ רידגת הטמלש הדוקפה .האבה הדוקפה םע Nagios רובע טנרטניאה קשממ תא רידגנ וישכע ,backend -ב הרוצתה לכ םע ונמייס

     make install-webconf

    .Nagios לש טנרטניאה קשממל הסינכ תעב שמשת וז המסיסש ןוויכמ רוכזל התוא רומשו םיימעפ המסיס קפס אנא ,וז הדוקפ עוציב רחאל ."nagiosadmin"\רובע המסיס רוצינ ונא ,הז בלשב

     htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
    New password:
    Re-type new password:
    Adding password for user nagiosadmin

    .ףקותל וסנכיי תושדחה תורדגההש ידכ Apache תא שדחמ לעפה

     service httpd start               [On RHEL/CentOS 6]
     systemctl start httpd.service     [On RHEL/CentOS 7/8 and Fedora]
    

    .תוארוהל םאתהב ותוא ןקתהו רדגהו םשל ךל ,root/nagios/-ב Nagios לש םיפסותה תא ונדרוה

     cd /root/nagios
     cd nagios-plugins-2.2.1/
     ./configure --with-nagios-user=nagios --with-nagios-group=nagios
     make
     make install

    .תחתמ הקופתל המודב עיפוי אוה קלח רובעי לכה םא .האבה הדוקפה תא סנכה אנא תאז תושעל ידכו תאז תמאל ןמזה עיגהו Nagios תרוצת םע ונמייס ונלוכ תעכ

     /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
    Nagios Core 4.4.5
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 2019-08-20
    License: GPL
    
    Website: https://www.nagios.org
    Reading configuration data...
       Read main config file okay...
       Read object config files okay...
    
    Running pre-flight check on configuration data...
    
    Checking objects...
    	Checked 8 services.
    	Checked 1 hosts.
    	Checked 1 host groups.
    	Checked 0 service groups.
    	Checked 1 contacts.
    	Checked 1 contact groups.
    	Checked 24 commands.
    	Checked 5 time periods.
    	Checked 0 host escalations.
    	Checked 0 service escalations.
    Checking for circular paths...
    	Checked 1 hosts
    	Checked 0 service dependencies
    	Checked 0 host dependencies
    	Checked 5 timeperiods
    Checking global event handlers...
    Checking obsessive compulsive processor commands...
    Checking misc settings...
    
    Total Warnings: 0
    Total Errors:   0
    
    Things look okay - No serious problems were detected during the pre-flight check
    

    .systemctl -ו chkconfig הדוקפה םע httpd -ו סויגנ תא ףיסוהל ונילע ,שדחמ םילוחתא לע דובעל סויגאנל םורגל ידכ

     chkconfig --add nagios
     chkconfig --level 35 nagios on
     chkconfig --add httpd
     chkconfig --level 35 httpd on
     systemctl enable nagios
     systemctl enable httpd
    

    .ףקותל וסנכיי תושדחה תורדגההש ידכ Nagios תא שדחמ לעפה

     service nagios start              [On RHEL/CentOS 6]
     systemctl start nagios.service    [On RHEL/CentOS 7/8 and Fedora]
    

    .המסיס -ו "nagiosadmin"\שמתשמה םש תא קפסו "http:// FQDN/nagios"\וא "http:// Your-server-IP-address/nagios"\םע ךלש ןפדפדב ותוא חתפ אנא ,הדובעל ןכומ ךלש Nagios ה

    .רוטינל ךלש עסמה תא תלחתה קוידב .החלצהב ולש םיפסותה תאו Nagios תא תרדגהו תנקתה !בוט לזמ

    Nagios 4.4.5 -ל Nagios 3.x תא גרדש

    .ןלהל גצומש יפכ ותוא רידגהלו ולש ןורחאה תפזה ביכרא תא דירוהל ךירצ קר התא ,תאז תושעל ידכ .תע לכב התוא גרדשל לכות ,Nagios לש רתוי הנשי הסרג ץירמ רבכ התא םא

     service nagios stop
     wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.5.tar.gz
     tar -zxvf nagios-4.4.5.tar.gz
     cd nagios-4.4.5
     ./configure
     make all
     make install
     service nagios start

    .טשפתהל ונתוא ףתשלו קייל תושעל חכשת לאו טנימקטל רבוחמו ןווכמ ראשיה זא דע .תורעה תועצמאב ונילא הנפ אנא ,הנקתהה ךלהמב תויעבב לקתנ התא םא .Nagios לש רוטינה תרשל םירישכמו םיגתמ ,תוספדמ ,תונולח

    :םג ארק