The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Feature #1180

nagios types should be able to generate /template definitions/ in nagios

Added by ben potts about 8 years ago. Updated over 2 years ago.

Status:AcceptedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:nagios
Target version:-
Affected Puppet version:0.24.7 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-1097


Description

I’ve been building a Nagios configuration with the new built-in types and just noticed that there seems to be no way to create template definitions in Nagios. I’ve only tried to do (nagios) templates with the nagios_host and nagios_service types but it’s likely to affect some of the others, if not all of the nagios types.

heres an example:


    # template definition
    define host {
        name           generic-host
        contact_groups admins
    }
    # host definition that uses the template above
    define host {
        host_name    foo
        use          generic-host
    }

The problem with the nagios_host type is that the namevar is host_name and there’s no parameter called “name”

Same problem with nagios_server{}, except in that case the namevar is service_description.

In both cases, you need to leave the parameter that maps to the namevar out (which is impossible) and you need a parameter in the nagios config called ‘name’.

I don’t know how difficult this would be to implement but the ideal interface would be a template=>true parameter on the nagios types that changes service_description or host_name or whatever the namevar maps to to ‘name’.

History

#1 Updated by ben potts about 8 years ago

Replying to [comment:1 luke]:

I’m willing to accept this ticket, but I’m never going to do the work on my own unless someone pays me to.

Makes sense. I wasn’t really expecting this to get done, just thought I’d create the ticket other people can see it and work on it or whatever if they want.

There’s a number of workarounds, I’m pretty happy with wrapping the nagios types in defines

#2 Updated by Luke Kanies about 8 years ago

[edited by Luke]

An easy workaround is to put all of your template entries in a centralized file, and just dynamically generate the non-template entries.

#3 Updated by Redmine Admin almost 8 years ago

  • Status changed from 1 to Accepted

#4 Updated by Sven Mueller about 7 years ago

  • Affected Puppet version set to 0.24.7

Just for the record: Luke, can you tell me how much you would expect someone to pay for you to implement this? If you want, send it privately to puppet-enquiry@incase.de

#5 Updated by James Turnbull almost 7 years ago

  • Assignee deleted (Puppet Community)

#6 Updated by Christopher Weldon about 6 years ago

I see this hasn’t really been touched in almost a year. Are there any plans to implement this?

#7 Updated by Benjamin Kite about 6 years ago

This might be simpler than it looks — since the “register” parameter basically indicates whether a resource is supposed to be a nagios template or not.

Unless I’m leaving something out, the name of the object can toggle between “name” and “host_name” (in the case of host templates) based on the value of “register”.

#8 Updated by Tim Stoop about 6 years ago

Benjamin Kite wrote:

This might be simpler than it looks — since the “register” parameter basically indicates whether a resource is supposed to be a nagios template or not.

Unless I’m leaving something out, the name of the object can toggle between “name” and “host_name” (in the case of host templates) based on the value of “register”.

I’d agree with this assessment. It’s an easy and unambiguous solution, I believe. (I’m not a ruby nor puppet developer though, but I thought I’d chime in since I’m running into this problem right now.)

#9 Updated by James Turnbull over 4 years ago

  • Target version deleted (4)

#10 Updated by Jason Antman over 2 years ago

Redmine Issue #1180 has been migrated to JIRA:

https://tickets.puppetlabs.com/browse/PUP-1097

Also available in: Atom PDF