Hello,
I have 20+ hosts, with more to come, that I'd like to start off with a host template. These hosts run the same service checks, ~18 checks, but they need to have different thresholds per host. I've configured the check commands to use custom values set in Free Variable Definitions for their threshold settings, and they work as I need. What I need now is to populate these Check/Alert/Free Variable Definitions to newly created hosts.
I've created a Host template with the check command, alert settings, and Free Variable Definitions that I'd like propagated across these new hosts. My problem is that I'm unable to see any of these settings in a newly created host. Either the template is not applied, or I don't know where to look.
Procedure:
1. Go to CCM
2. Go to Hosts
3. Go to "Add New"
4. Populate "Host Name" and "Address"
5. Go to "Manage Templates"
6. Assign my custom template. There are no other templates assigned at this point.
7. Click "Close" to continue
8. Click "Save"
9. Open the host from CCM->Hosts->Newly Created Host
10. Check Command, Check Settings, Alert Settings, and Free Variable Definitions are the same as if I'd chosen a default template.
I also tried assigning the template to the Host Groups that these host will be a part of, but I was left with the same default settings.
Current Setup:
CentOS5-32 Bit running under Hyper-V
Nagios 2012R2.7
Any assistance you can provide would be appreciated!
Host Template doesn't apply, or I can't see the changes
Re: Host Template doesn't apply, or I can't see the changes
Go to the CCM->Hosts, click on the "View Text Config" actions button next to the host you just created (the diskette icon), and show us the config. Do the same thing with the template that you applied to this host (CCM->Host Templates-><your custom template>->View Text Config).
Be sure to check out our Knowledgebase for helpful articles and solutions!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Host Template doesn't apply, or I can't see the changes
Can you post the host template and the test host configs. For each of them click the disk icon which opens a new web page with text configs.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Host Template doesn't apply, or I can't see the changes
This is the host file, I do see the template listed in it.
This is the Host template. It shouldn't matter, but not all of the variables have been populated yet. I wasn't going to finish that step until I can get a few to apply correctly.
This is what the GUI shows.
Code: Select all
###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-12-12 10:04:30
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define host {
host_name AAA-Test
use HT - Hub-WorkBench-Repository
alias AAA-Test
display_name AAA-Test
address minion
register 1
}
###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
Code: Select all
define host {
name HT - Hub-WorkBench-Repository
alias Host template for a Hub/WorkBench/Repository.
check_command check_tcp!5666!!!!!!!
initial_state u
max_check_attempts 5
check_interval 5
retry_interval 2
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
check_freshness 1
freshness_threshold 3600
retain_status_information 1
retain_nonstatus_information 1
contact_groups IT_Operations
notification_period 24x7
notifications_enabled 1
__RABBITMQ_WORKBENCH_ENDPOINT_CRITICAL 1000
__RABBITMQ_WORKBENCH_ENDPOINT_WARN 100
__RABBITMQ_WORKBENCH_ERROR_CRITICAL 100
__RABBITMQ_WORKBENCH_ERROR_WARN 10
__WORKBENCH_PORTAL_METADATA_URL https://CHANGEME.DOMAIN.com/DIRECTORY/PAGE
register 0
}You do not have the required permissions to view the files attached to this post.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Host Template doesn't apply, or I can't see the changes
Just for future reference, you will not see the inherited settings from a template on your main object, however, if you were to go look at the host/service check from one of the home > details pages, you should see that it is abiding by the template's rules. It would be nice to have a way to reliably show inherited configurations, without making it appear as if it is not already defined on the main object.
Re: Host Template doesn't apply, or I can't see the changes
I was afraid that was the answer... So is there any way at all to see the Variable Definitions in the host? They will need to be customized per host, and right now the entire section is as blank as the above screen shot shows. Failing all of this, is there any other way to have host specific variables where I can define a default value and change it as needed?
Re: Host Template doesn't apply, or I can't see the changes
You can always look in the objects.cache file:
Or check the free variables with the json api:
http://<ip>/nagios/jsonquery.html
Code: Select all
/usr/local/nagios/var/objects.cachehttp://<ip>/nagios/jsonquery.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.