Giter VIP home page Giter VIP logo

check_tr64_fritz's Introduction

check_tr64_fritz

check_tr64_fritz

This is a Check Plugin for Icinga 2 to monitor a Fritz!Box

Requirements

You need the following packages installed to use this check Plugin

  • curl
  • bc

Please use your favorite package manager to install them.

Installation

  1. Clone this Repository to an empty folder
  2. Execute the getSecurityPort script, to find out your TR-064 SSL Port
  3. Copy the check_tr64_fritz script to your Icinga 2 Check Plugin Directory
  4. Add the CheckCommand definition to your Icinga 2 configuration. See the Icinga 2 documentation for more details
  5. Create a new service in Icinga 2 for your Fritz!Box

CheckCommand

object CheckCommand "check_tr64_fritz" {
  command = [ PluginDir + "/check_tr64_fritz" ]

  arguments = {
    "-h" = "$fritz_host$"
    "-p" = "$fritz_port$"
    "-u" = "$fritz_username$"
    "-P" = "$fritz_password$"
    "-f" = "$fritz_function$"
    "-w" = "$fritz_warning$"
    "-c" = "$fritz_critical$"
  }

  vars.fritz_host = "$address$"
  vars.fritz_port = "49443"
  vars.fritz_username = "dslf-config"
  vars.fritz_function = "status"
}

Usage

getSecurityPort

getSecurityPort <HOST>

  <HOST> = IP-Adress of your Fritz!Box

The returned value is your SSL port for the TR-064 protocol of your Fritz!Box

check_tr64_fritz

usage: check_tr64_fritz -h <HOSTNAME> -p <PORT> -u <USERNAME> -P <PASSWORD> -f <FUNCTION> -w <WARNING> -c <CRITICAL>

  -h: IP-Adress or hostname from the Fritz!Box
      default = fritz.box

  -p: SSL-Port from the Fritz!Box
      default = 49443

  -u: Login Username for the Fritz!Box
      default = dslf-config

  -P: Login Password for the Fritz!Box

  -f: Function to check
      default = status

  -w: value where the warning state come into effect
      default = -1 / returns every time an OK state

  -c: value where the critical state come into effect
      default = -1 / return every time an OK state

Functions:

  status = Connection Status

  linkuptime = WAN link uptime

  uptime = device uptime

  downstream = useable downstream rate
               output in Mbit/s

  upstream = useable upstream rate
             output in Mbit/s

  downstreamrate = current downstream rate
                   output in Mbit/s

  upstreamrate = current upstream rate
                 output in Mbit/s

  update = get the update state

DEBUG:

  -d: prints debug information

The username and password are the same as for the Web-Interface of your Fritz!Box. If you don't use the login method with username and password you can leave the username empty.

Security

Since there are credentials transmitted over the network, this script use SSL to communicate with the Fritz!Box. Therefore you need to find out your SSL port for the TR-064 protocol of your Fritz!Box. For finding out the port you can use the getSecurityPort script.

Make sure you are hiding password variables in Icinga Web 2.

  1. Log In to your Icinga Web 2
  2. Go to Configuration -> Modules -> monitoring -> Security
  3. Make sure your custom password variable is protected (defaults are *pw*,*pass*,community). If you named your custom variable frtiz_password it will be protected by the default entry *pass*.
  4. Double check it, go to one of your Fritz!Box service an check if the password is display with ***.

Authors

Thanks to all contributors!

Thanks

check_tr64_fritz's People

Contributors

benschweizer avatar mcktr 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.