ວິທີການເພີ່ມ Windows ໂຮດຕິ້ງໃຫ້ກັບ Server Server Nagios


ບົດຂຽນນີ້ອະທິບາຍວິທີການກວດສອບການບໍລິການຂອງ Windows ໃຫ້“ ເປັນສ່ວນຕົວ” ເຊັ່ນ: ການໂຫຼດ CPU, ການໃຊ້ Disk, ການໃຊ້ Memory, ການບໍລິການແລະອື່ນໆ. addon ເຮັດ ໜ້າ ທີ່ຕົວແທນລະຫວ່າງເຄື່ອງ Windows ແລະ Nagios ແລະຕິດຕາມກວດກາການບໍລິການຕົວຈິງໂດຍການສື່ສານກັບ check_nt plugin. ປັcheckກອິນ check_nt ທີ່ຕິດຕັ້ງຢູ່ໃນ Nagios Monitoring Server, ຖ້າທ່ານຕິດຕາມຄູ່ມືການຕິດຕັ້ງ Nagios ຂອງພວກເຮົາ.

ພວກເຮົາສົມມຸດວ່າທ່ານໄດ້ຕິດຕັ້ງແລະຕັ້ງຄ່າເຊີຟເວີ Nagios ແລ້ວຕາມ ຄຳ ແນະ ນຳ ຕໍ່ໄປນີ້ຂອງພວກເຮົາ.

<

  • ວິທີຕິດຕັ້ງ Nagios 4.0.1 ໃນ RHEL/CentOS 6.x/5.x ແລະ Fedora 19/18/17
  • ເພີ່ມ Linux Host ເຂົ້າໃນ Server Server Nagios
  • ເພື່ອຕິດຕາມ Windows Machines ທ່ານ ຈຳ ເປັນຕ້ອງປະຕິບັດຕາມຫລາຍຂັ້ນຕອນແລະມັນຄື:

    <

  • ຕິດຕັ້ງ NSClient ++ addon ໃນ Windows Machine.
  • ຕັ້ງຄ່າ Nagios Server ສຳ ລັບຕິດຕາມ Windows Machine.
  • ເພີ່ມ ຄຳ ນິຍາມ ໃໝ່ ຂອງໂຮດແລະການບໍລິການ ສຳ ລັບການກວດສອບເຄື່ອງ Windows.
  • ເລີ່ມການບໍລິການ Nagios ຄືນ.
  • ເພື່ອເຮັດໃຫ້ຄູ່ມືແນະ ນຳ ນີ້ງ່າຍດາຍແລະງ່າຍຂື້ນ, ການຕັ້ງຄ່າບໍ່ຫຼາຍປານໃດ ສຳ ລັບທ່ານໃນການຕິດຕັ້ງ Nagios.

    <

  • ຄຳ ນິຍາມ ຄຳ ສັ່ງ check_nt ຖືກເພີ່ມເຂົ້າໄປໃນແຟ້ມ command.cfg ແລ້ວ. ຄຳ ສັ່ງນິຍາມນີ້ຖືກໃຊ້ໂດຍ check_nt plugin ເພື່ອຕິດຕາມບໍລິການ Windows.
  • ແມ່ແບບ windows-server host ທີ່ຖືກສ້າງຂື້ນແລ້ວໃນແຟ້ມ templates.cfg. ແມ່ແບບນີ້ຊ່ວຍໃຫ້ທ່ານສາມາດເພີ່ມ ຄຳ ນິຍາມ ໃໝ່ ຂອງ Windows host.
  • ສອງເອກະສານຂ້າງເທິງນີ້“ command.cfg” ແລະ“ templates.cfg” ໄຟລ໌ສາມາດພົບໄດ້ທີ່/usr/local/nagios/etc/object/directory. ທ່ານສາມາດດັດແປງແລະເພີ່ມ ຄຳ ນິຍາມຂອງຕົວເອງທີ່ ເໝາະ ສົມກັບຄວາມຕ້ອງການຂອງທ່ານ. ແຕ່, ຂ້າພະເຈົ້າຂໍແນະ ນຳ ໃຫ້ທ່ານປະຕິບັດຕາມ ຄຳ ແນະ ນຳ ທີ່ອະທິບາຍໄວ້ໃນບົດຄວາມນີ້ແລະທ່ານຈະໄດ້ຕິດຕາມກວດກາ windows windows ຂອງທ່ານຢ່າງປະສົບຜົນ ສຳ ເລັດພາຍໃນເວລາບໍ່ຮອດ 20 ນາທີ.

    ຂັ້ນຕອນທີ 1: ຕິດຕັ້ງຕົວແທນ NSClient ++ ໃນ Windows Machine

    ກະລຸນາໃຊ້ ຄຳ ແນະ ນຳ ຕໍ່ໄປນີ້ເພື່ອຕິດຕັ້ງ NSClient ++ Agent ໃນ Windows Windows Remote. ທຳ ອິດດາວໂຫລດເອກະສານສະບັບ NSClient ++ 0.3.1 ລຸ້ນ ໃໝ່ ທີ່ມີຄວາມ ໝັ້ນ ຄົງ, ເຊິ່ງສາມາດພົບໄດ້ທີ່ link ຂ້າງລຸ່ມ

    <

  • http://sourceforge.net/projects/nscplus/
  • ເມື່ອທ່ານໄດ້ດາວໂຫລດເວີຊັນທີ່ມີສະຖຽນລະພາບ ໃໝ່ ຫຼ້າສຸດແລ້ວ, ໃຫ້ຖອນໄຟລ໌ NSClient ++ ເຂົ້າໄປໃນໄດເລກະທໍລີ ໃໝ່ C:\NSClient ++.

    ຕອນນີ້ເປີດ ຄຳ ສັ່ງ MS-DOS ຈາກ Start Screen -> Run -> ພິມ 'cmd' ແລ້ວກົດ enter ແລະປ່ຽນໄປທີ່ C:\NSClient ++ directory.

    C:\NSClient++

    ຕໍ່ໄປ, ລົງທະບຽນບໍລິການ NSClient ++ ໃນລະບົບດ້ວຍ ຄຳ ສັ່ງຕໍ່ໄປນີ້.

    nsclient++ /install

    ສຸດທ້າຍ, ຕິດຕັ້ງ systray NSClient ++ ດ້ວຍ ຄຳ ສັ່ງຕໍ່ໄປນີ້.

    nsclient++ SysTray

    ເປີດ Windows Services Manager ແລະກົດຂວາໃສ່ NSClient ໄປທີ່ Properties ແລະຫຼັງຈາກນັ້ນກົດ 'ເຂົ້າສູ່ລະບົບ' ແລ້ວກົດປຸ່ມກ່ອງກາເຄື່ອງ ໝາຍ ວ່າ“ ອະນຸຍາດໃຫ້ບໍລິການພົວພັນກັບ desktop”. ຖ້າມັນບໍ່ໄດ້ຖືກອະນຸຍາດແລ້ວ, ກະລຸນາ ໝາຍ ໃສ່ຫ້ອງທີ່ຈະອະນຸຍາດ.

    ເປີດເອກະສານ NSC.INI ທີ່ຕັ້ງຢູ່ C:\NSClient ++ ແລະບໍ່ສະຫຼັບໂມດູນທັງ ໝົດ ທີ່ລະບຸໄວ້ໃນພາກສ່ວນ "ໂມດູນ", ຍົກເວັ້ນ CheckWMI.dll ແລະ RemoteConfiguration.dll.

    [modules]
    ;# NSCLIENT++ MODULES
    ;# A list with DLLs to load at startup.
    ;  You will need to enable some of these for NSClient++ to work.
    ; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
    ; *                                                               *
    ; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
    ; *                                                               *
    ; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
    FileLogger.dll
    CheckSystem.dll
    CheckDisk.dll
    NSClientListener.dll
    NRPEListener.dll
    SysTray.dll
    CheckEventLog.dll
    CheckHelpers.dll
    ;CheckWMI.dll
    ;
    ; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
    ;RemoteConfiguration.dll
    ; NSCA Agent is a new beta module use with care!
    ;NSCAAgent.dll
    ; LUA script module used to write your own "check deamon" (sort of) early beta.
    ;LUAScript.dll
    ; Script to check external scripts and/or internal aliases, early beta.
    ;CheckExternalScripts.dll
    ; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
    ;NRPEClient.dll

    ບໍ່ອະນຸຍາດໃຫ້ໃຊ້“ allow_hosts” ໃນສ່ວນ“ Settings” ແລະ ກຳ ນົດທີ່ຢູ່ IP ຂອງ Server ຂອງທ່ານ Nagios Monitoring ຫຼືປ່ອຍໃຫ້ມັນຫວ່າງເພື່ອອະນຸຍາດໃຫ້ເຈົ້າຂອງທຸກຄົນເຊື່ອມຕໍ່.

    [Settings]
    ;# ALLOWED HOST ADDRESSES
    ;  This is a comma-delimited list of IP address of hosts that are allowed to talk to the all daemons.
    ;  If leave this blank anyone can access the deamon remotly (NSClient still requires a valid password).
    ;  The syntax is host or ip/mask so 192.168.0.0/24 will allow anyone on that subnet access
    allowed_hosts=172.16.27.41
    

    ບໍ່ເອົາໃຈໃສ່ຕໍ່“ ທ່າເຮືອ” ໃນສ່ວນ“ NSClient” ແລະ ກຳ ນົດໃຫ້ພອດຕັ້ງຖິ່ນຖານເດີມ“ 12489 ‘. ຮັບປະກັນວ່າເປີດ“ 12489 ‘port ເທິງ Windows Firewall.

    [NSClient]
    ;# NSCLIENT PORT NUMBER
    ;  This is the port the NSClientListener.dll will listen to.
    port=12489
    

    ສຸດທ້າຍເລີ່ມຕົ້ນການບໍລິການ NSClient ++ ດ້ວຍ ຄຳ ສັ່ງຕໍ່ໄປນີ້.

    nsclient++ /start

    ຖ້າການຕິດຕັ້ງແລະການຕັ້ງຄ່າຂອງທ່ານຢ່າງຖືກຕ້ອງ, ທ່ານຄວນຈະເຫັນສັນຍາລັກ ໃໝ່ ໃນຖາດລະບົບໃນວົງມົນສີເຫລືອງທີ່ມີສີ ດຳ 'M' ຢູ່ພາຍໃນ

    ຂັ້ນຕອນທີ 2: ການຕັ້ງຄ່າ Nagios Server ແລະເພີ່ມ Windows Hosts

    ຕອນນີ້ເຂົ້າສູ່ລະບົບ Nagios Server ແລະເພີ່ມ ຄຳ ນິຍາມບາງຢ່າງໃນໄຟລ໌ການຕັ້ງຄ່າຂອງ Nagios ເພື່ອຕິດຕາມກວດກາເຄື່ອງ Windows ໃໝ່. ເປີດເອກະສານ windows.cfg ເພື່ອແກ້ໄຂກັບບັນນາທິການ Vi.

     vi /usr/local/nagios/etc/objects/windows.cfg

    ຕົວຢ່າງຂອງ ຄຳ ວ່າ Windows host ທີ່ໄດ້ ກຳ ນົດໄວ້ ສຳ ລັບເຄື່ອງ Windows, ທ່ານພຽງແຕ່ສາມາດປ່ຽນ ຄຳ ນິຍາມ host ເຊັ່ນ host_name, ນາມແຝງແລະເຂດທີ່ຢູ່ກັບຄ່າທີ່ ເໝາະ ສົມຂອງເຄື່ອງ Windows ຂອງທ່ານ.

    ###############################################################################
    ###############################################################################
    #
    # HOST DEFINITIONS
    #
    ###############################################################################
    ###############################################################################
    
    # Define a host for the Windows machine we'll be monitoring
    # Change the host_name, alias, and address to fit your situation
    
    define host{
            use             windows-server  ; Inherit default values from a template
            host_name       winserver       ; The name we're giving to this host
            alias           My Windows Server       ; A longer name associated with the host
            address         172.31.41.53    ; IP address of the host
            }

    ການບໍລິການຕໍ່ໄປນີ້ແມ່ນຖືກເພີ່ມແລະເປີດໃຊ້ໃນແຟ້ມ windows.cfg ແລ້ວ. ຖ້າທ່ານຕ້ອງການເພີ່ມ ຄຳ ນິຍາມການບໍລິການອື່ນໆທີ່ ຈຳ ເປັນຕ້ອງໄດ້ຮັບການຕິດຕາມກວດກາ, ທ່ານສາມາດເພີ່ມ ຄຳ ນິຍາມເຫຼົ່ານັ້ນເຂົ້າໃນເອກະສານການຕັ້ງຄ່າດຽວກັນ. ໃຫ້ແນ່ໃຈວ່າປ່ຽນຊື່ host_name ສຳ ລັບບໍລິການທັງ ໝົດ ນີ້ດ້ວຍ host_name ທີ່ໄດ້ ກຳ ນົດໄວ້ໃນຂັ້ນຕອນຂ້າງເທິງ.

    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	NSClient++ Version
    	check_command		check_nt!CLIENTVERSION
    	}
    
    Add the following service definition to monitor the uptime of the Windows server.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	Uptime
    	check_command		check_nt!UPTIME
    	}
    
    Add the following service definition to monitor the CPU utilization on the Windows server and generate a CRITICAL alert if the 5-minute CPU load is 90% or more or a WARNING alert if the 5-minute load is 80% or greater.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	CPU Load
    	check_command		check_nt!CPULOAD!-l 5,80,90
    	}
    
    Add the following service definition to monitor memory usage on the Windows server and generate a CRITICAL alert if memory usage is 90% or more or a WARNING alert if memory usage is 80% or greater.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	Memory Usage
    	check_command		check_nt!MEMUSE!-w 80 -c 90
    	}
    
    Add the following service definition to monitor usage of the C:\ drive on the Windows server and generate a CRITICAL alert if disk usage is 90% or more or a WARNING alert if disk usage is 80% or greater.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	C:\ Drive Space
    	check_command		check_nt!USEDDISKSPACE!-l c -w 80 -c 90
    	}
    
    Add the following service definition to monitor the W3SVC service state on the Windows machine and generate a CRITICAL alert if the service is stopped.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	W3SVC
    	check_command		check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
    	}
    
    Add the following service definition to monitor the Explorer.exe process on the Windows machine and generate a CRITICAL alert if the process is not running.
    
    define service{
    	use			generic-service
    	host_name		winserver
    	service_description	Explorer
    	check_command		check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
    	}

    ສຸດທ້າຍ, ການບໍ່ເອົາໃຈໃສ່ເອກະສານ windows.cfg ໃນ /usr/local/nagios/etc/nagios.cfg.

     vi /usr/local/nagios/etc/nagios.cfg
    # Definitions for monitoring a Windows machine
    cfg_file=/usr/local/nagios/etc/objects/windows.cfg
    

    ສຸດທ້າຍ, ກວດສອບເອກະສານການຕັ້ງຄ່າຂອງ Nagios ສຳ ລັບ erros.

     /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
    Total Warnings: 0
    Total Errors:   0
    
    Things look okay - No serious problems were detected during the pre-flight check

    ຖ້າຂັ້ນຕອນການຢັ້ງຢືນຖິ້ມຂໍ້ຄວາມຜິດພາດ, ແກ້ໄຂຂໍ້ຜິດພາດເຫລົ່ານັ້ນຈົນກວ່າຂະບວນການຢັ້ງຢືນຈະ ສຳ ເລັດໂດຍບໍ່ມີຂໍ້ຄວາມຜິດພາດໃດໆ. ເມື່ອທ່ານແກ້ໄຂຂໍ້ຜິດພາດເຫລົ່ານັ້ນ, ໃຫ້ທ່ານເລີ່ມຕົ້ນການບໍລິການຂອງ Nagios.

     service nagios restart
    
    Running configuration check...done.
    Stopping nagios: done.
    Starting nagios: done.

    ນັ້ນແມ່ນມັນ. ຕອນນີ້ເຂົ້າໄປທີ່ Nagios Monitoring Web ທີ່“ http:// Your-server-IP-address/nagios” ຫຼື“ http:// FQDN/nagios” ແລະໃຫ້ຊື່ຜູ້ໃຊ້“ Nagiosadmin” ແລະລະຫັດຜ່ານ. ກວດເບິ່ງວ່າ Windows Host ໄລຍະໄກຖືກເພີ່ມແລະ ກຳ ລັງຕິດຕາມຢູ່.

    ນັ້ນແມ່ນມັນ! ສຳ ລັບໃນຕອນນີ້, ໃນບົດຂຽນທີ່ຈະມາເຖິງຂອງຂ້ອຍຂ້ອຍຈະສະແດງວິທີການເພີ່ມເຄື່ອງພິມແລະການປ່ຽນໃສ່ເຄື່ອງຈັກຕິດຕາມກວດກາ Nagios. ຖ້າທ່ານປະສົບກັບຄວາມຫຍຸ້ງຍາກໃນຂະນະທີ່ເພີ່ມ Windows host ໃນ Nagios. ກະລຸນາຂຽນ ຄຳ ເຫັນຂອງທ່ານຜ່ານພາກສະແດງຄວາມຄິດເຫັນ, ຈົນກວ່າຈະຕິດຕາມເບິ່ງກັບ linux-console.net ສຳ ລັບບົດຄວາມທີ່ມີຄຸນຄ່າເຊັ່ນນີ້.