Page 1 of 1

Windows.cfg - Cannot Register Host

Posted: Tue Apr 12, 2016 7:07 am
by Bone8Head
Hello,

I think that I kinda f**ked up when I tried to add my first Hostgroup on windows.cfg.
Before, I added a Host with the normal Services and it was okay.
Now, I tried to rename the default Hostgroup "windows-server" and obviously the "use windows-servers" in the line of the Host, but now the System told me:

Code: Select all

Error: Template 'vmware-server-160' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 39)
   Error processing object config files!
The line 39 of the File is:

Code: Select all

          39         define host{
          40         use                  vmware-server-160
          41         host_name       Z - 215 - FINANCE-UPD   ; The name we're giving to this host
          42         alias                Z - 215 - FINANCE-UPD   ; A longer name associated with the host
          43         address            192.168.50.215             ; IP address of the host
          44         }
The hostgroup that I edited:

Code: Select all

     23         define hostgroup{
     24         hostgroup_name  vmware-server-160             ; The name of the hostgroup
     25         alias                   vmware-server-160             ; Long name of the group
     26         }
Any advice? Thank you.

Re: Windows.cfg - Cannot Register Host

Posted: Tue Apr 12, 2016 7:16 am
by rhassing
Did you rename the files as well?
Then they might not be loaded.

Re: Windows.cfg - Cannot Register Host

Posted: Tue Apr 12, 2016 7:34 am
by Bone8Head
rhassing wrote:Did you rename the files as well?
Then they might not be loaded.
The file is still windows.cfg ...I didn't rename it

Re: Windows.cfg - Cannot Register Host

Posted: Tue Apr 12, 2016 1:52 pm
by jolson

Code: Select all

 use                  vmware-server-160
The 'use' definition is used to define a template as indicated by this error:

Code: Select all

Template 'vmware-server-160' specified in host definition could not be not found
To attach the host to a hostgroup, make use of the following definition:

Code: Select all

hostgroups	hostgroup_names
https://assets.nagios.com/downloads/nag ... tions.html

Re: Windows.cfg - Cannot Register Host

Posted: Wed Apr 13, 2016 7:16 am
by Bone8Head
You was right, thank you both for the answers.
You can close the thread.

Re: Windows.cfg - Cannot Register Host

Posted: Wed Apr 13, 2016 10:43 am
by rkennedy
Sounds good, marking this as resolved and closing it out.