Giter Site home page Giter Site logo

mustafamado / checksnmptraffic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clarkbox/checksnmptraffic

0.0 0.0 0.0 11 KB

stateful python script to track the total throughput of a network interface via SNMP

License: MIT License

Python 100.00%

checksnmptraffic's Introduction

check snmp traffic total

This is a nagios plugin (or standalone script) that will monitor the total traffic over an interface. Interface stats reset when a system reboots. To account for this, the script will record the interface traffic in a database, and sum between reboots. This should only be used as a guide, and may not be an accuate representation of actual traffic passing.

To use it as a stand alone as CLI tool, run the script with --help for the full list of options.

The script will exit code > 0 if the threshold of in/out is exceeded within the time period. A summary is also printed. This script does not need to be run via Nagios, and could be used stand alone, or invoked via cron.

This project was moved from google code (http://code.google.com/p/checksnmptraffic/).

##Help

#./check_snmp_traffic --help
usage: check_snmp_traffic [options]

options:
  -h, --help            show this help message and exit
  --host=HOST           host to check.
  --period=PERIOD       timeframe (in seconds) for traffic threshold to occur
                        within. eg 3600 to reset the counter every hour.
  --warnIn=WARNIN       incoming traffic MAX in Mb to cause return warn
  --warnOut=WARNOUT     outgoing traffic MAX in Mb to cause return warn
  --critIn=CRITIN       incoming traffuc MAX in Mb to cause return crit
  --critOut=CRITOUT     outgoing traffuc MAX in Mb to cause return crit
  --checkOnly           specify this option for read only access to database.
  --dir=DIR             directory to store persistance file. reccomend storing
                        in tmp. do not add trailing slash
  --community=COMMUNITY
                        SNMP Community. usually public.
  --currentLtLast=CURRENTLTLAST
                        warn or crit - if current traffic is less than last
                        recorded, usually indicates that host was reset.
  --emptyDb=EMPTYDB     warn or crit - if the database does not contain this
                        host. might indicate this server nagios runs on was
                        reset.
  --snmpCommand=SNMPCOMMAND
                        SNMP Command to use - snmpget or snmpwalk. snmpget by
                        default
  --snmpIn=SNMPIN       SNMP MIB for intrafce IN counter
  --snmpOut=SNMPOUT     SNMP MIB for intrafce OUT counter
  --if-number=IFNUMBER  the interface for the host. this is used only to
                        differentiate data between multiple interfaces on a
                        single host.

##Requirements: snmpwalk (yum install net-snmp-utils)

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.