Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Using Monit to execute a script that changes DHCP Settings/Toggle Firewall Rules
« previous
next »
Print
Pages: [
1
]
Author
Topic: Using Monit to execute a script that changes DHCP Settings/Toggle Firewall Rules (Read 771 times)
nVIceman
Newbie
Posts: 23
Karma: 1
Using Monit to execute a script that changes DHCP Settings/Toggle Firewall Rules
«
on:
August 12, 2022, 07:40:56 pm »
Hi, I discovered that I'm pretty sure I can pull this off with Monit to do the monitoring, then have it execute a script, whether PHP or something else that can change the Global DHCP Server DNS settings and toggle some firewall rules.
What I am trying to do is when my local DNS server is down for whatever reason, OPNsense(Monit) can recognize it by pinging it and when it fails, execute the script that changes the 2 DNS servers which are both the local DNS server to force things through it only, plus toggle the firewall rule that also forces traffic through it, enable another firewall rule that forces traffic through what would Unbound DNS as the backup, since not all clients are going to pick up the newly assigned DHCP DNS Server right away, then once back up, everything reversed.
I'm stuck at not sure how to write that script, plus a bit unsure how it have it execute like that with Monit. It's a bit confusing to try to do more than simply email me when ping fails. Thanks.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Using Monit to execute a script that changes DHCP Settings/Toggle Firewall Rules