[collectd] perl plugin notifications

adnane mls at adnane.me
Mon Oct 6 16:47:34 CEST 2014


Hello,

I'am triying to use the notification mechanisme with the following perl 
plugin
#!/bin/perl
use strict;
use warnings;
use Collectd qw( :all );

#UTIL FUNCTION
# no warnings 'all';

# plugin name
my $CFG_plugin_name = "ming";

sub notif {
my $var = `cat /root/text.txt`;
chomp($var);
if ($var eq 'go'){
# my $time = time;
         my $v = {
                  severity => NOTIF_WARNING,
#                time     => $time,
                  message  => 'we have a go',
                  plugin   => $CFG_plugin_name,
                  type     => 'ming_status'
                 #  meta     =>
                 };
          plugin_dispatch_notification ($v);
         }

}

notif () ;

plugin_register(TYPE_NOTIF, $CFG_plugin_name, "notif");
1;

the issue si that when I start collectd I see in logs

[2014-10-06 16:43:16] Notification: severity = WARNING, plugin = ming, 
type = ming_status, message = we have a go
[2014-10-06 16:43:16] plugin_notification_meta_free: n == NULL!

and than it start flooding the logs with the warning

[2014-10-06 16:44:34] Notification: severity = WARNING, host = 
ming_machine, plugin = ming, type = ming_status, message = we have a go

every second until  collectd is killed by the kernel

why am 'i getting this behavior ?








More information about the collectd mailing list