Fedora 30 -בו RHEL/CentOS 8/7 -ב (תשר רוטינ) םיסוטקק ןקתה


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

.DNF תוליבחה להנמ ילכ תועצמאב הרודפו RHEL, CentOS תוכרעמב Net-SNMP ילכה תועצמאב Cacti םשב האלמ תשר רוטינ תייצקילפא רידגהלו ןיקתהל דציכ ךל תוארהל םיכלוה ונא וז הכרדהב

.RHEL/CentOS/Fedora ומכ סקוניל לש הלעפהה תוכרעמב תואבה תוליבחה תא ןיקתהל ושרד םיסוטקקה

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

    RHEL/CentOS/Fedora -ב םיסוטקקל תושרדנ תוליבח תנקתה

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

    # yum install httpd httpd-devel   [On RHEL/CentOS 7/6]
    # dnf install httpd httpd-devel   [On RHEL/CentOS 8 and Fedora 30]
    
    # yum install mysql mysql-server      [On RHEL/CentOS 6]
    

    MariaDB םינותנה דסמ טקיורפב הליהקה ידי לע חתופש גלזמ איה MySQL ל ףילחת קפסמו- MySQL. היה ךמתנש ימשרה םינותנה סיסב רבעב MySQL תחת RHEL/CentOS הרודפו.

    .ךליאו Fedora 19 -בו RHEL/CentOS 8/7 -ב MySQL לש לדחמה תרירב םושיי איה MariaDB -ש ןוויכמ ,MariaDB -ל MySQL -מ השדח הקסע תעצבמ RedHat ,הנורחאל

    # yum install mariadb-server -y		[On RHEL/CentOS 7]
    # dnf install mariadb-server -y         [On RHEL/CentOS 8 and Fedora 30]
    
    # yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
    OR
    # dnf install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli
    
    # yum install php-snmp
    OR
    # dnf install php-snmp         
    
    # yum install net-snmp-utils net-snmp-libs
    OR
    # dnf install net-snmp-utils net-snmp-libs
    
    # yum install rrdtool
    OR
    # dnf install rrdtool
    

    SNMP -ו MySQL ,י'צאפא יתוריש ההוב

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

     service httpd start
     service mysqld start
     service snmpd start
    
     systemctl start httpd.service
     systemctl start mariadb.service
     systemctl start snmpd.service
    

    תכרעמ תלעפה ירושיק רדגה

    .הלעפהב וליחתי םהש ךכ SNMP -ו Apache, MySQL יתוריש לש הרוצת תעיבק

     /sbin/chkconfig --levels 345 httpd on
     /sbin/chkconfig --levels 345 mysqld on
     /sbin/chkconfig --levels 345 snmpd on
    
     systemctl enable httpd.service
     systemctl enable mariadb.service
     systemctl enable snmpd.service
    

    RHEL/CentOS/Fedora -ב םיסוטקק ןקתה

    .Cacti םושיי תנקתהל האבה הדוקפה תא דלקה ,רגאמה תלעפה רחאל .EPEL רגאמ תא ליעפהלו ןיקתהל ךילע ,ןאכ

    # yum install cacti         [On RHEL/CentOS 7]
    # dnf install cacti         [On RHEL/CentOS 8 and Fedora 30]
    

    םיסוטקק תנקתהל MySQL תרש לש הרוצת תעיבק

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

    # mysql_secure_installation
    

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

     mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 3
    Server version: 5.1.73 Source distribution
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> create database cacti;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> GRANT ALL ON cacti.* TO [email  IDENTIFIED BY 'tecmint';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> FLUSH privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> quit;
    Bye
    
     mysql -u root -p
    Enter password:
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 3
    Server version: 5.5.41-MariaDB MariaDB Server
    Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> create database cacti;
    Query OK, 1 row affected (0.00 sec)
    
    MariaDB [(none)]> GRANT ALL ON cacti.* TO [email  IDENTIFIED BY 'tecmint';
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> FLUSH privileges;
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> quit;
    Bye
    

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

    # rpm -ql cacti | grep cacti.sql
    /usr/share/doc/cacti-1.2.6/cacti.sql
    OR
    /usr/share/doc/cacti/cacti.sql

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

     mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
    Enter password:

    .ךרוע לכ םע etc/cacti/db.php/ ארקנש ץבוקה תא חתפ

    # vi /etc/cacti/db.php

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

    /* make sure these values reflect your actual database/host/user/password */
    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cacti";
    $database_password = "your-password-here";
    $database_port = "3306";
    $database_ssl = false;

    םיסוטקקל שאה תמוח לש הרוצת תעיבק

     iptables -A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT
     iptables -A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
     service iptables save
    
     firewall-cmd --permanent --zone=public --add-service=http
     firewall-cmd --reload
    

    םיסוטקק תנקתהל י'צאפא תרש לש הרוצת תעיבק

    .ךלש ךרועה תריחב םע etc/httpd/conf.d/cacti.conf/ םשב ץבוק חתפ

    # vi /etc/httpd/conf.d/cacti.conf
    

    .תרחא היהי הז ךלש הרקמב .172.16.16.0/20 ונלש תימוקמה LAN -ה תשרל השיג ונרשפא ,אמגודל .IP תמר יפל וא ךלש תימוקמה תשרה רובע Cacti םושייל השיג רשפאל ךילע

    Alias /cacti    /usr/share/cacti
     
    <Directory /usr/share/cacti/>
            Order Deny,Allow
            Deny from all
            Allow from 172.16.16.0/20
    </Directory>
    

    .תואבה תורדגהל םאתהב תונשל ךרטצתש ןכתי ,(2.4 י'צאפא :לשמל) י'צאפא לש הנורחאה הסריגב

    Alias /cacti    /usr/share/cacti
    
    <Directory /usr/share/cacti/>
            <IfModule mod_authz_core.c>
                    # httpd 2.4
                    Require all granted
            </IfModule>
            <IfModule !mod_authz_core.c>
                    # httpd 2.2
                    Order deny,allow
                    Deny from all
                    Allow from all
            </IfModule>
    </Directory>
    

    .י'צאפא תוריש תא שדחמ לעפה ,ףוסבל

     service httpd restart				[On RHEL/CentOS 6 and Fedora 18-12]
     systemctl restart httpd.service		[On RHEL/CentOS 8/7 and Fedora 19 onwards]
    

    םיסוטקקל ןורק תרדגה

    .etc/cron.d/cacti/ ץבוקה תא חתפ

    # vi /etc/cron.d/cacti

    .םיפרג תגצהל Cacti םושיי תא שמשמה עודי חראמ לש םינותנ ףסואו תוקד 5 לכ לעופ poller.php טפירקס .האבה הרושל הרעהה תא לטב

    #*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

    םיסוטקק תנקתה תנקתה תלעפה

    .Enter רותפכ לע ץחלו לדחמ תרירבכ םירדגומה הסינכה יטרפ תא ןזה .םיאבה םיכסמה ךרד הנקתהה תוארוה יפל לעפו/םיסוטקק/http:// YOUR-IP-HERE לא רובע טושפ ,םינכומ םיסוטקק ,ףוסבל

    User: admin
    Password: admin
    

    .לדחמ תרירבכ תרדגומה םיסוטקקה תמסיס תא הנש ,ןכמ רחאל

    .םיסוטקק לש ןוישירה םכסה תא לבק

    .םייוניש עוציב רחאל Apache תא שדחמ לעפהו גצומש יפכ /etc/php.ini ץבוקב תועצומה תורדגהה תא ןקת אנא ,םיסוטקק תנקתהל הנקתהה ינפל תוקידב גיצמ ךסמה ,ןכמ רחאל

    memory_limit = 800M
    max_execution_time = 60
    date.timezone = Asia/Kolkata
    

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

    mysql> use mysql;
    mysql> GRANT SELECT ON mysql.time_zone_name TO [email ;
    mysql> flush privileges;
    

    ." השדח הנקתה"כ הנקתהה גוסב רחב אנא

    .ךישמתש ינפל תונוכנ תואבה היירפסה תואשרה לכש אדו

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

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

    .םיסוטקקה תנקתה רחאל שמתשהל ךנוצרב ןהב םינקתהה תוינבתב רחב אנא

    .גצומש יפכ [mysqld] ףיעסה תחת MySQL /etc/my.cnf לש הרוצתה ץבוקב םיתרשה ףוסיא תא רדגה

    [mysqld]
    character-set-server=utf8mb4
    collation-server=utf8mb4_unicode_ci
    

    .ךישמהל חמש התאש רשא אנא .ןכומ טעמכ ךלש םיסוטקקה תרש

    .םיסוטקקה ףדב ורקב אנא שומישו ףסונ עדימל