Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Monju0525

#1
26.7 Series / 26.7 dash board services GUI
August 13, 2026, 06:15:25 PM
The dashboard services has improved dramatically. The only change I would suggest changing the green connectivity state to a green pearl shape.
Squares are not commonly used for an UP state.  Also make the re-start  an non green color.

 
#2
Thanks. It is working with a dynamic pool outside of the staticic leases.
#3
26.7.1 opnsense, kea static leases ie reservation no longer working despite having the correct MAC address. Not sure why.  It worked months ago when I migrated from isc to kea.
#4
In a dark theme mode, the widget's background banner should not be a glaring block of green or red but a dark grey with the widget's label color controlled by the os-theme plugin. The connection state are the colored 'meatballs'. The previous 26.1 had a better looking display despite being a one large vertical block of widgets.
#5
I would like the service widget state to look like the Wireguard connection  red for down and green for up.
#6
Updated with a green color for a wg0 connection


#nano /usr/local/opnsense/scripts/wireguard/wg0_monit_start.sh
#!/usr/local/bin/bash


# Test the wg0 connection state and if no packets are received ( a match )
# then wg0 needs to be restarted with exit 0
# which uses ZeroStatus test to re-start wg0

#==

# pulls the vpn end-tunnel address from wg0.conf
# ip_addr=$(grep -E '^\s*#?\s*Address'  /usr/local/etc/wireguard/wg0.conf \
# | awk -F'[ /]+' '{print $4}')

# colors
BOLD_RED='\033[1;31m'
BOLD_GREEN='\033[1;32m'
NC='\033[0m' # No Color (resets formatting)


# wg interface
iface="wg0"
# time and date stamp
ts=$(date +"%Y-%m-%d %H:%M:%S")


# pulls the vpn end-tunnel address from ifconfig wg0
ip_addr=$(ifconfig $iface | awk '/inet / {print $2}')


# test wg0 rx_packets received in column 5 or fields[4]
read -ra fields <<< "$(netstat -i | grep -E "\s${iface}\s")"
#echo "rx_packets= ${fields[4]}"


# 071826
# check for non-empty string and a zero packet size
# add echo protection
[[ -n "${fields[4]}" && "${fields[4]}" -eq 0 ]] \
&& { echo  "$_wg0 !connected $ts"; exit 0; } \
|| { echo -e "_wg0 connected to $BOLD_GREEN$ip_addr $ts$NC"; exit 1; }


#==



# equals a '0'  -> match -> exit 0 -> re-starts wg0
# not equal condition  ->   no match -> do not restart wg0

# Verification
# netstat -i | grep wg0
# wg0      1420 <Link#9>          wg0                                  0    0    0    4528    0    0
# wg0          - xxx.xxx.xxx.xxx/32   xxx.xxx.xxx.xxx                        0    -    -    -


# Program 'wg0_monit_start'
# Status                      OK
# monitoring status            Monitored
# monitoring mode              active
# on reboot                    start
# last exit value              1
# last output                  _wg0 connected to xxx.xxx.xxx.xxx 2026-07-09 07:55:54
#7
Uncommented the url line in  *.conf and I was able to update to 1.18. Thanks
#8
26.7 Series / Suggestions for GUI state display
July 15, 2026, 05:21:58 PM
At work, our GUIs have a state displayed using 'meatballs' red, yellow, and green states.
In 26.7, the widgets u a large background banner. Suggestions for a change.

#9
Re-installed opnsense under 26.1 with working AdGuard, commented out the url line in /usr/local/etc/pkg/repos/mimugmail-single.conf and then updated opnsense to 26.7

Observed in plugin that AdGuard was orphaned but everything worked.

Thank u.
#10
Gotcha guilty as charged.
#11
Patrick, can u walk me through the process. I usually ssh, fetch, plug-in install, services , AdGuard enable?
How do I disable the repository?
I also deleted AdGuard from the opnsense plug-in and did a fetch again. Now AdGuard in plugins.

Thanks


#12
Migrated from 26.1.11  and AdGuard is not seen in the community plugins.

Do not upgrade if u need AdGuard and NextDNS.
#13
Cleaned up  #2.

nano /usr/local/opnsense/scripts/wireguard/wg0_monit_start.sh

#!/bin/bash

# Test the wg0 connection state and if no packets are received ( a match )
# then wg0 needs to be restarted with exit 0
# which uses ZeroStatus test to re-start wg0

#==
# pulls vpn end-tunnel address from ifconfig wg0
ip_addr=$(ifconfig wg0 | awk '/inet / {print $2}')


read -ra fields <<< "$(netstat -i | grep -E '\swg0\s')"
#echo "rx_packets= ${fields[4]}"

# Test wg0 column 5 or fields[4]
# add echo protection 070726

[[ -n "${fields[4]}" && "${fields[4]}" -eq 0 ]] \
&& { echo "_wg0 !connected $(date +"%Y-%m-%d %H:%M:%S")"; exit 0; } \
|| { echo "_wg0 connected to $ip_addr $(date +"%Y-%m-%d %H:%M:%S")"; exit 1; }

#==

# equals a '0'  -> match -> exit 0 -> re-starts wg0
# not equal condition  ->   no match -> do not restart wg0

# Verification
# netstat -i | grep wg0
# wg0      1420 <Link#9>          wg0                                  0    0    0    4528    0    0
# wg0          - xxx.xxx.xxx.xxx/32   xxx.xxx.xxx.xxx                        0    -    -    -


Program 'wg0_monit_start'
  status                      OK
  monitoring status            Monitored
  monitoring mode              active
  on reboot                    start
  last exit value              1
  last output                  _wg0 connected to xxx.xxx.xxx.xxx 2026-07-09 07:55:54
  data collected              Thu, 09 Jul 2026 07:57:54
#14
I wrote a monit script that uses wg0_monit_start.sh to automatically restart wg0 by monitoring netstat -i | grep wg0. It will take 2-3 minutes.

The new monit status is updated periodically.

https://forum.opnsense.org/index.php?topic=52172.0
#15
Updated the script with an alternatuve method
====
#!/bin/bash
#Alternative
shopt -s extglob

# Test the wg0 connection state using monit ZeroStatus test
# RC =1 is the connection state which defaults the wg0 as being connected -> exit 1
# reports as 'status =1'

RC=1

# If no wg0 packets are received, it needs to be restarted with RC =0 -> exit 0
# Important: need to report 'status =0' to the opnsense monit ZeroStatus test
# which will re-start the wg0 connection

# in-line command
#[[ $(netstat -i | grep -F -- "          0     - " | grep "100.80.224.xxx"  | wc -l) -eq "1" ]] \
#&& RC=0 && echo "!connected"   $(date +"%Y-%m-%d %H:%M:%S") && exit $RC \
#|| echo "connected"  $(date +"%Y-%m-%d %H:%M:%S") && exit $RC


RC=`netstat -i | grep -F -- "          0     - " | grep "100.80.224.xxx" | wc -l`
#echo $RC
[$RC -eq  1 ] && RC="0" || RC="1"

case $RC in
0) printf "wg0 !connected  $(date +"%Y-%m-%d %H:%M:%S") \n" && exit 0;;
1) printf "wg0  connected  $(date +"%Y-%m-%d %H:%M:%S") \n" && exit 1;;
*) printf "Issue with wg0_monit_start.sh \n";;
esac



====