Page 1 of 1

Host template with default services

Posted: Tue Nov 23, 2021 7:06 am
by dex2ht
Hi, i have one question,
is it possible to add new host template with added some default services / commands etc?

For example when choosing a Windows server, it is already added there: CPU usage, C drive etc. I would like to create something similar but with my own name with my services added. As a DBA team, we have several services that query the mssql database and return / display the result in nagios. It would make the work much easier if adding a new server would consist only of providing the ip address and name.
Is it possible? If so, can you give me an example of how to do it?

Re: Host template with default services

Posted: Tue Nov 23, 2021 1:58 pm
by benjaminsmith
Hi,

You can easily create your own templates in the CCM for inheriting common settings or check commands. To learn how templates work, the Nagios Core documentation is a good place to start.

Object Inheritance With Templates]Object Inheritance With Templates

And page 4 of the following guide explains how to assign templates in the CCM.

https://assets.nagios.com/downloads/nag ... gement.pdf

Another option to consider is assigning services to common host groups. This can make it easier to manage your network services. We have a pro tip video on that technique which I would recommend watching. It's only a few minutes.

Master assign service checks by hostgroup
Pro Tip Video

Regards,
Benjamin

Re: Host template with default services

Posted: Wed Nov 24, 2021 5:48 am
by dex2ht
Hi i try in this way:

1 created service-template:
Template Name: DBA_CPU_TEST
Description: DBA_CPU_TEST
Display name: CPU_DBA
Check_command: check_xi_xervice_nsclient
$ARG1$
$ARG2$ CPULOAD
$ARG3$ -l 5,80,90

first try was add at service template > Manage Hostgroup > dbatest and from two hosts level configuration add those hosts to hostgroup
second try was add at service template > Manage Hosts > two hosts
But when i go to host services view i dont see CPU_DBA

Re: Host template with default services

Posted: Wed Nov 24, 2021 2:59 pm
by benjaminsmith
Hi,

Hopefully, I'm understanding the process you using but a template is essentially a partial configuration object so if you add the template to a host it will not create those services.

Try configuring a service and assigning it to a host group instead of a single host.

If you're not able to make it work, send over a system profile and I will test out your setup.

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button

Thanks,
Benjamin

Re: Host template with default services

Posted: Thu Nov 25, 2021 1:24 am
by dex2ht
Thank you, now it works :)

Re: Host template with default services

Posted: Mon Nov 29, 2021 10:21 am
by benjaminsmith
Hi,
Thank you, now it works :)
Excellent. We'll go ahead and close this out, but feel free to open another if you need assistance with anything else.

--Benjamin