ຕິດຕັ້ງ Munin (ຕິດຕາມກວດກາເຄືອຂ່າຍ) ໃນ RHEL, CentOS & Fedora


Munin (ເຄື່ອງມືກວດສອບເຄືອຂ່າຍ) ແມ່ນໂປແກຼມກວດສອບເຄືອຂ່າຍທີ່ອີງໃສ່ແຫຼ່ງເປີດທີ່ຂຽນໃນ Perl ເຊິ່ງສະແດງໃຫ້ເຫັນການ ນຳ ໃຊ້ເຄືອຂ່າຍຂອງເຄື່ອງແມ່ຂ່າຍແລະການບໍລິການໃນຮູບແບບກາຟິກໂດຍໃຊ້ RRDtool. ດ້ວຍການຊ່ວຍເຫຼືອຂອງ Munin ທ່ານສາມາດຕິດຕາມກວດກາການປະຕິບັດງານຂອງລະບົບ, ເຄືອຂ່າຍ, SANS ແລະແອັບພລິເຄຊັນຂອງທ່ານ.

ມັນມີສະຖາປັດຕະຍະກໍາ/ຂໍ້ທີ່ແມ່ບົດເຊື່ອມຕໍ່ກັບແຕ່ລະ node ເປັນປະຈໍາແລະດຶງຂໍ້ມູນຈາກພວກມັນ. ຫຼັງຈາກນັ້ນມັນໃຊ້ RRDtool ເພື່ອເຂົ້າສູ່ລະບົບແລະສ້າງເສັ້ນສະແດງກາຟິກທີ່ຖືກປັບປຸງ.

ໃນບົດຂຽນນີ້, ພວກເຮົາຈະຍ່າງຜ່ານຂັ້ນຕອນຕ່າງໆຂອງທ່ານໃນການຕັ້ງຄ່າ Munin (ເຄື່ອງມືຕິດຕາມກວດກາເຄືອຂ່າຍ) ກັບ Munin Node ໃນລະບົບ RHEL, CentOS ແລະ Fedora ໂດຍໃຊ້ສະພາບແວດລ້ອມຕໍ່ໄປນີ້.

Munin Server - hostname: munin.linux-console.net and IP Address: 192.168.103
Munin Client - hostname: munin-node.linux-console.net and IP Address: 192.168.15

ການຕິດຕັ້ງ Munin ໃນ RHEL, CentOS & Fedora

ການຕິດຕັ້ງ Munin ແມ່ນງ່າຍດາຍຫຼາຍ, ພຽງແຕ່ປະຕິບັດຕາມ ຄຳ ສັ່ງທີ່ເປັນບາດກ້າວຕໍ່ໄປນີ້ຂອງຂ້ອຍເພື່ອຕິດຕັ້ງມັນຢູ່ໃນ server ຂອງທ່ານ.

Munin ສາມາດຕິດຕັ້ງໄດ້ໂດຍການໃຊ້ຫ້ອງສະຫມຸດ EPEL ຂອງ Fedora's ພາຍໃຕ້ RHEL 7.x/6.x/5.x ແລະ CentOS 7.x/6.x/5.x.

ພຽງແຕ່, ດໍາເນີນການຄໍາສັ່ງຕໍ່ໄປນີ້ເປັນຜູ້ໃຊ້ຮາກໃນການຕິດຕັ້ງແລະເປີດໃຊ້ Epel repository ໂດຍໃຊ້ wget.

------------------ RHEL/CentOS 7 - 64-Bit ------------------
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -ivh epel-release-7-9.noarch.rpm
------------------ RHEL/CentOS 6 - 32-Bit ------------------
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

------------------ RHEL/CentOS 6 - 64-Bit ------------------
# http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
------------------ RHEL/CentOS 5 - 32-Bit ------------------
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

------------------ RHEL/CentOS 5 - 64-Bit ------------------
# wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

ໝາຍ ເຫດ: ຜູ້ໃຊ້ Fedora ບໍ່ ຈຳ ເປັນຕ້ອງຕິດຕັ້ງຫ້ອງເກັບ EPEL, ເພາະວ່າ munin ແມ່ນລວມຢູ່ໃນ Fedora ແລະສາມາດຕິດຕັ້ງໄດ້ໂດຍໃຊ້ yum ຫຼື dnf package manager.

ຕໍ່ໄປ, ເຮັດການປັບປຸງລະບົບເພື່ອໃຫ້ແນ່ໃຈວ່າຖານຂໍ້ມູນຊຸດ EPEL ຖືກໂຫລດກ່ອນທີ່ພວກເຮົາຈະຕິດຕັ້ງ Munin.

------------------ On RHEL and CentOS Only ------------------
# yum -y update

Munin ຕ້ອງການເຄື່ອງແມ່ຂ່າຍເວັບທີ່ເຮັດວຽກເຊັ່ນ Apache ຫຼື Nginx ເພື່ອສະແດງເອກະສານສະຖິຕິຂອງມັນ. ພວກເຮົາຈະຕິດຕັ້ງເຄື່ອງແມ່ຂ່າຍເວັບໄຊຕ໌ Apache ເພື່ອບໍລິການກາຟິກ Munin ທີ່ນີ້.

------------------ On RHEL, CentOS and Fedora ------------------
# yum install httpd

------------------ On Fedora 22+ Releases ------------------
# dnf install httpd    

ເມື່ອ Apache ຕິດຕັ້ງແລ້ວ, ໃຫ້ເລີ່ມຕົ້ນແລະເປີດໃຊ້ບໍລິການເພື່ອເລີ່ມຕົ້ນໂດຍອັດຕະໂນມັດໃນເວລາບູດລະບົບ.

------------------ On RHEL, CentOS and Fedora ------------------
# service httpd start
# chkconfig --level 35 httpd on

------------------ On RHEL/CentOS 7 and Fedora 22+ ------------------
# systemctl enable httpd
# systemctl start httpd

ດຽວນີ້ເຖິງເວລາແລ້ວທີ່ຈະຕິດຕັ້ງ Munin ແລະ Munin-Node ດັ່ງທີ່ສະແດງໄວ້.

------------------ On RHEL, CentOS and Fedora ------------------
# yum -y install munin munin-node

------------------ On Fedora 22+ Releases ------------------
# dnf -y install munin munin-node

ໂດຍຄ່າເລີ່ມຕົ້ນການຕິດຕັ້ງຂ້າງເທິງຈະສ້າງລາຍການຕໍ່ໄປນີ້.

<

  • /etc/munin/munin.conf: ໄຟລ໌ການຕັ້ງຄ່າແມ່ບົດ Munin.
  • /etc/cron.d/munin: ເອກະສານ Munin cron.
  • /etc/httpd/conf.d/munin.conf: ໄຟລ໌ການຕັ້ງຄ່າ Munin Apache.
  • /var/log/munin: ໄດເລກະທໍລີບັນທຶກ Munin.
  • /var/www/html/munin: ເວັບໄຊຕ໌ Munin.
  • /etc/munin/munin-node.conf: ໄຟລ໌ການຕັ້ງຄ່າແມ່ບົດ Munin Node.
  • /etc/munin/plugins.conf: ແຟ້ມການຕັ້ງຄ່າຂອງໂປຣແກມ Munin.
  • ຂັ້ນຕອນນີ້ແມ່ນທາງເລືອກແລະສາມາດໃຊ້ໄດ້ໃນກໍລະນີທີ່ທ່ານຕ້ອງການໃຊ້ munin.linux-console.net ແທນ localhost ໃນຜົນຜະລິດ HTML ຕາມທີ່ສະແດງ:

    ເປີດເອກະສານການຕັ້ງຄ່າ /etc/munin/munin.conf ແລະເຮັດການປ່ຽນແປງຕາມທີ່ແນະ ນຳ ແລະຢ່າລືມທີ່ຈະປ່ຽນແທນ munin.linux-console.net ດ້ວຍຊື່ເຄື່ອງແມ່ຂ່າຍຂອງທ່ານ.

    # a simple host tree
    [munin.linux-console.net]
        address 127.0.0.1
        use_node_name yes
    [...]
    

    ລະຫັດຜ່ານຕໍ່ໄປປົກປ້ອງສະຖິຕິ Munin ດ້ວຍຊື່ຜູ້ໃຊ້ແລະລະຫັດຜ່ານໂດຍໃຊ້ໂມດູນ auth ຂັ້ນພື້ນຖານຂອງ Apache ດັ່ງທີ່ສະແດງ:

    # htpasswd /etc/munin/munin-htpasswd admin
    

    ເລີ່ມຕໍ່ໄປ Munin ແລະເຮັດໃຫ້ມັນເລີ່ມຕົ້ນໃນເວລາບູດອັດຕະໂນມັດ.

    ------------------ On RHEL, CentOS and Fedora ------------------
    # service munin-node start
    # chkconfig --level 35 munin-node on
    
    ------------------ On RHEL/CentOS 7 and Fedora 22+ ------------------
    # systemctl enable munin-node
    # systemctl start munin-node
    

    ລໍຖ້າ 30 ນາທີເພື່ອໃຫ້ Munin ສາມາດຜະລິດກາຟແລະສະແດງມັນ. ເພື່ອເບິ່ງຜົນຜະລິດເສັ້ນສະແດງ ທຳ ອິດ, ເປີດໂປແກຼມທ່ອງເວັບຂອງທ່ານແລະ ນຳ ໄປທີ່ http://munin.linux-console.net/munin ແລະປ້ອນຂໍ້ມູນການເຂົ້າສູ່ລະບົບ.

    ຖ້າມັນບໍ່ໄດ້ກະຕຸ້ນຊື່ຜູ້ໃຊ້ແລະລະຫັດຜ່ານ, ໃຫ້ເປີດ /etc/httpd/conf.d/munin.conf ແລະປ່ຽນຊື່ຜູ້ໃຊ້ຈາກ Munin ເປັນ admin ແລະເລີ່ມ Apache ໃໝ່.

    AuthUserFile /etc/munin/munin-htpasswd
    AuthName "admin"
    AuthType Basic
    require valid-user
    

    ເຂົ້າສູ່ລະບົບເຄື່ອງລູກຄ້າ Linux ແລະຕິດຕັ້ງພຽງແຕ່ຊຸດ munin-node ເທົ່າກັບທີ່ສະແດງ:

    # yum install munin-node
    # dnf install munin-node      [On Fedora 22+ versions]
    # apt-get install munin-node  [On Debian based systems]
    

    ຕອນນີ້ເປີດເອກະສານການຕັ້ງຄ່າ /etc/munin/munin-node.conf ແລະເພີ່ມທີ່ຢູ່ IP ຂອງ server server ເພື່ອໃຫ້ສາມາດດຶງຂໍ້ມູນຈາກລູກຄ້າໄດ້.

    # vi /etc/munin/munin-node.conf
    

    ຕື່ມທີ່ຢູ່ IP ຂອງ Munin sever ໃນຮູບແບບຕໍ່ໄປນີ້ດັ່ງທີ່ສະແດງ:

    # A list of addresses that are allowed to connect.  
    
    allow ^127\.0\.0\.1$
    allow ^::1$
    allow ^192\.168\.0\.103$
    

    ສຸດທ້າຍ, ເລີ່ມຕົ້ນລູກຄ້າ munin:

    ------------------ On RHEL, CentOS and Fedora ------------------
    # service munin-node start
    # chkconfig --level 35 munin-node on
    
    ------------------ On RHEL/CentOS 7 and Fedora 22+ ------------------
    # systemctl enable munin-node
    # systemctl start munin-node
    

    ເປີດແຟ້ມການຕັ້ງຄ່າ /etc/munin/munin.conf ແລະເພີ່ມສ່ວນ ໃໝ່ ຕໍ່ໄປນີ້ຂອງຂໍ້ ກຳ ນົດລູກຄ້າ Linux ທີ່ຢູ່ຫ່າງໄກສອກຫຼີກທີ່ມີຊື່ server ແລະທີ່ຢູ່ IP ດັ່ງທີ່ສະແດງ:

    # a simple host tree
    [munin.linux-console.net]
        address 127.0.0.1
        use_node_name yes
    
    [munin-node.linux-console.net]
        address 192.168.0.15
        use_node_name yes
    

    ຕໍ່ໄປ, ເລີ່ມຕົ້ນ server server munin ໃໝ່ ແລະ ນຳ ທາງໄປທີ່ ໜ້າ ເວັບໄຊທ໌ http://munin.linux-console.net/munin ເພື່ອເບິ່ງເສັ້ນສະແດງຂອງລູກຄ້າ ໃໝ່ ທີ່ ກຳ ລັງປະຕິບັດ.

    ສຳ ລັບຂໍ້ມູນເພີ່ມເຕີມແລະການ ນຳ ໃຊ້ກະລຸນາເຂົ້າເບິ່ງທີ່ http://munin-monitoring.org/wiki/Documentation.