How to configure Nagios 2.0 in Rhel 5

Hi all

    I have installed Nagios 2.0 in my Rhel 5 box.I want to monitor Windows servers (Active dirtectory+exchange server+dns) and all basic windows services likeMemory usage, CPU load, Disk usage, Service states, Running processes and few linux machine+all services of linux

For windows i have installed nsclient and for linux I have installed nrpe

i have configured the below mentioned cfg file

host,hostgroup,contact,contact group,timeperiod

I need to configure command.cfg and services.cfg as its very confusing.can anybody please help me.A sample template can help me to solve my problem.Thnks in advance

You have the example here:
nagios.sourceforge.net/docs/2_0/ … ml#service

Anyhow define template, for example:

define service { name check_ping_template check_command check_ping!200.0,20%!500.0,60% max_check_attempts 5 normal_check_interval 3 retry_check_interval 1 active_checks_enabled 1 check_period 24x7 notification_interval 720 notification_period 24x7 notification_options w,u,c,r,f register 0 }
Then, define service:

define service { host_name linux1,linux2,linux3 service_description checkping-linux contact_groups admins,linux-contactgroup use check_ping_template }

If you have to make your own commands then do as said here (you have the example also):
nagios.sourceforge.net/docs/2_0/ … ml#command

hi
to monitoring windows server, i often use snmp (you have to install snmp on windows servers and all required perl libray on nagios server)

for example (from plugin configuration) :

check process via snmp

check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG1$ -n $ARG2$

check services via snmp

check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG1$ -n $ARG2$

check win cpu

check_snmp_load.pl -H $ARG1$ -C $ARG2$ -T stand -w $ARG3$ -c $ARG4$ -f --timeout=60

I download every plugin on nagiosexchange.com/

thanks for the reply but i am not able to monitor my windows machine.i have installed nsclient.but i my nagios webinterface i am getting could not fetech information from the server.

here is my configuration details

define command{
command_name check_nt_memuse
command_line $USER1$/check_nt -H $HOSTADDRESS$ -s password -p 1248 -v MEMUSE -w $ARG1$ -c $ARG2$
}

define service{
host_name ad-blr-02
service_description Memory Usage
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups Domain-Admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nt!MEMUSE!-w 80 -c 90
}

Nsclient configuration(nsc.ini) nagios -ip 192.168.142.112

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! :slight_smile:
NRPEClient.dll

[Settings]
;# OBFUSCATED PASSWORD
; This is the same as the password option but here you can store the password in an obfuscated manner.
; NOTICE obfuscation is NOT the same as encryption, someone with access to this file can still figure out the
; password. Its just a bit harder to do it at first glance.
;obfuscated_password=Jw0KAUUdXlAAUwASDAAB
;
;# PASSWORD
; This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly.
password=password
;
;# 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=192.168.142.112
;
;# USE THIS FILE
; Use the INI file as opposed to the registry if this is 0 and the use_reg in the registry is set to 1
; the registry will be used instead.
use_file=1

[log]
;# LOG DEBUG
; Set to 1 if you want debug message printed in the log file (debug messages are always printed to stdout when run with -test)
;debug=1
;
;# LOG FILE
; The file to print log statements to
;file=NSC.log
;
;# LOG DATE MASK
; The format to for the date/time part of the log entry written to file.
;date_mask=%Y-%m-%d %H:%M:%S

[NSClient]
;# ALLOWED HOST ADDRESSES
; This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon.
; If you leave this blank the global version will be used instead.
allowed_hosts=192.168.142.112
;
;# NSCLIENT PORT NUMBER
; This is the port the NSClientListener.dll will listen to.
port=1248
;
;# BIND TO ADDRESS
; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname.
; Leaving this blank will bind to all avalible IP adresses.
;bind_to_address=
;
;# SOCKET TIMEOUT
; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
;socket_timeout=30

[NRPE]
;# NRPE PORT NUMBER
; This is the port the NRPEListener.dll will listen to.
;port=5666
;
;# COMMAND TIMEOUT
; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.
;allow_arguments=0
;

Here you have defined check_nt_memuse command (and that is the one you should use in your service definition) with several arguments and two of $ARGn$ variables. Only those $ARGn$ variables should be supplied from service definition without the -w and -c switches because you have already specified them in command definition, just the values.

define command{ command_name check_nt_memuse command_line $USER1$/check_nt -H $HOSTADDRESS$ -s password -p 1248 -v MEMUSE -w $ARG1$ -c $ARG2$ }

Your service definition should look like this (only check_command variable changed):

define service{ host_name ad-blr-02 service_description Memory Usage is_volatile 0 check_period 24x7 max_check_attempts 4 normal_check_interval 5 retry_check_interval 1 contact_groups Domain-Admins notification_interval 120 notification_period 24x7 notification_options w,u,c,r check_command check_nt_memuse!80!90 }