LinuxQuestions.org
Visit Jeremy's Blog.
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, 02: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, 02: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, 02: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, 01:22 PM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

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 01:26 PM.
 
Old 12-23-2011, 01:27 PM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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-21-2011 12:16 AM
nagios adding remote host problem ramesh14 Linux - Software 3 03-04-2011 09:37 AM
not able to monitor Linux host under nagios rajiv.patil82 Linux - Software 3 11-16-2010 12:11 AM
LXer: Add Linux host to nagios server LXer Syndicated Linux News 0 06-22-2009 01:00 PM
after chnaging the ipaddress of nagios server new hosts adding error sridhar11 Linux - Software 0 10-26-2005 02:07 PM

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

All times are GMT -5. The time now is 10:37 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration