node_exporter gives you the total amount of traffic passed in and out by 
each network interface.

There's no out-of-the-box "top IP address" exporter that I know of, and 
it's probably not a good idea anyway as it could generate extremely high 
cardinality of timeseries. Even if it's only the top 10 peer addresses, 
that could change on every scrape.

However, I did once make an experimental netflow exporter using pmacct.  
I've just posted the bits here:

nfacctd.conf 
<https://gist.github.com/candlerb/e229cd1453ae842ac319d6a332091faf>  
(update this to include your own private and public IP address ranges)
pmacct.py 
<https://gist.github.com/candlerb/4b06ad735e396f9cc0867c8549327865>

I ran pmacct.py under exporter_exporter 
<https://github.com/QubitProducts/exporter_exporter>:

modules:
  pmacct:
    method: exec
    timeout: 5s
    exec:
      command: /usr/local/bin/pmacct.py

although you could just run it from cron, and write out a file for 
node_exporter textfile collector.

This takes netflow data from your border router (say), and aggregates it by 
local IP address, so you can see which of your own devices is sending or 
receiving the most traffic.  As the number of local IP addresses in your 
network is bounded, the cardinality is bounded.  Hence with this 
configuration it will only tell you which devices are the top-talkers on 
your network, not what they're actually talking to, but you can draw graphs 
of the traffic sent and received per device.

However, if you have node_exporter running on every server, then you'll 
already have information about how much traffic is being sent or received 
by each server.  The intention of this pmacct configuration was for 
monitoring traffic generated by *client* devices like laptops, where 
there's no exporter running.

If you wanted to hack this, you could use pmacctd instead of nfacctd to 
monitor the traffic going through an interface on a single server; and you 
could change the aggregation to show remote addresses (although as I said 
before, I think it's a bad idea).

IMO, logging systems provide a better long-term solution.  Packetbeat, 
logstash (elastiflow), telegraf/influxdb, and others all have ways to 
analyse flows either going through an interface or received as Netflow 
packets.

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/beb895ad-ddfd-4347-9de0-9f6f8cafb4c3o%40googlegroups.com.

Reply via email to