• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

debian/H05-Apr-2011-10561

lib/AnyEvent/H05-Apr-2011-218107

script/H05-Apr-2011-4226

t/H05-Apr-2011-116

Build.PLH A D05-Apr-2011641 2421

ChangesH A D05-Apr-2011665 1917

MANIFESTH A D05-Apr-2011211 1514

META.ymlH A D05-Apr-2011664 2827

Makefile.PLH A D05-Apr-2011636 2018

READMEH A D05-Apr-20111.6 KiB4628

README

1NAME
2    AnyEvent::Graphite - Non-blocking Graphite (http://graphite.wikidot.com/) client
3
4SYNOPSIS
5    The 'Graphite' tool (http://graphite.wikidot.com) is a really useful way to collect time series information.
6
7    This module is a flexible, event-driven tool to help quickly 'bridge' Graphite with data sources that need polling (or want to asyncronously 'post' to Graphite.)
8
9    A quick example using the included ::SNMPAgent module:
10
11    I have a family of servers running SNMP. I want to collect load information from them.
12
13
14    use AnyEvent::Graphite::SNMPAgent;
15
16    my $agent = AnyEvent::Graphite::SNMPAgent->new(host => "graphite.mydomain.com", interval => 60);
17    my @hosts = get_interesting_hosts();
18
19    for my $host (@hosts) {
20        $agent->add_snmp(
21            oid => '.1.3.6.1.4.1.2021.10.1.5.1',
22            host => $host,
23            graphite_key => "servers.$host.load_1",
24            filter => sub { return $_[0] * 0.01 },
25        );
26    }
27
28    # run forever letting the event loop run
29    AnyEvent->condvar->recv;
30
31    Since that load_1 OID returns an integer load multiplied by 100 (i.e. load of 3.6 == 360), we need to be able to apply scaling functions.
32    That's what the 'filter' callback can do, but it's optional.
33
34    This should work for thousands of hosts and OID's, even if some of them are intermittently unresponsive.
35
36
37INSTALLATION
38
39Pretty standard:  perl Build.PL && ./Build && ./Build test && ./Build install
40
41COPYRIGHT AND LICENCE
42
43This program is free software; you can redistribute it and/or modify it
44under the same terms as Perl itself.
45
46