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 04-29-2013, 06:20 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
About Nagios


I am new to Nagios and would like to ask how to add new hosts to it.

I have read the document , the configuration file is host-lic.cfg which can be used to modify the host table , but I can't find it in my server , could advise which file should be used to add host ? besides , except do it by modifying the configuration file , can I do it via GUI interface instead ?

thanks
 
Old 04-29-2013, 06:34 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
Centreon provides a browser based configuration for Nagios. Also take a look at the FAN (Fully Automated Nagios) project which provides a distro based on CentOS that comes with Nagios, Centreon, and a few other related tools in a "ready to run" distro.
 
Old 04-29-2013, 11:14 AM   #3
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 30
thanks reply ,

I have nagios installed in Redhat , if use FAN , do I need to re-install or re-config the existing nagios ? can I migrate existing nagios setting to FAN ? Centreon FAN is a stable project ?

besides , back to the previous , if not use GUI , which configuration file that I need to modify for adding host ? thanks

Last edited by ust; 04-29-2013 at 11:32 AM.
 
Old 04-29-2013, 11:26 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
Read your nagios.cfg file.

If it's based on the regular Nagios sample file it will have a lot of detail about where nagios is going to read definitions from.

If there's a cfg_file=entry like /usr/local/nagios/etc/hosts.cfg then that'll be the file that Nagios reads the host definitions from.
If there's a cfg_dir= entry then any files that end in .cfg in that directory will be included.

Last edited by TenTenths; 04-29-2013 at 11:27 AM.
 
Old 04-29-2013, 11:52 AM   #5
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 528

Rep: Reputation: 78
Hi ust,

Just to clarify here, the file name of the config doesn't matter really, you can call them as you like as soon as they endup by .cfg and that the folder is given to nagios.cfg.

I've create some sub folders (Windows_servers, windows_workstations, etc...) in my "/usr/local/nagios/etc/objects/" and put my config files in them, to keep things clear.
and I create 1 config file per machine that I monitor.
Here is what my nagios.cfg looks like:
Code:
...
cfg_dir=/usr/local/nagios/etc/objects/groups
cfg_dir=/usr/local/nagios/etc/objects/windows_servers
cfg_dir=/usr/local/nagios/etc/objects/windows_workstations
cfg_dir=/usr/local/nagios/etc/objects/antennas
cfg_dir=/usr/local/nagios/etc/objects/linux-unix_servers
cfg_dir=/usr/local/nagios/etc/objects/ups
...

and here is an exemple of one config file that monitor one of my machines which I called 192.168.1.2.cfg: (This file is located in etc/objects/windows_workstations folder
Code:
define host{
        use             windows-workstation     ; Inherit default values from a template
        host_name       168.1.2-Badgeuse   ; The name we're giving to this host
        alias           168.1.2-Badgeuse   ; A longer name associated with the host
        parents         168.1.12-Switch
        address         192.168.1.2   ; IP address of the host
        }



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


# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above


define service{
        use                     generic-service
        host_name               168.1.2-Badgeuse
        service_description     01. CPU Load
        check_command           check_nt!CPULOAD!-l 5,80,90
        }
I hope that help.
You can refer to the nagios documentation as well:
http://nagios.sourceforge.net/docs/3...g-windows.html

Best regards,
Angel.

Last edited by angel115; 04-29-2013 at 11:54 AM.
 
Old 04-30-2013, 10:41 AM   #6
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,159
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Quote:
Originally Posted by TenTenths View Post
Read your nagios.cfg file.
What he said and RTFM There is no native "GUI interface" for adding hosts in Nagios (welcome to Linux).
 
1 members found this post helpful.
  


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
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 08:26 AM
nagios not working (http://localhost/nagios or http://ip/nagios) 404 error connect2janu Linux - Server 1 11-18-2012 03:06 AM
i am unable to monitor or connect remote linux server uning nagios 3.3 on nagios linn nandunay Linux - Server 2 05-09-2012 05:56 AM
LXer: April Nagios Training Dates Include Advanced Nagios Class LXer Syndicated Linux News 0 03-18-2011 10:30 AM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 06:33 PM


All times are GMT -5. The time now is 06:26 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