Gathering massive amounts of data with SNMP

Anton Berezin <tobez@tobez.org>

Sofia, August 2014

The task

Problem: scalability

Solution: multiplexing

Problem: real world

Solution: know your network

Problem: several pollers

All of a sudden, your knowledge of the network cannot be applied

Solution: a single poller

Enter SQE

snmp-query-engine

https://github.com/tobez/snmp-query-engine

Net::SNMP::QueryEngine::AnyEvent

Example

my $sqe = Net::SNMP::QueryEngine::AnyEvent->new;

for my $ip (@hosts) {
  $sqe->gettable($ip, 161, '1.3.6.1.2.1.31.1.1.1.6', # ifHCInOctets
    sub {
      my ($h, $ok, $r) = @_;
      for my $t (@$r) {
        # OID in $t->[0]
        # value in $t->[1]
      }
  });
}

$sqe->wait; # or do other AnyEvent stuff

Leaky abstraction

Tries to asbtract away a lot.

But you still have to know your network.

Lots of parameters that can be configured

The defaults are generally sensible.

Some parameters

Performance

   

Thank you! ☺