~ubuntu-branches/ubuntu/oneiric/collectd/oneiric

« back to all changes in this revision

Viewing changes to bindings/perl/Collectd/Unixsock.pm

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Harl
  • Date: 2008-06-17 10:35:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617103551-9d0ym3zejc7agtt3
Tags: 4.4.1-1
* New upstream release.
  - Fixed another issue of the sensors plugin affecting some chip types
    (Closes: #468143).
  - Fixed creation of "vserver" graphs in collection.cgi (Closes: #475120).
  - Fixed a segfault when using libperl 5.10.
  - collectd now ships libiptc itself.
  New plugins:
  - Ascent server statistics: ascent
  - IPMI sensors information: ipmi
  - PowerDNS name server statistics: powerdns
  - incremental parsing of logfiles: tail
  - TeamSpeak2 server statistics: teamspeak2
  - detailed virtual memory statistics: vmem
* Disable "tcpconns" plugin by default (Closes: #478759).
* Reenabled iptables plugin on all architectures (Closes: #473435).
  - Added the plugin to collectd.conf.
  - Added /usr/share/doc/collectd/examples/iptables/.
  - Added build dependency on linux-libc-dev (>= 2.6.25-4) - that version is
    required because of #479899.
* New debconf template translations:
  - gl.po, thanks to Jacobo Tarrio (Closes: #482667).
* Added a work around for #474087 (broken openipmi .pc files) by forcing the
  inclusion of the ipmi plugin and manually specifying the dependencies.
* Updated standards-version to 3.8.0 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
400
400
        return;
401
401
} # putnotif
402
402
 
 
403
=item I<$obj>-E<gt>B<flush> (B<timeout> =E<gt> I<$timeout>, B<plugins> =E<gt> [...]);
 
404
 
 
405
Flush cached data.
 
406
 
 
407
Valid options are:
 
408
 
 
409
=over 4
 
410
 
 
411
=item B<timeout>
 
412
 
 
413
If this option is specified, only data older than I<$timeout> seconds is
 
414
flushed.
 
415
 
 
416
=item B<plugins>
 
417
 
 
418
If this option is specified, only the selected plugins will be flushed. 
 
419
 
 
420
=back
 
421
 
 
422
=cut
 
423
 
 
424
sub flush
 
425
{
 
426
        my $obj  = shift;
 
427
        my %args = @_;
 
428
 
 
429
        my $fh = $obj->{'sock'} or confess;
 
430
 
 
431
        my $status = 0;
 
432
        my $msg    = "FLUSH";
 
433
 
 
434
        if ($args{'timeout'})
 
435
        {
 
436
                $msg .= " timeout=" . $args{'timeout'};
 
437
        }
 
438
 
 
439
        if ($args{'plugins'})
 
440
        {
 
441
                foreach my $plugin (@{$args{'plugins'}})
 
442
                {
 
443
                        $msg .= " plugin=" . $plugin;
 
444
                }
 
445
        }
 
446
 
 
447
        $msg .= "\n";
 
448
 
 
449
        send ($fh, $msg, 0) or confess ("send: $!");
 
450
        $msg = undef;
 
451
        recv ($fh, $msg, 1024, 0) or confess ("recv: $!");
 
452
 
 
453
        ($status, $msg) = split (' ', $msg, 2);
 
454
        return (1) if ($status == 0);
 
455
 
 
456
        $obj->{'error'} = $msg;
 
457
        return;
 
458
}
 
459
 
403
460
=item I<$obj>-E<gt>destroy ();
404
461
 
405
462
Closes the socket before the object is destroyed. This function is also