[Nagiosplug-devel] State retention functionality
Andreas Ericsson
ae at op5.se
Thu Jun 17 12:02:55 CEST 2010
On 06/16/2010 07:16 PM, Holger Weiß wrote:
> * William Preston<nagiosplug-devel at spidalinx.co.uk> [2010-06-16 18:27]:
>> On Jun 16, 2010, at 5:29 PM, Ton Voon wrote:
>>> I have a need to enhance check_snmp to provide support for differences
>>> between counters and so I'm going to create some library functions for
>>> handling state between invocations of a plugin. I've been working with
>>> Holger on the design and we're happy with this:
>>> http://nagiosplugins.org/rfc/state_retention
>>>
>>> This is based on the email threads some time ago started by Alain.
>>> I've taken all the comments and tried to get something small and neat.
>>>
>>> Any comments welcome. I'm planning on starting to code this tomorrow.
>>
>> I realise I've come a bit late to the party here, but
>> have you considered memcached?
>>
>> It seems to me to be a tried and trusted mechanism that many
>> admins are already familiar with, is distributed, cached, scaleable etc.
>
> While I'm all for reusing code, memcached really solves a different
> problem. We just need a simple solution to store and retrieve trivial
> amounts of data in a specific way. Admins shouldn't be bothered with
> setting up and maintaining the storage at all. So a "distributed,
> cached, scaleable etc." client-server solution seems to be overkill to
> me.
>
>> And it should be less work to implement than building something new :-)
>
> In this case, I think the opposite is true.
>
Agreed. I've already implemented a state-retention thing for a latency
checking plugin. Feel free to reuse it if you like.
It's possibly overkill, but the library reading the state is very simple
and extremely well-tested, as it's the preferred libraryfor all our (my)
projects. It's not opaque, but that can be arranged if you like.
The attached plugin should provide sufficient documentation in the form
of examples.
Btw, I really like the idea of using a hash of the argument list to
provide the filename, but I'd use SHA1 if I were you. Not that speed
is really all that much of an issue, but there's a very portable, fast
and lightweight implementation of SHA1 in git, dubbed "block-sha1".
It's easy to extract from there and re-use in other places.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_latency.tar.gz
Type: application/x-gzip
Size: 6452 bytes
Desc: not available
URL: <http://nagios-plugins.org/archive/devel/attachments/20100617/f62cf411/attachment.bin>
More information about the Devel
mailing list