Inheritance doesn't seem to be working for config templates

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Inheritance doesn't seem to be working for config templa

Postby jlom » Mon Aug 13, 2018 5:49 pm

No, verified.

Code: Select all
grep -r  systems-host /etc/nagios/objects/
/etc/nagios/objects/unix.ctx.cfg: name systems-host
/etc/nagios/objects/unix.ctx.cfg: name systems-host-defaults
/etc/nagios/objects/unix.ctx.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
/etc/nagios/objects/hosts.cfg: use systems-host
jlom
 
Posts: 17
Joined: Mon Dec 04, 2017 4:49 pm

Re: Inheritance doesn't seem to be working for config templa

Postby scottwilkerson » Tue Aug 14, 2018 7:42 am

jlom wrote:Long story short, Here are some clips from my configs.

from nagios.cfg
cfg_file=/etc/nagios/objects/linux.ctx.cfg
cfg_file=/etc/nagios/objects/hosts.cfg
cfg_dir=/etc/nagios/objects/services

From hosts.cfg
Code: Select all
define host {
host_name testbox1
use systems-host
notification_interval 1440
contact_groups systems
notification_period critical
}



From linux.ctg.cfg
Code: Select all
define host {
name systems-host
notifications_enabled 1
flap_detection_enabled 1
#failure_prediction_enabled 1
retain_status_information 1
retain_nonstatus_information 1
max_check_attempts 2
check_interval 3
check_period critical
check_command check_local!ping!
register 0
}



Just re-read your first post and the filenames don't match, and are also different from what you found in your grep
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 13380
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Inheritance doesn't seem to be working for config templa

Postby jlom » Tue Aug 14, 2018 8:13 am

Yeah, That was a typo on the post, the filenames were the same...


I found the issue last night.

It seems nagios will not parse the templates if there are existing config issues. In this case it was the empty "contacts" field We used it as a place holder in nagios 3 but apparently being empty in nagios 4 is a nono.


I cleared out all of the contacts errors and then it parsed the cconfig files in their entirety so max_check_attempts would work.

SO, that's it for anyone who is having a similar issue just posting it up here.
jlom
 
Posts: 17
Joined: Mon Dec 04, 2017 4:49 pm

Re: Inheritance doesn't seem to be working for config templa

Postby scottwilkerson » Tue Aug 14, 2018 8:26 am

jlom wrote:Yeah, That was a typo on the post, the filenames were the same...


I found the issue last night.

It seems nagios will not parse the templates if there are existing config issues. In this case it was the empty "contacts" field We used it as a place holder in nagios 3 but apparently being empty in nagios 4 is a nono.


I cleared out all of the contacts errors and then it parsed the cconfig files in their entirety so max_check_attempts would work.

SO, that's it for anyone who is having a similar issue just posting it up here.


Thanks for coming back and sharing your resolution!

Locking thread
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 13380
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Previous

Return to Nagios Core

Who is online

Users browsing this forum: Majestic-12 [Bot] and 14 guests