项目作者: hoentschrode

项目描述 :
Icinga/Nagios plugin to check bandwidth between devolo DLAN stations
高级语言: Python
项目地址: git://github.com/hoentschrode/check_dlan_bandwidth.git
创建时间: 2017-08-31T18:36:56Z
项目社区:https://github.com/hoentschrode/check_dlan_bandwidth

开源协议:GNU General Public License v3.0

下载


Nagios/Icinga plugin to check bandwidth on devolo’s DLAN powerlan adapters

This plugin checks the bandwidth on Devolo(tm) dlan powerlan adapters.

It’s my first Nagios/Icinga plugin :)

The plugin uses the build in web interface of the adapters to query the data. To get the bandwidth being used just query the first adapter by it’s ip address. The adapter delivers a list of remote stations (identified by their mac address) with current used bandwidths (sending and receiving directions).

Therefore it’s necessary to provide a host ip and a remote mac.

I have 6 devices (5 dlan “500 Wifi” and one “duo+”) in my house. All of them are connected through the central “dlan 500 duo+” to my router. The latter doesn’t have a web interface, but a mac address, which can be queried as remote station (see parameter -r).

Installation

Since this script is written in Python (currently only compatible to 2.7!), it can easily be installed using pip:

  1. pip install check_dlan_bandwidth

This installs the check script, all dependent libs and creates an executable, usually under /usr/local/bin.

Usage

On my raspberry pi the script is installed under /usr/local/lib/python2.7/dist-packages/check_dlan_bandwidth/check_dlan_bandwidth.py and a command line version is created in /usr/local/bin/check_dlan_bandwidth.

  1. check_dlan_bandwidth.py [-h] -H HOST -r REMOTE_MAC -u USER -p PASSWORD

Command line arguments

  1. -h, --help show this help message and exit
  2. -H HOST, --host HOST Hostname
  3. -r REMOTE_MAC, --remote-mac REMOTE_MAC
  4. MAC address of remote station
  5. -u USER, --user USER Username (same as used for web interface)
  6. -p PASSWORD, --password PASSWORD
  7. Password (same as used for web interface)

Configuration

To use this check script one should create a custom command in icinga’s commands.conf:

  1. object CheckCommand "check_dlan_bandwidth" {
  2. command = ["/usr/local/bin/check_dlan_bandwidth"]
  3. arguments = {
  4. "-H" = "$address$"
  5. "-r" = "11:22:33:44:55:66"
  6. "-u" = "admin"
  7. "-p" = "my_secret_password"
  8. }
  9. }

.. then make a custom service in services.conf which automatically applies to all dlan devices:

  1. apply Service "DlanBandwidth" {
  2. import "generic-service"
  3. check_command = "check_dlan_bandwidth"
  4. assign where "DLAN-devices" in host.groups
  5. }

Note: I’ve created the hostgroup “DLAN-devices” which contains all my dlan adapters in grouops.conf:

  1. object HostGroup "DLAN-devices" {
  2. display_name = "DLAN devices"
  3. assign where "Devolo DLAN500 Wifi" in host.templates
  4. }