[collectd] perl notification plug-in

Martin Janota janota.m at cce.cz
Thu Oct 30 13:55:43 CET 2008


Thank you for your answer, my notification-perl-plugin is working fine now.

During my experiment with the colelectd, I faced difficulties with a filecount 
plug-in. When I had configured more than 4 directories, collectd didn't 
started and finished with error

"*** glibc detected *** ./collectd: realloc(): invalid next size: ...."

This is a problem with an allocating memory for array directories using 
realloc on the row 373 in filecount.c 
I fixed this problem by allocating array directories to 50 records, but this 
isn't so smart solution.

Reagards, Martin

Dne Monday 13 October 2008 17:43:52 Sebastian Harl napsal(a):
> Hi Martin,
>
> On Mon, Oct 13, 2008 at 02:59:04PM +0200, Martin Janota wrote:
> > I am trying to set up collectd for monitoring of networked computers. I
> > have created an exec plug-in for management of notifications, it works
> > fine. However, I would also like my plug-in to utilise same options as
> > perl-plugin so that it behaves as perl-plug-in. I could not however find
> > how to receive notifications if it is at all possible.
>
> This is possible starting with version 4.3.0 of collectd.
>
> To receive notifications, you need to register a "notification callback"
> with collectd. This is done using the plugin_register() function. The
> daemon then calls the registered callback (a Perl subroutine) whenever a
> notification has been dispatched. The notification (represented as a
> reference to a Perl hash) will be passed as the only argument to the
> callback. See the collectd-perl(5) manpage for details.
>
> An example can be found in contrib/examples/MyPlugin.pm in the collectd
> source distribution [1]. The relevant parts for handling notifications
> are the call to plugin_register(TYPE_NOTIF, ...) on line 42 and the
> subroutine called "my_notify" starting on line 136.
>
> If you have any suggestions (or even better: patches) how to improve the
> documentation (i.e. the collectd-perl(5) manpage), please let us know.
>
> HTH,
> Sebastian
>
> [1]
> http://git.verplant.org/?p=collectd.git;a=blob;f=contrib/examples/MyPlugin.
>pm





More information about the collectd mailing list