From 43e1aa5836da14b8fd473111ad48f7a69700ce7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jarle=20Bj=C3=B8rgeengen?= Date: Mon, 25 Aug 2008 22:30:27 +0200 Subject: [PATCH] Collectd::Unixsock: Allow passing of `Interval' to `PUTVAL'. --- bindings/perl/Collectd/Unixsock.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bindings/perl/Collectd/Unixsock.pm b/bindings/perl/Collectd/Unixsock.pm index 8749c1ab..71a6d094 100644 --- a/bindings/perl/Collectd/Unixsock.pm +++ b/bindings/perl/Collectd/Unixsock.pm @@ -236,6 +236,12 @@ sub putval 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'}) @@ -254,7 +260,7 @@ sub putval $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; -- 2.11.0