Hostgroup Issue

Alex Dehaini alexdehaini at gmail.com
Tue Jan 20 11:50:10 CET 2009


Asam,

I have been using nagios for over 2 years now, never had any problem with
it. Until now, I have noticed my nagios server is a bit sluggish. A couple
of days ago, I added a host and a couple of services to it - nagios saw it
and later said the host wasn't added. I am having the similar situation now.

I don't add my host directly to host.cfg and services directly to
services.cfg. I created folders and include the folder directories in
nagios.cfg. So, the host and services have been added, I add each host in
it's own file - why nagios is not seeing it is the problem.

Here is the host config - it is in a file called smcantoments.cfg under
/usr/local/nagios/etc/radios/

define host{
        use                     aps
        host_name               sm at cantoments
        alias                   SM at Cantoments
        address                 10.217.226.168
        parents                 ap5.4 at baatsona2
        }

Here is the service config - it is in a file called
smcantoments-services.cfg under /usr/local/nagios/etc/allservices

define service{
        use                             aps
        host_name                       sm at cantoments
        service_description             PING
        check_command                   check_ping!200.0,20%!600.0,60%
        }

In, hostgroup.cfg, I added the following entry

define hostgroup{
        hostgroup_name  CANTOMENTS
        alias           SITE-CANTOMENTS
        members         ap5.7 at cantoments,sm at cantoments,switch at cantoments
        }

So, what is the problem?



On Tue, Jan 20, 2009 at 10:38 AM, <asam30 at gmail.com> wrote:

> a sample host.cfg of my nagios server,
>
> define host{
>         host_name       airlin             ; The name we're giving to this
> host
>         alias           Airlin (TEST Server)     ; A longer name associated
> with the host
>         check_command   check-host-alive
>         check_interval  3
>         retry_interval  1
>         check_period    24x7
>         max_check_attempts      10
>         address         x.x.x.x                    ; IP address of the host
>         hostgroups      linux-servers           ; Host groups this host is
> associated with
>         contact_groups  admins
>         notification_interval   120
>         notifications_enabled   1
>         }
>
> service.cfg
>
> define service{
>         hostgroup_name                  linux-servers
>         host_name                        airlin,lnx-test1,lnx-test2
>         service_description             Root partition
>         is_volatile                     0
>         check_period                    24x7
>         check_interval                  3
>         retry_interval                  3
>         max_check_attempts              3
>         notification_interval           4
>         notification_period             24x7
>         notification_options            w,u,c,r
>         check_command                   check_nrpe!check_root
>         contact_groups                  admins
>         }
>
> check urs......
>
>
>
> On Tue, Jan 20, 2009 at 3:06 PM, Alex Dehaini <alexdehaini at gmail.com>wrote:
>
>> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg gives no
>> errors
>>
>> I added the host and services to the host.cfg and service.cfg files. I
>> added a group to the hostgroup file and added the hosts to the hostgroup
>> file. I reloaded nagios
>>
>> In the cgi view, I see the hostgroup but it says there are no host or
>> services added to it even after adding the host and service.
>>
>> Strange
>>
>>
>> On Tue, Jan 20, 2009 at 9:31 AM, <asam30 at gmail.com> wrote:
>>
>>> I do not understand your question properly.
>>>
>>> Do you have host.cfg and service.cfg files exists? and do you add hosts
>>> and services to these files respectively?
>>>
>>> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg gives
>>> any errors or warnings and also paste the exact error when restarting the
>>> nagios
>>>
>>>
>>> On Mon, Jan 19, 2009 at 5:55 PM, Alex Dehaini <alexdehaini at gmail.com>wrote:
>>>
>>>> Hi Guys,
>>>>
>>>> I just defined a hostgroup and added members to it. I have also added
>>>> each host and their services. I checked nagios for any errors and there are
>>>> none. When I restart nagios, I can see the hostgroup alright but there are
>>>> no host/services under it. I get this error
>>>>
>>>> SITE-CANTOMENTS <http://status.cgi?hostgroup=CANTOMENTS&style=overview>(
>>>> CANTOMENTS <http://extinfo.cgi?type=5&hostgroup=CANTOMENTS>)  No
>>>> matching hosts  No matching services
>>>> Any ideas?
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> This SF.net email is sponsored by:
>>>> SourcForge Community
>>>> SourceForge wants to tell your story.
>>>> http://p.sf.net/sfu/sf-spreadtheword
>>>> _______________________________________________
>>>> Nagios-users mailing list
>>>> Nagios-users at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/nagios-users
>>>> ::: Please include Nagios version, plugin version (-v) and OS when
>>>> reporting any issue.
>>>> ::: Messages without supporting info will risk being sent to /dev/null
>>>>
>>>
>>>
>>>
>>> --
>>> Shankar Asam
>>>
>>
>>
>>
>> --
>> Alex Dehaini
>> Developer
>> Site - www.alexdehaini.com
>> Email - alexdehaini at gmail.com
>>
>
>
>
> --
> Shankar Asam
>



-- 
Alex Dehaini
Developer
Site - www.alexdehaini.com
Email - alexdehaini at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090120/f59b6b96/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list