alexpmorris / pfsense-status-gateways-json Goto Github PK
View Code? Open in Web Editor NEWModule retrieves pfSense 2.x Dashboard Gateway Status and Network Traffic Graphs data in JSON format
License: MIT License
Module retrieves pfSense 2.x Dashboard Gateway Status and Network Traffic Graphs data in JSON format
License: MIT License
There is a substr()
at line 78 to cut off the first three characters of the interface name.
$iface = substr(strtolower($a_gateway['name']),3);
This results in two empty interfaces on our system.
Any reason to have this in the code, other then your personal needs? And if so, it would be nice if it was documented in the README.
Hi! Thank you for this little script.
I'm going to use it on my "MagicMirror" to display the current in/outgoing data rates on my "WAN" interface. However my "WAN" interface does not show up in the json array.
I looks like this (I removed the IP:s):
{
"lan": {
"inKbps":867.51528375484,
"outKbps":7658.2181335538
},
"wan_dhcp":{
"inKbps":0,
"outKbps":0,
"name":"wan_dhcp",
"status":"okay",
"monitorip":"XXX.XXX.XXX.XXX",
"sourceip":"XXX.XXX.XXX.XXX",
"delay":"64.972ms",
"loss":"4%"
}
}
Any idea whats going on? :)
Best regards Erik
Have you tried contributing this back to pfsense? I would find it really useful to have it as a default feature.
I think that only think it would be needed is a ticket on https://redmine.pfsense.org/issues and a PR on github referencing the bug.
Hi, I updated to latest version of pfSense 2.3.4-RELEASE (amd64)
Then I lost my "wan" interface in the JSON output.
If I print the "$a_gateways" I get this:
Array (
[VPN_VPNV4] => Array (
[interface] => bge1
[gateway] => dynamic
[name] => VPN_VPNV4
[weight] => 1
[ipprotocol] => inet
[interval] =>
[descr] => Interface VPN_VPNV4 Gateway
[dynamic] => 1
[monitor] => dynamic
[friendlyiface] => lan
[attribute] => 0
)
[WAN_DHCP] => Array (
[interface] => bge0
[gateway] => 81.233.82.1
[name] => WAN_DHCP
[weight] => 1
[ipprotocol] => inet
[interval] =>
[descr] => Interface WAN_DHCP Gateway
[defaultgw] => 1
[dynamic] => 1
[monitor] => 81.233.82.1
[friendlyiface] => wan
[attribute] => 1
)
)
But the JSON output is:
{"lan":{"inKbps":3864.2620418484,"outKbps":5268.2221868671,"interface":"bge1"}}
Not sure why this happens... Any ideas? :)
Best regards Snille
Can you clarify how one would use a different port and specify to use HTTPS? I have locked down my default installations of pfSense a bit.
Hi i got this error
"Fatal error: Cannot redeclare return_apinger_defaults() (previously declared in /etc/inc/gwlb.inc:37) in /etc/inc/gwlb.inc on line 43"
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.