LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   About Nagios (https://www.linuxquestions.org/questions/linux-newbie-8/about-nagios-4175459974/)

ust 04-29-2013 05:20 AM

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

TenTenths 04-29-2013 05:34 AM

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.

ust 04-29-2013 10:14 AM

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

TenTenths 04-29-2013 10:26 AM

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.

angel115 04-29-2013 10:52 AM

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.

Habitual 04-30-2013 09:41 AM

Quote:

Originally Posted by TenTenths (Post 4941203)
Read your nagios.cfg file.

What he said and RTFM There is no native "GUI interface" for adding hosts in Nagios (welcome to Linux).


All times are GMT -5. The time now is 05:52 AM.