OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: allebone on February 23, 2021, 09:54:24 pm

Title: Cant find plugin to monitor RAID1
Post by: allebone on February 23, 2021, 09:54:24 pm
Hi there,

I tried following instructions here:
https://forum.opnsense.org/index.php?topic=5076.0

But I get stuck, as I cannot locate the os-monit plugin to install. I can ssh into the server and type "gmirror status" but I would like to be able to add a widget to the dashboard that outputs the status of the mirror (healthy, degraded etc).

Is this possible?

Also as a side note, I recently migrated from a VM to physical OpnSense box and the backup that you take from the old opnsense and restore was not a perfect process, and I still had to setup a bit after (1 hour work) - eg: wireguard interface missing, vpn did not work as a result, plugins dont auto install, sensei needed setup again from scratch. The process could be improved as other enterprise firewalls I have used (sonicwall etc) the config was a perfect backup and restore process, no additional actions needed.

Pete
Title: Re: Cant find plugin to monitor RAID1
Post by: mimugmail on February 24, 2021, 06:07:05 am
Monit is already in core, just check Services
Title: Re: Cant find plugin to monitor RAID1
Post by: allebone on February 24, 2021, 09:40:37 pm
Thank you,

As you were correct all I had to do was add service:

Name: gmirror status
Type: Custom
Path: /sbin/gmirror status
Tests: NonZeroStatus

And it appears to be working :)
Title: Re: Cant find plugin to monitor RAID1
Post by: allebone on March 05, 2021, 05:09:50 am
update to this, I had an opportunity to test removing a disk and this is not enough to check the disk health.

I had to make script as per other instructions on the forum:

nano /usr/local/bin/check_gmirror.sh

Contents:

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



Then go to services, monit and service settings.
Add new service -
name: gmirror
type: custom
path: /usr/local/bin/check_gmirror.sh
Tests: NonZeroStatus

Then it works.
One irritating thing is it either says 'OK' when ok or if a problem then it simply displays nothing ie no "failed' or anything. So you either get an OK or a blank nothing in place of where the OK would display. Knowing that an empty field is the same as not working is fine, but it would be nice for it to say 'alert' or 'failed' or something.

Other than this, it is working.

Pete