Puppet: System Administration Automated

Support

Ticket #1180 (new enhancement)

Opened 5 months ago

Last modified 5 months ago

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

Reported by: benp Assigned to: community
Priority: lowest Milestone: unplanned
Component: nagios Version: 0.24.4
Severity: minor Keywords: naginator,nagios,types
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

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'.

Change History

(follow-up: ↓ 2 ) 04/10/08 22:31:11 changed by luke

  • priority changed from normal to lowest.
  • stage changed from Unreviewed to Accepted.
  • severity changed from normal to minor.
  • milestone set to unplanned.

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

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

(in reply to: ↑ 1 ) 04/11/08 00:01:32 changed by benp

Replying to 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

04/24/08 08:14:41 changed by luke

  • component changed from library to nagios.