On Feb 17, 2009, at 10:26 AM, Tim Stoop wrote:
>
> Hi all,
>
> I talked a bit about this on IRC yesterday and James advised me to
> make a ticket and discuss it on the list. I''d like to make use of
the
> freshness of an exported resources record to see if it should be
> disabled or not. Mostly, I was hoping to do it in "The Puppet
Way",
> but I''m not really sure what that way is.
>
> My example is very simple, Nagios and Munin configs should be changed
> on the server if a machine has not updated its record for a time X.
> Although I can imagine not everyone wants to do this and there are
> resources which probably should not be removed, I''d like to start
with
> this.
>
> Ideally, there should be some way to tell a script (or maybe something
> in puppet itself?) what it should do if the record is stale for time
> X. In my example, the Nagios resource should get "ensure =>
absent",
> the Munin resource should be deleted flat out. Then after another
> certain amount of time passes, the Nagios resource should be deleted
> too.
>
> Now, I can script this, I guess, but I''d like to know if there are
any
> ideas on how to implement this form within Puppet? Or if there are any
> plans to do something with this data?
>
> I''m thinking about large server farms, where you don''t
want to remove
> every resource and host out of the database manually, because stuff
> can change quickly. It also allows for transparant addition of
> nagios_host resources and the like, which will also get remove when
> the machine is down for too long.
>
> Thoughts? Am I approaching this the wrong way? How would you solve it?
Interesting problem. I can''t think of any straightforward way to
solve this from within Puppet right now; you''re down to either
manually removing things from the database that have timed out, or
monkey-patching Puppet''s Rails queries to not return data past a
certain age.
It''d certainly be nice at some point to support age-based queries,
which isn''t a big stretch from where we are now. But the problem with
that, really, is that a resource is only updated when it actually
changes, so you might have a client still checking in but without
changing its configuration. So really, you need ''age'' to be
''age of
the whole catalog'', not just ''age of the matching
resource''. That
would require a significant join on every resource query.
So, I don''t have much of an answer right now. I''d probably go
with a
monkey-patch, or a straight patch, for now, and if you come up with
something better, let us know.
--
If you''re not part of the solution, you''re part of the
precipitate.
-- Henry J. Tillman
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---