src/*.lo
src/*.o
src/collectd
+src/collectd-nagios
+src/collectdmon
src/collectd*.1
src/collectd*.5
src/types.db.5
src/liboconfig/parser.h
src/liboconfig/scanner.c
+# perl stuff:
+bindings/.perl-directory-stamp
+bindings/perl/Collectd/pm_to_blib
+bindings/perl/blib/
+bindings/perl/pm_to_blib
+
# make dist stuff:
collectd-*.tar.gz
collectd-*.tar.bz2
my $msg;
my $identifier;
my $values;
+ my $interval = "";
+
+ if (defined $args{'interval'})
+ {
+ $interval = ' interval=' . $args{'interval'};
+ }
$identifier = _create_identifier (\%args) or return;
if (!$args{'values'})
$values = join (':', $time, map { defined ($_) ? $_ : 'U' } (@{$args{'values'}}));
}
- $msg = "PUTVAL $identifier $values\n";
+ $msg = "PUTVAL $identifier$interval $values\n";
#print "-> $msg";
send ($fh, $msg, 0) or confess ("send: $!");
$msg = undef;
}
@oids = split (/"\s*"/, $conf->{'values'});
- if (($conf->{'table'} =~ m/^(true|yes|on)$/i) && ($conf->{'instance'}))
+ if ($conf->{'table'} =~ m/^(true|yes|on)$/i)
{
$cmd = 'GETNEXT';
- push (@oids, $conf->{'instance'});
+ if (defined ($conf->{'instance'}))
+ {
+ push (@oids, $conf->{'instance'});
+ }
}
require Data::Dumper;
{
return;
}
+ if (!defined ($status))
+ {
+ return;
+ }
+ if ("$status" eq 'NOSUCHOBJECT')
+ {
+ return;
+ }
}
else
{
$version--;
} # while ($version > 0)
- if (!@valid_data)
- {
- return;
- }
-
print <<EOF;
<Host "$host">
Address "$address"
{
print " Collect \"$_\"\n";
}
+ if (!@valid_data)
+ {
+ print <<EOF;
+# WARNING: Autoconfiguration failed.
+# TODO: Add one or more `Collect' statements here:
+# Collect "foo"
+EOF
+ }
print <<EOF;
Interval 60
</Host>
p.events = POLLIN | POLLERR | POLLHUP;
p.revents = 0;
- status = poll (&p, /* nfds = */ 1, /* timeout = */ interval_g);
+ status = poll (&p, /* nfds = */ 1, /* timeout = */ 1000 * interval_g);
if (status <= 0)
{
if (status == 0)
{
int i = 0;
- dTHX;
-
- /* dTHX does not get any valid values in case Perl
- * has not been initialized */
- if (NULL == perl_threads)
- aTHX = NULL;
+ dTHXa (NULL);
for (i = 0; i < ci->children_num; ++i) {
oconfig_item_t *c = ci->children + i;
+ if (NULL != perl_threads)
+ aTHX = PERL_GET_CONTEXT;
+
if (0 == strcasecmp (c->key, "LoadPlugin"))
perl_config_loadplugin (aTHX_ c);
else if (0 == strcasecmp (c->key, "BaseName"))