Giter Site home page Giter Site logo

pfsense-status-gateways-json's Introduction

pfsense-status-gateways-json

Module retrieves pfSense 2.x Dashboard Gateway Status and Network Traffic Graphs data in JSON format.

"status" can be "force_down", "down", "loss" (for packet-loss warning), "delay" (for latency warning), or "okay" for online.

WARNING: This module bypasses the normal pfSense dashboard login, so it should be set with a different "key" of your choosing in the PHP code. The default is shown below:

http://pfSenseIP/status_gateways_json.php?key=pfsense

Since there is additional overhead to calculate data rates for each connection ("inKbps", "outKbps"), it can be optionally requested via an additional parameter as indicated below:

http://pfSenseIP/status_gateways_json.php?key=pfsense&rates=1

To install, simply change the "key" in the code below, then drop the status_gateways_json.php file into your pfSense "/usr/local/www" directory and you are set to go!

JSON output (&rates=1 version) should look something like this:

{
    "lan": {
        "inKbps": 188.36579043272,
        "outKbps": 2295.1290776905,
        "interface": "em0"
    },
    "wan": {
        "inKbps": 132.32223032712,
        "outKbps": 307.77712136859,
        "interface": "em1",
        "friendlyiface": "wan",
        "name": "GW_WAN",
        "status": "okay",
        "monitorip": "x.x.x.x",
        "sourceip": "x.x.x.x",
        "gatewayip": "x.x.x.x",
        "delay": "10.3ms",
        "loss": "0%"
    },
    "opt1": {
        "inKbps": 1690.5506271424,
        "outKbps": 197.42589503826,
        "interface": "em2",
        "friendlyiface": "opt1",
        "name": "GW_OPT1",
        "status": "okay",
        "monitorip": "x.x.x.x",
        "sourceip": "x.x.x.x",
        "gatewayip": "x.x.x.x",
        "delay": "25.5ms",
        "loss": "0%"
    }
}

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.