how do I start adding the target hosts to monitor?

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

how do I start adding the target hosts to monitor?

Postby ikekim » Wed Oct 11, 2017 10:22 pm

Hi,

I installed Nagios Core and its plugins on Centos 7.x by following the easy setup instructions online here:
https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source.html#CentOS

I tested the web console and I'm able to logon successfully and I see the localhost object.

But how do I start adding the target hosts to monitor and make them display on the web console?

I would like to monitor PING and URL.

I wasn't able to locate clear instructions on this,


Thanks,
ik
ikekim
 
Posts: 66
Joined: Wed Aug 16, 2017 12:21 pm

Re: how do I start adding the target hosts to monitor?

Postby kyang » Thu Oct 12, 2017 10:53 am

This is how I set mine up to just ping a few servers.
1. After you create a cfg for these hosts in /usr/local/nagios/etc/objects

2. Allow the cfg_file path in the nagios.cfg

3. service restart nagios

Code: Select all
# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
        host_name               xi
        alias                   xi
        address                 192.168.4.125
        icon_image              storm.png
        statusmap_image         storm.png
        }
# Define a host for the local machine

define host{
        use                     linux-server            ; Name of host template to use
        host_name               nna
        alias                   nna2
        address                 192.168.4.45
        icon_image              storm.png
        statusmap_image         storm.png
        }


My results in my nagios core of just pinging my XI and NNA server.

test.PNG


What URLS? you can do it as a service under these hosts with check_http

Code: Select all
define service{
        use                             local-service         ; Name of service template to use
        host_name                       localhost
        service_description             HTTP
        check_command                   check_http! -H www.google.com
        notifications_enabled           0
        }


Does this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm

Re: how do I start adding the target hosts to monitor?

Postby ikekim » Thu Oct 12, 2017 1:29 pm

When I go to modify the:
vi /usr/local/nagios/etc/nagios.cfg

and I add these lines:
# Definitions for monitoring a Windows registration iis machine
cfg_file=/usr/local/nagios/etc/objects/win_registration_iis.cfg

for some reason this results in nagios service being failed..if I remove the lines that I added then the nagios service resumes back to normal.

I tried with /usr/local/nagios/etc/objects/win_registration_iis.cfg and tried without.

The content for /usr/local/nagios/etc/objects/win_registration_iis.cfg is as follows:

define host {
use generic-host
host_name registration_iis
alias Some Remote Host
address 10.155.58.26
hostgroups allhosts
}


thanks,
ik
ikekim
 
Posts: 66
Joined: Wed Aug 16, 2017 12:21 pm

Re: how do I start adding the target hosts to monitor?

Postby kyang » Thu Oct 12, 2017 2:47 pm

Could you run this command and post the output.
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


What happens when you remove hostgroups? It should be hostgroup_name.

Here are the object definitions for Core.
https://assets.nagios.com/downloads/nag ... ml#service
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 17 guests