OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: cpw on February 18, 2020, 09:21:18 PM

Title: API for gateway status and pinger data
Post by: cpw on February 18, 2020, 09:21:18 PM
Hi
So, I'm trying to enhance my netdata+prometheus and home-assistant installation to show status of outbound connections to upstream as well as maybe dpinger ping data.

I've been poking at the web console, and it seems the exact dataset I need is available from

/widgets/api/get.php?load=gateway

Sadly, that is not invokeable as a "machine to machine" request - it sends a redirect to a login page when run from curl, which is quite disappointing.

I've looked through the code at opnsense/core and I can't see any way to get that information from an API otherwise.

Is there perhaps a way to call this API without being in an existing browser context?

Thanks
Title: Re: API for gateway status and pinger data
Post by: matthewsdi on August 15, 2020, 09:15:06 PM
I've added a feature request https://github.com/opnsense/core/issues/4261 (https://github.com/opnsense/core/issues/4261), and Ad Schellevis also gave me the cli equivalent if that helps you in the comments there.

pluginctl -r return_gateways_status