FAQ
I am using stored configs to manage my nagios host and services checks and
I have run into a problem that I have been unable to solve. When the
stored configs are purged from puppet the nagios server correctly removes
them from the services and hosts file but does not notify the nagios
service and instead throws an error. So the entries are still there and
nagios still reports on them until it is restarted.

(/Nagios_service[check_ping_jasontest2.wishabi.net])
Whit[Completed_stage[main]],Whit[Completed_class[Nagios3_monitor]],Service[nagios3]
still depend on me -- not purging

The reason that I want this feature is that I have created several
automation scripts so I can start a service through AWS giving it two tags
a hostname and a puppetclass. So when I decommission a server the
puppetmaster recognizes this and does a puppet node clean $hostname which
in turn is picked up by nagios on its next run and purged.

This is the section of the nagios config that I am using to both populate
and purge the items from the nagios files.

# collect resources and populate /etc/nagios/nagios_*.cfg
Nagios_host <<||>> { notify => Service["nagios3"] }
Nagios_service <<||>> { notify => Service["nagios3"] }

resources { "nagios_service":
notify => Service["nagios3"]
purge => true,
}

resources { "nagios_host":
notify => Service["nagios3"]
purge => true,
}

I can just run a cronjob to restart the nagios service periodically but
that is a hacky way to do it and I would like to see if anyone has any
ideas.

Jason


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GW5zxJyl-yYJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Bruno Leon at Sep 11, 2012 at 2:46 am
    resources { "nagios_service":
    # notify => Service["nagios3"]
    purge => true,
    }

    resources { "nagios_host":
    # notify => Service["nagios3"]
    purge => true,
    }

    And make Nagios service subrscribe to the file /etc/nagios (cheksum => mtime)

    --
    Bruno

    On September 10, 2012 01:17:22 PM jlittle wrote:


    I am using stored configs to manage my nagios host and services checks and I
    have run into a problem that I have been unable to solve. When the stored
    configs are purged from puppet the nagios server correctly removes them from
    the services and hosts file but does not notify the nagios service and instead
    throws an error. So the entries are still there and nagios still reports on
    them until it is restarted.

    (/Nagios_service[check_ping_jasontest2.wishabi.net])
    Whit[Completed_stage[main]],Whit[Completed_class[Nagios3_monitor]],Service[nagios3]
    still depend on me -- not purging

    The reason that I want this feature is that I have created several automation
    scripts so I can start a service through AWS giving it two tags a hostname and
    a puppetclass. So when I decommission a server the puppetmaster recognizes
    this and does a puppet node clean $hostname which in turn is picked up by
    nagios on its next run and purged.

    This is the section of the nagios config that I am using to both populate and
    purge the items from the nagios files.

    # collect resources and populate /etc/nagios/nagios_*.cfg
    Nagios_host <<||>> { notify => Service["nagios3"] }
    Nagios_service <<||>> { notify => Service["nagios3"] }

    resources { "nagios_service":
    notify => Service["nagios3"]
    purge => true,
    }

    resources { "nagios_host":
    notify => Service["nagios3"]
    purge => true,
    }

    I can just run a cronjob to restart the nagios service periodically but that
    is a hacky way to do it and I would like to see if anyone has any ideas.

    Jason



    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/GW5zxJyl-yYJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-
    users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-
    users?hl=en.



    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Gabriel Filion at Sep 11, 2012 at 2:51 am

    On 12-09-10 10:46 PM, Bruno Leon wrote:
    resources { "nagios_service":
    # notify => Service["nagios3"]
    purge => true,
    }

    resources { "nagios_host":
    # notify => Service["nagios3"]
    purge => true,
    }



    And make Nagios service subrscribe to the file /etc/nagios (cheksum =>
    mtime)
    hum, was the purge functionality ever fixed for nagios types? I've
    wanted to use that for some time but fwir it was not implemented.

    --
    Gabriel Filion

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter Brown at Sep 11, 2012 at 3:32 am

    On 11 September 2012 12:51, Gabriel Filion wrote:
    On 12-09-10 10:46 PM, Bruno Leon wrote:
    resources { "nagios_service":
    # notify => Service["nagios3"]
    purge => true,
    }

    resources { "nagios_host":
    # notify => Service["nagios3"]
    purge => true,
    }



    And make Nagios service subrscribe to the file /etc/nagios (cheksum =>
    mtime)
    hum, was the purge functionality ever fixed for nagios types? I've
    wanted to use that for some time but fwir it was not implemented.
    Purge generally works if you don't change the target for any of the
    the nagios types and keep the names the same otherwise you will have
    issues.
    --
    Gabriel Filion

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Gabriel Filion at Sep 11, 2012 at 3:24 pm

    On 12-09-10 11:32 PM, Peter Brown wrote:
    hum, was the purge functionality ever fixed for nagios types? I've
    wanted to use that for some time but fwir it was not implemented.
    Purge generally works if you don't change the target for any of the
    the nagios types and keep the names the same otherwise you will have
    issues.
    ah, you're right the bug was with purge + changing target.
    (yes I do consider this as a bug even though in the code it says it's an
    architectural restriction -- but I won't bug puppetlabs with an issue
    about this since I can expect it to only get marked as "wontfix")

    --
    Gabriel Filion

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter Brown at Sep 12, 2012 at 12:08 am

    On 12 September 2012 01:24, Gabriel Filion wrote:
    On 12-09-10 11:32 PM, Peter Brown wrote:
    hum, was the purge functionality ever fixed for nagios types? I've
    wanted to use that for some time but fwir it was not implemented.
    Purge generally works if you don't change the target for any of the
    the nagios types and keep the names the same otherwise you will have
    issues.
    ah, you're right the bug was with purge + changing target.
    (yes I do consider this as a bug even though in the code it says it's an
    architectural restriction -- but I won't bug puppetlabs with an issue
    about this since I can expect it to only get marked as "wontfix")
    yeah especially since it's a known issue and listed in the documentation.

    --
    Gabriel Filion

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 10, '12 at 8:19p
activeSep 12, '12 at 12:08a
posts6
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase