Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Query status of gateways via API
« previous
next »
Print
Pages: [
1
]
Author
Topic: Query status of gateways via API (Read 3624 times)
Hüpf3R
Newbie
Posts: 5
Karma: 0
Query status of gateways via API
«
on:
April 06, 2020, 04:40:17 pm »
Hello,
Is it possible to query the status of the gateways via the API? I have 3 gateways and would like to use the API to query which is online and which is offline. I would also like to be able to manually mark a gateway as offline.
Can anyone help me?
Thanks in advance.
Logged
matthewsdi
Newbie
Posts: 7
Karma: 1
Re: Query status of gateways via API
«
Reply #1 on:
August 14, 2020, 10:55:54 pm »
I know this is not helpful, but I have the same request. I looked through the api docs and can't find it anywhere. I'm assuming you can't. I am trying to solve my other problem, documented here
https://forum.opnsense.org/index.php?topic=16460.msg74953#msg74953
, by writing a script that queries the gateway status and tells opnsenes/frr to stop advertising a default route if the gateway is down. I have multiple opnsense boxes at my edges and I want them to stop advertising to ospf that they can get to the internet if they actually can't. None of the options in the GUI accomplish this so I want to orchestrate it via api or cli, but I have yet to find a way to programatticaly get the gateway status that is so nicely displayed right on the dashboard.
Logged
matthewsdi
Newbie
Posts: 7
Karma: 1
Re: Query status of gateways via API
«
Reply #2 on:
August 15, 2020, 09:14:36 pm »
I've added a feature request
https://github.com/opnsense/core/issues/4261
, and Ad Schellevis also gave me the cli equivalent if that helps you in the comments there.
Code:
[Select]
pluginctl -r return_gateways_status
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Query status of gateways via API