আরএইচইএল/সেন্টোস 8/7 এবং ফেডোরা 30 এ নাগিওস কীভাবে 4.4.5 ইনস্টল করবেন


নাগিওস একটি দুর্দান্ত ওপেন সোর্স মনিটরিং সরঞ্জাম, এটি আপনার সমস্ত মেশিন/নেটওয়ার্ক সর্বদা নজর রাখার জন্য আপনাকে আরও বিস্তৃত নজরদারি পরিবেশ সরবরাহ করে আপনি আপনার ডেটা সেন্টারে রয়েছেন বা কেবল আপনার ছোট ল্যাবগুলি।

নাগিওসের সাহায্যে আপনি একা উইন্ডোতে দূরবর্তী অবস্থান থেকে আপনার দূরবর্তী হোস্ট এবং তাদের পরিষেবাদি পর্যবেক্ষণ করতে পারেন। এটি সতর্কতা দেখায় এবং আপনার সার্ভারগুলিতে কিছু ভুল হয়ে যায় কিনা তা নির্দেশ করে যা শেষ পর্যন্ত আমাদের কিছু সমস্যা হওয়ার আগে এটি সনাক্ত করতে সহায়তা করে। এটি আমাদের ডাউনটাইম এবং ব্যবসায়িক ক্ষতি হ্রাস করতে সহায়তা করে।

সম্প্রতি, নাগিওস তার সর্বশেষ সংস্করণ নাগিওস কোর 4.4.5 প্রকাশ করেছে এবং 20 ই আগস্ট, 2019 এ তার সর্বশেষতম নাগিওস প্লাগইন 2.2.1 রিলিজ করেছে।

এই নিবন্ধটি আপনাকে কীভাবে RHEL 8/7/6, CentOS 8/7/6 এবং ফেডোরা 26-30 ডিস্ট্রিবিউশনে উত্স (টারবাল) থেকে সর্বশেষে নাগিওস কোর 4.4.5 ইনস্টল করতে হবে তার সহজ নির্দেশাবলীর সাথে গাইড করার উদ্দেশ্যে।

৩০ মিনিটের মধ্যে আপনি আপনার স্থানীয় মেশিনটি পর্যবেক্ষণ করবেন, কোনও উন্নত ইনস্টলেশন প্রক্রিয়া কেবলমাত্র প্রাথমিক ইনস্টলেশন যা আজকের বেশিরভাগ লিনাক্স সার্ভারে 100% কাজ করবে।

দয়া করে দ্রষ্টব্য: এখানে প্রদর্শিত নির্দেশাবলী সেন্টোস 7.5 লিনাক্স বিতরণের উপর ভিত্তি করে লিখিত হয়েছে।

নাগিওস 4.4.5 এবং নাগিওস প্লাগইন ইনস্টল করা 2.2.1

আপনি যদি এই নির্দেশাবলীটি সঠিকভাবে অনুসরণ করেন তবে আপনি নিম্নলিখিত তথ্যগুলি দিয়ে শেষ করবেন।

  1. নাগিওস এবং এর প্লাগইনগুলি/usr/স্থানীয়/নাগিও ডিরেক্টরি অধীনে ইনস্টল করা হবে
  2. নাগিওগুলি আপনার স্থানীয় মেশিনের কয়েকটি পরিষেবা (ডিস্ক ব্যবহার, সিপিইউ লোড, বর্তমান ব্যবহারকারী, মোট প্রক্রিয়া ইত্যাদি) নিরীক্ষণের জন্য কনফিগার করা হবে
  3. নাগিওস ওয়েব ইন্টারফেসটি http:// লোকালহোস্ট/নাগিওস
  4. এ উপলব্ধ

উত্স সহ নাগিওস ৪.৪.৫ ইনস্টল করার আগে আমাদের অ্যাপাচি, পিএইচপি এবং কিছু লাইব্রেরি যেমন জিসিসি, গ্লিবিসি, গ্লিবিসি-কমন এবং জিডি লাইব্রেরি এবং এর উন্নয়ন লাইব্রেরি ইনস্টল করতে হবে। এবং এটি করার জন্য, আমরা yum ডিফল্ট প্যাকেজ ইনস্টলার ব্যবহার করতে পারি।

 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

Useradd কমান্ড এবং nagcmd গ্রুপ অ্যাকাউন্ট ব্যবহার করে একটি নতুন নাগিও ব্যবহারকারী তৈরি করুন এবং একটি পাসওয়ার্ড সেট করুন।

 useradd nagios
 groupadd nagcmd

এরপরে, ইউজডমোড কমান্ডটি ব্যবহার করে নাগিওসিডিআর এবং অ্যাপাচি ব্যবহারকারী উভয়কে নাগসিএমডি গ্রুপে যুক্ত করুন।

 usermod -G nagcmd nagios
 usermod -G nagcmd apache

আপনার নাগিওস ইনস্টলেশন এবং এর ভবিষ্যতের সমস্ত ডাউনলোডের জন্য একটি ডিরেক্টরি তৈরি করুন।

 mkdir /root/nagios
 cd /root/nagios

এখন উইজেট কমান্ড সহ সর্বশেষতম নাগিওস কোর ৪.৪.৫ এবং নাগিওস ২.২.১ প্যাকেজগুলি ডাউনলোড করুন।

 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 -xvf nagios-4.4.5.tar.gz
 tar -xvf nagios-plugins-2.2.1.tar.gz

যখন আপনি এই কমান্ডটি দিয়ে টার্বলগুলি নিষ্কাশন করবেন তখন দুটি নতুন ফোল্ডার সেই ডিরেক্টরিতে উপস্থিত হবে।

 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

এখন, প্রথমে আমরা নাগিওস কোরটি কনফিগার করব এবং এটি করার জন্য আমাদের নাগিও ডিরেক্টরিতে গিয়ে কনফিগার ফাইল চালানো দরকার এবং যদি সবকিছু ঠিকঠাক হয়, তবে শেষ পর্যন্ত আউটপুটটি নমুনা আউটপুট হিসাবে প্রদর্শিত হবে। দয়া করে নীচে দেখুন.

 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 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

নিম্নলিখিত কমান্ডটি নাগিওদের জন্য init স্ক্রিপ্টগুলি ইনস্টল করবে।

 make install-init

কমান্ড লাইন থেকে নাগিওসকে কাজ করতে আমাদের কমান্ড-মোড ইনস্টল করতে হবে।

 make install-commandmode

এরপরে, নমুনা নাগিওস ফাইলগুলি ইনস্টল করুন, দয়া করে নিম্নলিখিত কমান্ডটি চালান।

 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.

আপনার সম্পাদক নির্বাচনের সাথে "संपনাগুলি। সিএফজি" ফাইলটি খুলুন এবং নগিওস্যাডমিন যোগাযোগের সংজ্ঞা সম্পর্কিত ইমেল ঠিকানাটি ইমেল সতর্কতা গ্রহণের জন্য সেট করুন।

# 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      ; *** CHANGE THIS TO YOUR EMAIL ADDRESS ****
       }

আমরা ব্যাকএন্ডে সমস্ত কনফিগারেশন দিয়ে সম্পন্ন করেছি, এখন আমরা নিম্নলিখিত কমান্ডের সাহায্যে নাগিওসের জন্য ওয়েব ইন্টারফেস কনফিগার করব। নীচের কমান্ডটি নাগিওসের জন্য ওয়েব ইন্টারফেসটি কনফিগার করবে এবং একটি ওয়েব অ্যাডমিন ব্যবহারকারী "নাগিওস্যাডমিন" তৈরি করা হবে।

 make install-webconf

এই পদক্ষেপে, আমরা "নাজিওস্যাডমিন" এর জন্য একটি পাসওয়ার্ড তৈরি করব। এই আদেশটি কার্যকর করার পরে, দয়া করে দুবার একটি পাসওয়ার্ড সরবরাহ করুন এবং এটি মনে রাখবেন কারণ আপনি নাগিওস ওয়েব ইন্টারফেসে লগইন করার সময় এই পাসওয়ার্ডটি ব্যবহার করা হবে।

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

নতুন সেটিংস কার্যকর করতে অ্যাপাচি পুনরায় চালু করুন।

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

আমরা/রুট/নাগিওগুলিতে নাগিওস প্লাগইনগুলি ডাউনলোড করেছি, সেখানে গিয়ে নীচের নির্দেশ অনুসারে এটি কনফিগার করুন এবং ইনস্টল করুন।

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

এটি যাচাই করার জন্য এখন আমরা সকলে নাগিওস কনফিগারেশন এবং এর সময় দিয়ে কাজ করেছি এবং এটি করতে দয়া করে নীচের আদেশটি সন্নিবেশ করান। যদি সবকিছু মসৃণ হয় তবে এটি নীচের আউটপুটটির মতো দেখাবে।

 /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

নাগিয়োসকে রিবুটগুলি জুড়ে কাজ করার জন্য, আমাদের chgconfig এবং systemctl কমান্ড সহ নাগিও এবং httpd যুক্ত করতে হবে।

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

নতুন সেটিংস কার্যকর করতে নাগিওগুলি পুনরায় চালু করুন।

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

আপনার নাগিওস কাজের জন্য প্রস্তুত, দয়া করে এটি আপনার ব্রাউজারে “HTTP:/আপনার-সার্ভার-আইপি-ঠিকানা/নাগিওস” বা “HTTP:/এফকিউডিএন/নাগিওস” দিয়ে খুলুন এবং “নাগিওস্যাডমিন” এবং পাসওয়ার্ড ব্যবহার করুন।

অভিনন্দন! আপনি নাগিওস এবং এর প্লাগইনগুলি সফলভাবে ইনস্টল ও কনফিগার করেছেন। আপনি এখনই পর্যবেক্ষণে আপনার যাত্রা শুরু করেছেন।

নাগিওস 3.x কে নাগিওস 4.4.5 এ আপগ্রেড করুন

আপনি যদি ইতিমধ্যে নাগিওসের একটি পুরানো সংস্করণ চালাচ্ছেন তবে আপনি যে কোনও সময় এটি আপগ্রেড করতে পারেন। এটি করার জন্য, আপনাকে কেবল এটির সর্বশেষতম সংরক্ষণাগারটি ডাউনলোড করতে হবে এবং নীচের মত এটি কনফিগার করতে হবে।

 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

এটি আপাতত, আমার আসন্ন নিবন্ধগুলিতে, আমি আপনাকে নাগিওস মনিটরিং সার্ভারে কীভাবে লিনাক্স, উইন্ডোজ, প্রিন্টারস, সুইচ এবং ডিভাইসগুলি যুক্ত করতে হয় তা দেখাব। ইনস্টল করার সময় যদি আপনার কোনও সমস্যা হয় তবে দয়া করে মন্তব্যের মাধ্যমে আমাদের সাথে যোগাযোগ করুন। ততক্ষণ টেকমিন্টের সাথে সংযুক্ত থাকুন এবং চারপাশে ছড়িয়ে দিতে আমাদের লাইক এবং শেয়ার করতে ভুলবেন না।

আরও পড়ুন:

  1. কীভাবে নাগিওস মনিটরিং সার্ভারে লিনাক্স হোস্ট যুক্ত করবেন
  2. কীভাবে উইন্ডোজ হোস্টকে নাগিওস মনিটরিং সার্ভারে যুক্ত করবেন