Page 1 of 1

_xiwizard working method

Posted: Thu Jan 18, 2018 3:07 am
by junkertf
Hello,

I have created a service template as the following:

define service {
name BB_NIX_LINUX_NTPd_service
hostgroup_name HG_NIX_LINUX_TEST
service_description NTPd Sync State
use xiwizard_generic_service
check_command check_ntp_time!0.15!0.5!!!!!!
max_check_attempts 2
check_interval 3
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options c,u,r,f,s,
contact_groups CG_NIX
_xiwizard linux_server
register 0

}

My question is:
- if i create a new linux_server host object with xiwizard, then the upper mentioned service template will initialized on the newly created host or not?

Currently i experience, that the mentioned template not initialized on a newly created host, but why?



Thank you, regards,

Ferenc

Re: _xiwizard working method

Posted: Thu Jan 18, 2018 5:05 pm
by npolovenko
Hello, @junkertf. Are using a Linux Server Wizard to add hosts? Can you go to the Core Configurations Manager, then go to services and click on any service that got created after you ran the wizard. What do you see under "manage templates"? Also, how do you initialize a service template with newly created services? And what makes you believe that it's not working?

Re: _xiwizard working method

Posted: Fri Jan 19, 2018 3:28 am
by junkertf
Hello,

Yes, i had used the linux-server wizard to add a host and its services, and a finished it a before created global template.
The Template contains the Hostgroup "CG_NIX".

After that if i check the newly created host services at CCM shows "xiwizard_nrpe_service" exclude ping whats point to "xiwizard_linuxserver_ping_service".

The newly created service templates config shows at Manage templates "xiwizard_generic_service" and also contain at Manage HostGroups "CG_NIX" as well at Misc Settings -> Manage free variables -> _xiwizard linux_server (dont ask, where i found that)

I thought that so way, if i create a new host in the "CG_NIX" group, then the service template will come up as a service as well.
So i had not created a new service on the newly added host, because the template settings.
Where that above written solution fail?

I tried to found any detailed documentation about the service definition _xiwizard parameter, but not found any...

Thank you for help, best regards,

Ferenc

Re: _xiwizard working method

Posted: Fri Jan 19, 2018 3:34 pm
by lmiltchev
You cannot apply a service template to a host... You can only apply host templates to hosts, and service templates to services.

You could create a service that uses this particular service template, that add this service to a hostgroup. After this is done, this service will be added automatically to all new hosts that you add as members of your hostgroup.

The "_xiwizard linux_server" is a free variable, showing what wizard you used when creating the particular host/service. It is strictly a XI thing. The "use" directive is a lot more important. For more information on templating and object inheritance, please read our official Nagios Core documentation on the topic here:

https://assets.nagios.com/downloads/nag ... tance.html

Re: _xiwizard working method

Posted: Wed Jan 31, 2018 8:20 am
by junkertf
Hello,

Sorry for the late answer.
So way you adviced i foud a working solution.
The thread can be closed.

Best regards,
Ferenc

Re: _xiwizard working method

Posted: Wed Jan 31, 2018 12:27 pm
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!