Page 1 of 1

yet anorther verification quesdtion(newb)

Posted: Fri Apr 19, 2013 12:11 pm
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 [email protected]
}


Thanks much..
Rich

Re: yet anorther verification quesdtion(newb)

Posted: Fri Apr 19, 2013 1:43 pm
by mguthrie
Is there anything else in that file, particularly at the top?

Otherwise, try adding a space after: define contact

Re: yet anorther verification quesdtion(newb)

Posted: Mon Apr 22, 2013 1:03 pm
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!

Re: yet anorther verification quesdtion(newb)

Posted: Mon Apr 22, 2013 1:46 pm
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?

Re: yet anorther verification quesdtion(newb)

Posted: Mon Apr 22, 2013 2:48 pm
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

Re: yet anorther verification quesdtion(newb)

Posted: Mon Apr 22, 2013 2:59 pm
by abrist
You will have to create a template for the host or instead use the generic one:

Code: Select all

use generic-host

Re: yet anorther verification quesdtion(newb)

Posted: Wed Apr 24, 2013 8:43 am
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

Re: yet anorther verification quesdtion(newb)

Posted: Wed Apr 24, 2013 9:52 am
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

Re: yet anorther verification quesdtion(newb)

Posted: Wed Apr 24, 2013 10:17 am
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

Re: yet anorther verification quesdtion(newb)

Posted: Wed Apr 24, 2013 12:12 pm
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.