LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2011, 01:21 AM   #1
jeyachandran1988
LQ Newbie
 
Registered: Dec 2011
Posts: 6

Rep: Reputation: Disabled
Help Reg : Adding Linux Host Server in Nagios


Hi,

Am new to Nagios, am struggling to add a local Linux machine to monitor the services.

Pls guide me how to add local machine to monitor

Thanks in advance
 
Old 12-23-2011, 01:38 AM   #2
jeyachandran1988
LQ Newbie
 
Registered: Dec 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi all

How do i add local linux machine in nagios server to monitor the services

Thanks in advance
 
Old 12-23-2011, 01:47 AM   #3
coolsg5636
Member
 
Registered: Sep 2011
Location: Pune,India
Distribution: RHEL ,CentOS, Fedora
Posts: 100

Rep: Reputation: 25
Hello,

Please follow these articles to monitor local system using NRPE plugin.

http://library.nagios.com/component/tag/linux
 
Old 12-23-2011, 12:22 PM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Thumbs up

Assuming that you have set up your nagios server and you just have to add a new host in the server.

By the way which OS you are using?

Here I'm telling you the configuration on Ubuntu. I'm taking an example of adding google as your new host.

Now first make a new object definition file by typing:

Quote:
#sudo vim /usr/local/nagios/etc/objects/google.cfg
and adding the following lines to it:

Code:
# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               google.com
        alias                   google.com
        address                 www.google.com
        }

###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

# Define a service to "ping" the local machine

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       google.com
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }

# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       google.com
        service_description             HTTP
        check_command                   check_http
        notifications_enabled           0
        }

now edit your main config file to tell it the location of the new config file:

Quote:
#sudo vim /usr/local/nagios/etc/nagios.cfg
add the folowwing line to the file:

Quote:
cfg_file=/usr/local/nagios/etc/objects/google.cfg
Now restart your nagios daemon:

Quote:
#sudo /etc/init.d/nagios restart

if you get any errors when restarting run the following command to check for problems with your config files:

Quote:
#sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Last edited by Satyaveer Arya; 12-23-2011 at 12:26 PM.
 
Old 12-23-2011, 12:27 PM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Ohhh, I think you are using Ubuntu.. Hnnn, am I right??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] nagios adding remote host problem uppalagayatri Linux - Software 2 03-20-2011 11:16 PM
nagios adding remote host problem ramesh14 Linux - Software 3 03-04-2011 08:37 AM
not able to monitor Linux host under nagios rajiv.patil82 Linux - Software 3 11-15-2010 11:11 PM
LXer: Add Linux host to nagios server LXer Syndicated Linux News 0 06-22-2009 12:00 PM
after chnaging the ipaddress of nagios server new hosts adding error sridhar11 Linux - Software 0 10-26-2005 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration