OPNSense/core ff91932src/etc/inc/plugins.inc.d dpinger.inc, src/opnsense/mvc/app/controllers/OPNsense/Routing/forms dialogEditGateway.xml

System: Gateways: Configuration - add "Kill states when down" option trigginer a gateway kill for all states with this gateway set, proposal for https://github.com/opnsense/core/issues/6803

* hide monitor options when disabled
* wire configd kill gateway command for 'pfctl -k gateway -k gwip'
* pass required properties in dpinger_status()
DeltaFile
+9-0src/opnsense/mvc/app/controllers/OPNsense/Routing/forms/dialogEditGateway.xml
+9-0src/opnsense/mvc/app/views/OPNsense/Routing/configuration.volt
+6-0src/opnsense/service/conf/actions.d/actions_filter.conf
+4-0src/opnsense/scripts/routes/gateway_watcher.php
+2-0src/etc/inc/plugins.inc.d/dpinger.inc
+1-0src/opnsense/mvc/app/models/OPNsense/Routing/Gateways.xml
+31-06 files

OPNSense/core 694ef3csrc/opnsense/scripts/routes gateway_watcher.php

system: dial this back, right intention wrong reason #8199

(cherry picked from commit 45be6d398143b487eae369480a1a3a7f745ca123)
DeltaFile
+10-4src/opnsense/scripts/routes/gateway_watcher.php
+10-41 files

OPNSense/core 567cc96. plist, src/etc rc.routing_configure

system: change the "monitor" syshook and de-deprecate; closes #8199

(cherry picked from commit af235daa4383657eb015e799fd8d927090809779)
(cherry picked from commit e28aa1ab0199b70478e2ae224b3c0d7ca513297f)
DeltaFile
+44-0src/etc/rc.syshook.d/monitor/20-recover
+4-20src/opnsense/scripts/routes/gateway_watcher.php
+5-13src/etc/rc.routing_configure
+0-3src/etc/rc.syshook.d/monitor/10-dpinger
+1-1plist
+54-375 files

OPNSense/core a554d13src/etc/inc/plugins.inc.d/openvpn wizard.inc, src/opnsense/mvc/app/views/OPNsense/Diagnostics health.volt

Merge branch 'master' into interface-bootgrid-partial
DeltaFile
+0-985src/etc/inc/plugins.inc.d/openvpn/wizard.inc
+0-956src/wizard/openvpn.xml
+170-597src/opnsense/mvc/app/views/OPNsense/Diagnostics/health.volt
+0-546src/www/services_dnsmasq.php
+97-200src/opnsense/mvc/app/views/OPNsense/Unbound/overrides.volt
+0-295src/www/services_dnsmasq_edit.php
+267-3,579108 files not shown
+2,231-4,930114 files

OPNSense/core 45be6d3src/opnsense/scripts/routes gateway_watcher.php

system: dial this back, right intention wrong reason #8199
DeltaFile
+10-4src/opnsense/scripts/routes/gateway_watcher.php
+10-41 files

OPNSense/core e28aa1asrc/etc/rc.syshook.d/monitor 20-recover, src/opnsense/scripts/routes gateway_watcher.php

system: oversighs in #8199
DeltaFile
+2-2src/opnsense/scripts/routes/gateway_watcher.php
+1-0src/etc/rc.syshook.d/monitor/20-recover
+3-22 files

OPNSense/core af235da. plist, src/etc rc.routing_configure

system: change the "monitor" syshook and de-deprecate; closese #8199

We move the gateway recovery into the hook as a user and users
can do their on similar scripts to fetch current status and
inspect and react accordingly.  We do so before filter reload
to avoid excessive reloads in the facility script(s).

What this loses is the ability to get the previous argments
for statistics, but OTOH it also reduces the risk for spurious
events as we only trigger on state transitions.
DeltaFile
+43-0src/etc/rc.syshook.d/monitor/20-recover
+5-21src/opnsense/scripts/routes/gateway_watcher.php
+5-13src/etc/rc.routing_configure
+0-3src/etc/rc.syshook.d/monitor/10-dpinger
+1-1plist
+54-385 files

OPNSense/core c2bcb3fsrc/etc/inc/plugins.inc.d wireguard.inc, src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api SystemhealthController.php

Merge remote-tracking branch 'origin/master' into gateways
DeltaFile
+33-490src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php
+136-232src/opnsense/mvc/app/views/OPNsense/Diagnostics/health.volt
+271-0src/opnsense/scripts/Wireguard/wg-service-control.php
+176-0src/etc/inc/plugins.inc.d/wireguard.inc
+173-0src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt
+32-131src/opnsense/scripts/interfaces/dhclient-script
+821-853142 files not shown
+4,432-1,449148 files

OPNSense/core 21f8366src/opnsense/scripts/routes gateway_watcher.php

system: keep polling if watcher cannot load a class

(cherry picked from commit 16ce982fa6a2de8af1eeceec0ba69424370ba442)
(cherry picked from commit edeff46f3fbfd6b067c65a66176db37e5b13c717)
DeltaFile
+7-1src/opnsense/scripts/routes/gateway_watcher.php
+7-11 files

OPNSense/core edeff46src/opnsense/scripts/routes gateway_watcher.php

system: ok it's an Error then
DeltaFile
+1-1src/opnsense/scripts/routes/gateway_watcher.php
+1-11 files

OPNSense/core 16ce982src/opnsense/scripts/routes gateway_watcher.php

system: keep polling if watcher cannot load a class

This happened two times now...

[09-Oct-2023 19:25:44 Europe/Berlin] PHP Fatal error:  Uncaught Error: Class "OPNsense\Base\ModelException" not found in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php:314
Stack trace:
  thrown in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php on line 314
DeltaFile
+7-1src/opnsense/scripts/routes/gateway_watcher.php
+7-11 files

OPNSense/core 3655218src/opnsense/mvc/app/models/OPNsense/Proxy Proxy.xml, src/opnsense/mvc/app/models/OPNsense/Unbound Unbound.xml

Merge branch 'master' into gateways

note: this commit also accomodates the changes made in
https://github.com/opnsense/core/commit/3786caf568a34083f6cefcb521caa45d321c57a0
DeltaFile
+1,417-941src/opnsense/www/js/bootstrap-select.js
+459-0src/opnsense/www/css/bootstrap-select.css
+0-403src/opnsense/www/css/bootstrap-select-1.13.3.css
+61-139src/opnsense/mvc/app/models/OPNsense/Unbound/Unbound.xml
+81-22src/sbin/pluginctl
+47-48src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml
+2,065-1,55376 files not shown
+2,606-2,17682 files

OPNSense/core ac0499fsrc/opnsense/scripts/OPNsense/Monit gateway_alert, src/opnsense/scripts/routes gateway_watcher.php gateway_status.php

system: avoid plugin system for native dpinger scripts fetching dpinger_status() #6825

(cherry picked from commit a2ab96833d9764e34384120d9fa597336da88c77)
(cherry picked from commit 31593b1e6fa71631ebce2cd2cda41ef0b4656c66)
DeltaFile
+6-10src/opnsense/scripts/routes/gateway_watcher.php
+5-4src/opnsense/scripts/OPNsense/Monit/gateway_alert
+2-1src/opnsense/scripts/routes/gateway_status.php
+13-153 files

OPNSense/core 31593b1src/opnsense/scripts/routes gateway_watcher.php

system: small refactor for clarity
DeltaFile
+4-9src/opnsense/scripts/routes/gateway_watcher.php
+4-91 files

OPNSense/core a2ab968src/opnsense/scripts/OPNsense/Monit gateway_alert, src/opnsense/scripts/routes gateway_status.php gateway_watcher.php

system: avoid plugin system for native dpinger scripts fetching dpinger_status() #6825
DeltaFile
+5-4src/opnsense/scripts/OPNsense/Monit/gateway_alert
+2-1src/opnsense/scripts/routes/gateway_status.php
+2-1src/opnsense/scripts/routes/gateway_watcher.php
+9-63 files

OPNSense/core 46c6cb3src/opnsense/scripts/routes gateway_watcher.php

system: handle force_down correctly in gateway watcher

It was raised on the forum that this is not seen and was likely ignored
by the old system in the past as well.

(cherry picked from commit 7f1d8c66d3a5c0f8ee34c82b7319e76ea5c0ebc4)
DeltaFile
+5-0src/opnsense/scripts/routes/gateway_watcher.php
+5-01 files

OPNSense/core fe7080d. Makefile, src/etc/inc/plugins.inc.d dpinger.inc

system: defer config reload to SIGHUP in gateway watcher

This should considerably lower CPU usage as reported a few times.
We do need to bring in pcntl PHP module in order to get that done
easily in the script.

PR: https://forum.opnsense.org/index.php?topic=35219.0

(cherry picked from commit b94097567cbb116025f54772609eef7b9a8e3f4e)
(cherry picked from commit 587a50cb7c8c04af71f36ccc74a1464383916607)
DeltaFile
+13-4src/opnsense/scripts/routes/gateway_watcher.php
+10-6src/etc/inc/plugins.inc.d/dpinger.inc
+2-1Makefile
+25-113 files

OPNSense/core b940975. Makefile, src/etc/inc/plugins.inc.d dpinger.inc

system: defer config reload to SIGHUP in gateway watcher

This should considerably lower CPU usage as reported a few times.
We do need to bring in pcntl PHP module in order to get that done
easily in the script.

PR: https://forum.opnsense.org/index.php?topic=35219.0
DeltaFile
+13-4src/opnsense/scripts/routes/gateway_watcher.php
+11-6src/etc/inc/plugins.inc.d/dpinger.inc
+2-1Makefile
+26-113 files

OPNSense/core 7f1d8c6src/opnsense/scripts/routes gateway_watcher.php

system: handle force_down correctly in gateway watcher

It was raised on the forum that this is not seen and was likely ignored
by the old system in the past as well.
DeltaFile
+5-0src/opnsense/scripts/routes/gateway_watcher.php
+5-01 files

OPNSense/core 1f161desrc/etc/inc/plugins.inc.d dpinger.inc, src/opnsense/scripts/routes gateway_status.php gateway_watcher.php

system: improve monitoring of down gateways #6728

(cherry picked from commit 15d993af50197f2ef6cc83636d286cc461e8275c)
(cherry picked from commit 26ddbd1e752a7e9666774a96e9898ffb6a891d2c)
(cherry picked from commit cf61c3d1e9ae789385c2bc6277905392f880eedf)
(cherry picked from commit 8967be64c5b698b17adc4958dd98ebb0c99003ab)
(cherry picked from commit 1e74ff3b3d5bc601df0cc0d365fb23081b15542b)
(cherry picked from commit 457f6bedf51d7c081d1e4812ce1b9ccc48befb9f)
(cherry picked from commit 4ecbd9240dd74c29e6b5f39228ffff946084db0f)
(cherry picked from commit 3844bc5014f6bb4d1035483a30834ed73f9f7e44)
(cherry picked from commit 77ac3f5c938e3000e92161fe48e737cf88a424c3)
(cherry picked from commit 93f8b70cbdbe1f42c856cd979ebfa9fffe26f14b)
(cherry picked from commit a7c1facc0926ce15b9c045e0bb0f3b0f94cfca12)
DeltaFile
+13-36src/etc/inc/plugins.inc.d/dpinger.inc
+5-2src/opnsense/scripts/routes/gateway_status.php
+2-2src/opnsense/scripts/routes/gateway_watcher.php
+20-403 files

OPNSense/core d1d255asrc/etc/inc/plugins.inc.d dpinger.inc, src/opnsense/scripts/routes gateway_status.php gateway_watcher.php

system: improve monitoring of down gateways #6728

(cherry picked from commit 15d993af50197f2ef6cc83636d286cc461e8275c)
(cherry picked from commit 26ddbd1e752a7e9666774a96e9898ffb6a891d2c)
(cherry picked from commit cf61c3d1e9ae789385c2bc6277905392f880eedf)
(cherry picked from commit 8967be64c5b698b17adc4958dd98ebb0c99003ab)
(cherry picked from commit 1e74ff3b3d5bc601df0cc0d365fb23081b15542b)
(cherry picked from commit 457f6bedf51d7c081d1e4812ce1b9ccc48befb9f)
(cherry picked from commit 4ecbd9240dd74c29e6b5f39228ffff946084db0f)
(cherry picked from commit 3844bc5014f6bb4d1035483a30834ed73f9f7e44)
(cherry picked from commit 77ac3f5c938e3000e92161fe48e737cf88a424c3)
(cherry picked from commit 93f8b70cbdbe1f42c856cd979ebfa9fffe26f14b)
DeltaFile
+13-36src/etc/inc/plugins.inc.d/dpinger.inc
+5-2src/opnsense/scripts/routes/gateway_status.php
+2-2src/opnsense/scripts/routes/gateway_watcher.php
+20-403 files

OPNSense/core 77ac3f5src/opnsense/scripts/routes gateway_watcher.php

system: assume first status as 'down' to get initial alert #6728

In some scenarios this is needed to recover the system correctly,
e.g. when the default gateway selected during boot is not actually
plugged in.
DeltaFile
+2-2src/opnsense/scripts/routes/gateway_watcher.php
+2-21 files

OPNSense/core f696930src/etc/rc.syshook.d/monitor 10-dpinger, src/opnsense/scripts/routes gateway_watcher.php

system: fix and adjust a couple of things for #6231

Do not "leak" state transitions and also always log them to the
gateway log if they aren't being pushed through the rc.syshook
alarm path.  While here consolidate the logging into the script
and make 10-dpinger script a stub for the "monitor" facility.
DeltaFile
+46-38src/opnsense/scripts/routes/gateway_watcher.php
+1-33src/etc/rc.syshook.d/monitor/10-dpinger
+47-712 files

OPNSense/core a2bc270. plist, src/etc/inc/plugins.inc.d dpinger.inc

system: move gateway monitor trigger to separate script #6231

1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
DeltaFile
+131-0src/opnsense/scripts/routes/gateway_watcher.php
+44-21src/etc/inc/plugins.inc.d/dpinger.inc
+8-2src/opnsense/service/conf/actions.d/actions_interface.conf
+1-6src/etc/rc.syshook.d/monitor/10-dpinger
+1-0plist
+185-295 files

OPNSense/core e1eb1aa. plist, src/etc/inc/plugins.inc.d dpinger.inc

system: move gateway monitor trigger to separate script #6231

1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
DeltaFile
+131-0src/opnsense/scripts/routes/gateway_watcher.php
+44-21src/etc/inc/plugins.inc.d/dpinger.inc
+8-2src/opnsense/service/conf/actions.d/actions_interface.conf
+1-6src/etc/rc.syshook.d/monitor/10-dpinger
+1-0plist
+185-295 files

OPNSense/core d0cb556. plist, src/etc/inc/plugins.inc.d dpinger.inc

system: move gateway monitor trigger to separate script #6231

1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
DeltaFile
+131-0src/opnsense/scripts/routes/gateway_watcher.php
+44-21src/etc/inc/plugins.inc.d/dpinger.inc
+8-2src/opnsense/service/conf/actions.d/actions_interface.conf
+1-6src/etc/rc.syshook.d/monitor/10-dpinger
+1-0plist
+185-295 files

OPNSense/core f68797e. plist, src/etc/inc/plugins.inc.d dpinger.inc

system: move gateway monitor trigger to separate script #6231

1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
DeltaFile
+130-0src/opnsense/scripts/routes/gateway_watcher.php
+45-21src/etc/inc/plugins.inc.d/dpinger.inc
+8-2src/opnsense/service/conf/actions.d/actions_interface.conf
+1-6src/etc/rc.syshook.d/monitor/10-dpinger
+1-0plist
+185-295 files