Windows.cfg - Cannot Register Host

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
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Windows.cfg - Cannot Register Host

Post 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.
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Windows.cfg - Cannot Register Host

Post by rhassing »

Did you rename the files as well?
Then they might not be loaded.
Rob Hassing
Image
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Windows.cfg - Cannot Register Host

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Windows.cfg - Cannot Register Host

Post 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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Windows.cfg - Cannot Register Host

Post by Bone8Head »

You was right, thank you both for the answers.
You can close the thread.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Windows.cfg - Cannot Register Host

Post by rkennedy »

Sounds good, marking this as resolved and closing it out.
Former Nagios Employee
Locked