Help me to configure Nagios 2.0 in my RHEL 5 box

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.
LVL 13
jeebukarthikeyanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Deepak KosarajuDevOps EngineerCommented:
Attached Document give you best examples
Gud luck
Windows-Monitoring-using-Nagios.pdf
jeebukarthikeyanAuthor Commented:
thanks a lot..can u give me a sample command.cfg and services.cfg file...
Deepak KosarajuDevOps EngineerCommented:
Its clearly defined in the document for example are the command service definitions for winserver from the same document.


define command 
{ 
command_name check_nt_cpuload 
command_line $USER1$/check_nt -H $HOSTADDRESS$ -v CPULOAD -l $ARG1$ 
} 
define service 
{ 
host_name winsrv 
service_description CPU Load 
check_command check_nt_cpuload!5,80,90,15,70,80 
... 
} 

Open in new window

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

jeebukarthikeyanAuthor Commented:
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! :)
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
;
Deepak KosarajuDevOps EngineerCommented:
here is the mistake
check_command and command_name both should be same
Following is the correct service object definition.

check_command           check_nt_memuse!80!90

Gud luck

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jeebukarthikeyanAuthor Commented:
thanks man
Deepak KosarajuDevOps EngineerCommented:
Is there any reason for selecting Grade B why not Grade A when my assistance helped you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.