Could not register host (config file '/etc/nagios3/objects/

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sentinelace
Posts: 5
Joined: Thu Apr 07, 2011 8:57 am

Could not register host (config file '/etc/nagios3/objects/

Post by sentinelace »

I have had huge issues getting this running. My end goal is to get emails and intergrate this with spiceworks. All I want is an email when one of these devices go down or is rebooted.

I have nagios installed with the plugins.

When I try and restart, I get this error " Could not register host (config file '/etc/nagios3/objects/switch.cfg'"

I think my main problem is I can't figure out on how to get any of these CFG files to work and how they are set up. Here is my switch.cfg

Code: Select all

define host{

        host_name       AP89            ; The name we're giving to this switch

        alias           Cisco Access Point      ; A longer name associated with the switch

        address         192.168.1.89            ; IP address of the switch

        hostgroups      Switches                        ; Host groups this switch is associated with

        }

define service{

                ; Inherit values from a template

        host_name               AP89    ; The name of the host the service is associated with

        service_description     PING            ; The service description

        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service

        normal_check_interval   5       ; Check the service every 5 minutes under normal conditions

        retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined

        }

I am stuck at this point. Love to get this working.
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Could not register host (config file '/etc/nagios3/objec

Post by tonyyarusso »

  1. Does the hostgroup "Switches" exist?
  2. Does using the built-in verification functionality (nagios -v) give any more useful output?
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
sentinelace
Posts: 5
Joined: Thu Apr 07, 2011 8:57 am

Re: Could not register host (config file '/etc/nagios3/objec

Post by sentinelace »

I can't get nagios to start because of this error. the switches.cfg exists if that is what you mean. Where are the hostgroups defined?
sentinelace
Posts: 5
Joined: Thu Apr 07, 2011 8:57 am

Re: Could not register host (config file '/etc/nagios3/objec

Post by sentinelace »

yes it is there.

I got further by changing the cfg to this:

Code: Select all

define host{
name NGConv-89
host_name NGConv-89
check_period 24Ã
max_check_attempts 10
check_command check-host-alive
notification_period workhours
notification_interval 120
notification_options d,u,r
contact_groups admins
register 0
use NGConv-89
alias NGConv-89
address 192.168.1.89
}

define service{
use generic-service
host_name NGConv-89
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
But then I get

Code: Select all

Error: Host 'NGConv-89' specified in service 'PING' not defined anywhere!
        Checked 7 services.
Where do I define the services?
sentinelace
Posts: 5
Joined: Thu Apr 07, 2011 8:57 am

Re: Could not register host (config file '/etc/nagios3/objec

Post by sentinelace »

Okay, I finally got it all working. My cfg files weren't setup properly. I see my hosts now, but I don't get emails when I reboot one of the hosts. I see it red and down but no email. Now what?
Locked