Sunday, June 26, 2016

Monitoring FAUCET with Grafana and InfluxDB

Instead of SNMP, FAUCET can push basic statistics - port input and output bytes and packets - to InfluxDB. You can then graph them using Grafana. In this post we will discuss how to set up FAUCET to do this.

snapshot11.png


  • We will indeed to install InfluxDB and Grafana on the same machine that runs FAUCET (it is possible to run them on different machines or across a network also, but this is the most simple configuration).
InfluxDB (https://docs.influxdata.com/influxdb/)
Grafana (http://docs.grafana.org/guides/gettingstarted/)
  • Create an InfluxDB database for FAUCET to populate:

$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.13.0
InfluxDB shell version: 0.13.0
> create database faucet
>

  • Now to configure FAUCET monitoring FAUCET has a separate script, gauge, that does monitoring (monitoring therefore is completely separate from switching). gauge uses FAUCET's config file, and one of its own, gauge.yaml:
faucet_configs:
    - '/etc/ryu/faucet/faucet.yaml'
watchers:
    port_stats_poller:
        type: 'port_stats'
        dps: ['windscale-faucet-1']
        interval: 10
        db: 'influx'
dbs:
    influx:
        type: 'influx'
        influx_db: 'faucet'
        influx_host: 'localhost'
        influx_port: 8086
        influx_user: 'faucet'
        influx_pwd: ''

        influx_timeout: 10

  • Next, you will need to configure the switch to connect to gauge. gauge is, from the switch's point of view, an additional OpenFlow controller, that only requests statistics via OpenFlow. Add the necessary configuration to the switch to connect to a port on the machine where gauge will run (Eg, 6634). 

  • Next, run gauge. Eg,

/usr/bin/python /usr/local/bin/ryu-manager --ofp-listen-host=[controller IP] --ofp-tcp-listen-port=6634 /home/faucet/faucet/src/ryu_faucet/org/onfsdn/faucet/gauge.py
  • You should now start to see gauge start to poll for statistics once the switch has connected. Check /var/log/faucet/gauge.log (default log location).
  • Now check that InfluxDB is receiving the data. 

$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.13.0
InfluxDB shell version: 0.13.0
> use faucet
Using database faucet
> show measurements
name: measurements
------------------
name
bytes_in
bytes_out
dropped_in
dropped_out
errors_in
packets_in
packets_out
port_state_reason
database
httpd
measurement
queryExecutor
runtime
shard
subscriber
tsm1_cache
tsm1_filestore
tsm1_wal
write
> show series
  • It should now be possible for you to graph FAUCET data from the Grafana UI.





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.