yet anorther verification quesdtion(newb)

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
rgouette
Posts: 5
Joined: Fri Apr 19, 2013 11:20 am

yet anorther verification quesdtion(newb)

Post by rgouette »

Sorry lads, but so far I'm not seeing why I continue to get this after a vanilla system(Ubuntu 12..nothing else)


Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Error: Unexpected token or statement in file '/usr/local/nagios/etc/objects/contacts.cfg' on line 1.
Error processing object config files!



all I changed in that file is:

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user

email myEmailAddy@...com
}


Thanks much..
Rich
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: yet anorther verification quesdtion(newb)

Post by mguthrie »

Is there anything else in that file, particularly at the top?

Otherwise, try adding a space after: define contact
rgouette
Posts: 5
Joined: Fri Apr 19, 2013 11:20 am

Re: yet anorther verification quesdtion(newb)

Post by rgouette »

thanks for the reply, but I'm striking out:
here's the relevant section...any idears?

# Define a host for the local machine

define host{
use localhost ; Name of host template to use
host_name myHostName
alias localhost
address 127.0.0.1
}



Command output is:
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Error: Template 'localhost' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 25)
Error processing object config files!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: yet anorther verification quesdtion(newb)

Post by abrist »

rgouette wrote: Error: Template 'localhost' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 25)
Error processing object config files![/b][/i]
Well, you got farther this time. Have you defined a template with the name "localhost"? What does your hosttemplates.cfg look like?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rgouette
Posts: 5
Joined: Fri Apr 19, 2013 11:20 am

Re: yet anorther verification quesdtion(newb)

Post by rgouette »

Well, you got farther this time. Have you defined a template with the name "localhost"? What does your hosttemplates.cfg look like?
Have you defined a template with the name "localhost"? Nope!
What does your hosttemplates.cfg look like? I searched, and didn;t find onea them....


thanks for the help mate...
R
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: yet anorther verification quesdtion(newb)

Post by abrist »

You will have to create a template for the host or instead use the generic one:

Code: Select all

use generic-host
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
rgouette
Posts: 5
Joined: Fri Apr 19, 2013 11:20 am

Re: yet anorther verification quesdtion(newb)

Post by rgouette »

forgive the newbiness, but are you referring to:

localhost.cfg?

if so, it exists, but the hostname line is currently set to the machines hostname.
R
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: yet anorther verification quesdtion(newb)

Post by gshergill »

Hi rgouette,

There should be a .cfg file called templates.cfg.

There are predefined templates in here which make defining hosts in your main .cfg files a lot neater.

In your message earlier you posted the following:

Code: Select all

define host{
use localhost ; Name of host template to use
host_name myHostName
alias localhost
address 127.0.0.1
}
For a localhost, the standard definition is as follows:

Code: Select all

define host{
        use                     local-server            ; Name of host template to use. This host definition will inherit all variables that are defined in (or inherited by) the linux-server host template definition.
        host_name               localhost
        alias                   localhost                ; You can choose your own alias if you wish, such as the actual host name
        address                 127.0.0.1
        }
The section which says "use local-server" is referring to the template "local-server" found in templates.cfg.

Hope this clears things up a bit =)

Kind Regards,

Gary Shergill
rgouette
Posts: 5
Joined: Fri Apr 19, 2013 11:20 am

Re: yet anorther verification quesdtion(newb)

Post by rgouette »

ok...

Thanks so much for all your help fellas.

In my desparation, I deleted /etc/nagios then ran:

sudo apt-get install -y nagios3
than simply followed the instructions...
I'm now runnign Nagios...

:oops:

Rich
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: yet anorther verification quesdtion(newb)

Post by abrist »

Fair enough. I will lock this thread. If you have new issues, just open a new thread and we will help you there.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked