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 - meisterj

#1
Hi,

same problem here, i need to define vednor class entrys (in my case for voip clients), but do not know where? Is there a way to modify (and keep Settings) in /var/dhcpd//etc/dhcpd.conf?
#2
Hi,

my first post in the OPNsense Forum, thank you for your solution with monit, this is exactly what i was looking for!
But im sorry to report that the script did not work as it should, maybe something changed in the gmirror status code in the past years?

In my lab (OPNsense 20.7.3) i was testing if it works in case the mirror fails (i just remove the second drive physical). The problem is, that the command "/sbin/gmirror status" always returns the exit code 0, maybe because the command "gmirror status" works and returns always a 0 ;-)

Working mirror:
# /sbin/gmirror status
           Name    Status  Components
mirror/OPNsense  COMPLETE  ada0 (ACTIVE)
                           ada1 (ACTIVE)
# echo $?
0


Degraded mirror:
# /sbin/gmirror status
           Name    Status  Components
mirror/OPNsense  DEGRADED  ada1 (ACTIVE)
                           ada0 (SYNCHRONIZING, 56%)
# echo $?
0


So i have modified the script to search if the output of "/sbin/gmirror status" contains "COMPLETE" , and only in this case it now returns exit 0, in all other cases it retuns exit 1.

modified /usr/local/bin/check_gmirror.sh

#!/bin/sh
ReturnString=$(/sbin/gmirror status)
echo $ReturnString
if echo $ReturnString | grep -q 'COMPLETE'; then
   exit 0
fi
exit 1


Short testing... it works for me  8)