GithubHelp home page GithubHelp logo

russellvt / graphite-pollers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phreakocious/graphite-pollers

0.0 2.0 0.0 220 KB

Collection of scripts that shovel data into graphite.

License: BSD 3-Clause "New" or "Revised" License

Ruby 100.00%

graphite-pollers's Introduction

graphite-pollers

Collection of scripts that shovel data into graphite. Throw into cron and go!

#####ifstats_to_graphite.rb - A multi-threaded SNMP poller for IF-MIB interface statistics

Requires the snmp gem, additional counters can be added with an easy edit

$ ./ifstats_to_graphite.rb
Usage: ./ifstats_to_graphite.rb -c COMMUNITY [-h HOST | -f FILE] [options]
    -c, --community COMMUNITY        SNMP community string for device(s)
    -h, --host HOST                  hostname or IP address of device to poll
    -f, --file FILE                  file containing a list of devices to poll
    -g, --graphite-host HOST         hostname or IP address of graphite host to send metrics to
    -l, --graphite-port PORT         graphite listening port (defaults to 2003)
    -x, --graphite-prefix PREFIX     prefix for metric names (defaults to ifstats)
    -p, --parallel THREADS           number of poller threads to run in parallel (defaults to 8)
    -n, --name NAME                  identifier for this poller (for multiple instances) (defaults to ifstats)
    -r, --retries RETRIES            number of retries after a timeout (defaults to 2)
    -t, --timeout TIMEOUT            number of seconds to wait for a response (defaults to 4)
    -m, --maxbulk VARBINDS           maximum varbinds per-host to request in bulk (defaults to 10)
    -b, --bulkwalk                   do bulk requests for SNMP (much more efficient) (defaults to true)
    -d, --debug                      debug mode prints results but sends no metrics to graphite

$ ./ifstats_to_graphite.rb -d myswitch.foo.com -c public -d
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InDiscards 0 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InErrors 168133 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InOctets 356574694339561 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InUcastPkts 508394924186 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InMulticastPkts 690766140 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.InBroadcastPkts 416882247 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.OutOctets 154749245976266 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.OutUcastPkts 560080764584 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.OutMulticastPkts 651102595 1443281354
ifstats.myswitch_foo_com.TenGigabitEthernet1-1.OutBroadcastPkts 701814 1443281354

#####procnet_to_graphite.rb - Extract valuable linux TCP/UDP netstat data from /proc/net/

Additional files and counters of interest can be added with a simple tweak to the file. Run this with a very short polling interval to catch some microbursts in action.

$ ./procnet_to_graphite.rb
Usage: ./procnet_to_graphite.rb [-g HOST | -d] [options]
    -g, --graphite-host HOST         hostname or IP address of graphite host to send metrics to
    -l, --graphite-port PORT         graphite listening port (defaults to 2003)
    -x, --graphite-prefix PREFIX     prefix for metric names (defaults to netstat)
    -d, --debug                      test mode prints results but sends no metrics to graphite
    -h, --help                       this help stuff

$ ./procnet_to_graphite.rb -d
netstat.mylinux_foo_com.Tcp.ActiveOpens 4127974 1443295704
netstat.mylinux_foo_com.Tcp.PassiveOpens 488481 1443295704
netstat.mylinux_foo_com.Tcp.AttemptFails 56140 1443295704
netstat.mylinux_foo_com.Tcp.EstabResets 156711 1443295704
netstat.mylinux_foo_com.Tcp.CurrEstab 121 1443295704
netstat.mylinux_foo_com.Tcp.RetransSegs 335093 1443295704
netstat.mylinux_foo_com.Tcp.OutRsts 185353 1443295704
netstat.mylinux_foo_com.TcpExt.TCPTimeWaitOverflow 0 1443295704

graphite-pollers's People

Contributors

phreakocious avatar russellvt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.