Selasa, 29 November 2016

How To Monitor Windows Auto Inwards Nagios Using Nsclient++ Agent

What is NSClient++ :-

NSClient++ a elementary withal powerful in addition to flexible monitoring daemon. It was built for Nagios/Icinga/Naemon, simply zippo inwards the daemon is Nagios/Icinga specific in addition to it tin flame in addition to is used inwards many other scenarios where yous desire to receive/distribute banking concern check metrics. It is alone possible to utilisation it stand upwards lone besides equally the kernel monitoring organization though that is non recommended equally it is rather limited.

How to Install NSClient++ :-

Download NSClient++ from below mentioned link :

Installation Steps :-
Run Downloaded File NSClient++ 










The installation has been finished Successfully.


Nagios Core Side Configuration :-

We request login to Nagios kernel server using putty.
Step 1:- 
 Create Influenza A virus subtype H5N1 fundamental directory to proceed all the Windows.cfg file using below command.
root@WPT: # mkdir /usr/local/nagios/etc/windows
Now Copy Windows template amongst the hostname nosotros are going to add. In my illustration I k adding Host ISHWS69. Use below ascendancy to Copy template.
root@WPT: # cp /usr/local/nagios/etc/objects/windows.cfg /usr/local/nagios/etc/windows/ishws69.cfg

Step 2:- 
Now brand highlighted changes into the .cfg file equally follow:
root@WPT: # vi /usr/local/nagios/etc/windows/ishws69.cfg

############################################################################### # WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING Influenza A virus subtype H5N1 WINDOWS MACHINE # # # NOTES: This config file assumes that yous are using the sample configuration #  files that larn installed amongst the Nagios quickstart guide. # ###############################################################################     ############################################################################### ############################################################################### # # HOST DEFINITIONS # ############################################################################### ###############################################################################  # Define a host for the Windows machine we'll live on monitoring # Change the host_name, alias, in addition to address to fit your province of affairs  define host{  utilisation  windows-server ; Inherit default values from a template  host_name ishws69  ; The shout out we're giving to this host  alias  My Windows Server ; Influenza A virus subtype H5N1 longer shout out associated amongst the host  address  10.0.1.107 ; IP address of the host  }     ############################################################################### ############################################################################### # # HOST GROUP DEFINITIONS # ############################################################################### ###############################################################################   # Define a hostgroup for Windows machines # All hosts that utilisation the windows-server template volition automatically live on a fellow member of this grouping  define hostgroup{  hostgroup_name windows-servers ; The shout out of the hostgroup  alias  Windows Servers ; Long shout out of the grouping  }     ############################################################################### ############################################################################### # # SERVICE DEFINITIONS # ############################################################################### ###############################################################################   # Create a service for monitoring the version of NSCLient++ that is installed # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description NSClient++ Version  check_command  check_nt!CLIENTVERSION  }    # Create a service for monitoring the uptime of the server # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description Uptime  check_command  check_nt!UPTIME  }    # Create a service for monitoring CPU charge # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description CPU Load  check_command  check_nt!CPULOAD!-l 5,80,90  }    # Create a service for monitoring retentiveness usage # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description Memory Usage  check_command  check_nt!MEMUSE!-w eighty -c ninety  }    # Create a service for monitoring C:\ disk usage # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description C:\ Drive Space  check_command  check_nt!USEDDISKSPACE!-l c -w eighty -c ninety  }    # Create a service for monitoring the W3SVC service # Change the host_name to gibe the shout out of the host yous defined inwards a higher house  define service{  utilisation   generic-service  host_name  ishws69  service_description W3SVC  check_command  check_nt!SERVICESTATE!-d SHOWALL -l W3SVC  }   

Save in addition to Exit from the file.
Step 3:- Add ishws69.cfg file path into nagios.cfg file then that Nagios Core tin flame start reading this file.

Open Nagios.cfg configuration file using below command.
root@WPT: # vi /usr/local/nagios/etc/nagios.cfg
Now add together the highlighted line into conf file.
############################################################################## # # NAGIOS.CFG - Sample Main Config File for Nagios 4.2.3 # # Read the documentation for to a greater extent than information on this configuration # file.  I've provided to a greater extent than or less comments here, simply things may non live on then # clear without farther explanation. # # ##############################################################################   # LOG FILE # This is the primary log file where service in addition to host events are logged # for historical purposes.  This should live on the outset alternative specified # inwards the config file!!!  log_file=/usr/local/nagios/var/nagios.log    # OBJECT CONFIGURATION FILE(S) # These are the object configuration files inwards which yous define hosts, # host groups, contacts, contact groups, services, etc. # You tin flame divide your object definitions across several config files # if yous wishing (as shown below), or proceed them all inwards a unmarried config file.  # You tin flame specify private object config files equally shown below: cfg_file=/usr/local/nagios/etc/objects/commands.cfg cfg_file=/usr/local/nagios/etc/objects/contacts.cfg cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg cfg_file=/usr/local/nagios/etc/objects/templates.cfg  # Definitions for monitoring the local (Linux) host cfg_file=/usr/local/nagios/etc/objects/localhost.cfg  # Definitions for monitoring a Windows machine #cfg_file=/usr/local/nagios/etc/objects/windows.cfg cfg_file=/usr/local/nagios/etc/windows/ishws69.cfg # Definitions for monitoring a router/switch #cfg_file=/usr/local/nagios/etc/objects/switch.cfg  # Definitions for monitoring a network printer #cfg_file=/usr/local/nagios/etc/objects/printer.cfg  
Save in addition to Exit from the file.
Step 4:- Check Nagios Core configuration file for whatever error. Using below command.
root@WPT: # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  Nagios Core 4.2.3 Copyright (c) 2009-present Nagios Core Development Team in addition to Community Contributors Copyright (c) 1999-2009 Ethan Galstad Last Modified: 11-21-2016 License: GPL  Website: https://www.nagios.org Reading configuration data...    Read primary config file okay...    Read object config files okay...  Running pre-flight banking concern 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 v fourth dimension 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 v timeperiods Checking global effect handlers... Checking obsessive compulsive processor commands... Checking misc settings...  Total Warnings: 0 Total Errors:   0
Step 5:- Restart Nagios Core service 

root@WPT: # /etc/init.d/nagios restart [ ok ] Restarting nagios (via systemctl): nagios.service.

Now Access Nagios through Browser in addition to banking concern check newly added host should live on there.












That's All

!!!Cheers!!!


Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar