Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Detect gateway failure via API
« previous
next »
Print
Pages: [
1
]
Author
Topic: Detect gateway failure via API (Read 4069 times)
mimo
Newbie
Posts: 8
Karma: 0
Detect gateway failure via API
«
on:
December 05, 2016, 01:46:35 pm »
Is there some way to trigger a custom action when opnsense detects a gateway failure?
Following use case:
My backup internet connection is via LTE. I have a small data package with just some 100 MB as default and need to switch to a better one before connecting the whole network via this gateway.
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: Detect gateway failure via API
«
Reply #1 on:
December 05, 2016, 05:19:28 pm »
Hi mimo,
The apinger tool is capable running custom commands, but there is no proper GUI support for it. Some parts of the system use this in order to script the failover process.
However, zhe whole apinger/gateway monitoring should be reworked and pruned, something that is going to take a lot of time we do not have to dedicate resources to.
Any help here is appreciated. And pointers and question regarding code spots shall be happily answered in any case.
Cheers,
Franco
Logged
mimo
Newbie
Posts: 8
Karma: 0
Re: Detect gateway failure via API
«
Reply #2 on:
December 06, 2016, 05:20:32 pm »
Hi Franco,
Thanks for the hint to apinger. It is configured to execute a script called
configd_ctl.py
. Replacing the script with a custom one works fine.
I would prefer to place my custom script outside the opnsense internals, so I have to change the apinger config. Can you tell me where it is generated? Looks like it is overwritten automatically...
I'm afraid I currently don't have the time to rework the gateway monitoring, as that would require digging into the opnsense internals first...
Regards,
mimo
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Detect gateway failure via API