Page 1 of 1
Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 1:59 pm
by rbuckle
Good morning,
My network has a lot of pieces of the same equipment, with the same services, same brand etc....
It is possible to create a host template with services, example would be a switch, to add a new switch to nagios of the same make/model you would just have to select the "HOST Template" and it would already create/have the services template for what you want monitored.
I would then be able to create 1 template for 300 or so devices that can be edited/updated/added to without having to create the host and then 10 services for EACH ONE.
If more clarification of what i am asking is need, just let me know.
Re: Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 2:43 pm
by dwhitfield
Yes, under the CCM, on the left panel, under templates, you will see Host Templates and Service Templates.
More info at
https://assets.nagios.com/downloads/nag ... gement.pdf
If that's not what you want, please describe what you want in more detail.
Re: Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 4:20 pm
by gormank
I use hostgroups to do exactly what you ask. I also use host and service templates to keep monitoring info out of host and service definitions. Hostgroups are attached to services, and when a host is added to a hostgroup, the host monitoring is already configured.
Re: Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 4:23 pm
by dwhitfield
For clarity, the document I provided above also discusses hostgroups.
Re: Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 5:43 pm
by rbuckle
what i am asking is, is it possible to have 1 "group" of services for a device type.... then i could:
Template
{SERVICE GROUP} == RSSI,BANDWIDTH,STATUS,PING
Host Association
{HOST} + {SERVICE GROUP}
and nagios will automatically create a host with the listed services
Host - RSSI
- BANDWIDTH
- STATUS
- PING
Re: Nagios Host/Service Templates
Posted: Wed Feb 22, 2017 11:02 pm
by gormank
Nagios creates no hosts automagically. You can do it in puppet for example.
Can you provide the config/files where said syntax is defined?
While the logic is somewhat different, what you ask for is provided by hostgroups.
Re: Nagios Host/Service Templates
Posted: Thu Feb 23, 2017 11:01 am
by mcapra
As
@gormank pointed out, what you are trying to do is possible with host groups.
Say I have the following devices with common services:
- LAMP application servers
- MEAN application servers
- Cisco SG300 Switches
- Common SNMP bandwidth checks for bandwidth
- An OID for a super secret Cisco metric
- Temperature, system metrics, etc
- Windows Servers
- C: Drive Check
- CPU/MEM checks
- IIS Application Pool Checks
If I wanted to save myself the time of hand-configuring the following checks on all my Windows machines:
- C: Drive Check
- CPU/MEM checks
- IIS Application Pool Checks
The simplest way to achieve this would be to lump all my Windows Servers into a dedicated host group (say windows-servers) and then, rather than assigning the individual service checks to specific hosts, I would assign them to my fancy newq windows-servers host group I just made. From the Core Config Manager:
2017_02_23_09_59_49_CCM_Nagios_XI.png
2017_02_23_10_00_48_CCM_Nagios_XI.png
Now, whenever I add a host to my windows-servers hostgroup, it will inherit the "Drive C: Disk Usage" service definition I made.
Re: Nagios Host/Service Templates
Posted: Thu Feb 23, 2017 11:33 am
by rbuckle
So I have created a group for SNMP checks for a wireless radio... I have tried assigning services/service templates to the group but when i add a host to the group it does nothing but group the hosts together.
I seem to still have to manually create each service again and associate it with the new host.
Re: Nagios Host/Service Templates
Posted: Thu Feb 23, 2017 11:54 am
by rbuckle
OK, I found your guys video on inheritance and hostgroups... I think that i have it working now
Thank you
You may close the ticket