OPNsense Forum

English Forums => General Discussion => Topic started by: wefinet on April 27, 2017, 01:55:43 pm

Title: [SOLVED] Query status of GEOM Mirror (gmirror) RAID1
Post by: wefinet on April 27, 2017, 01:55:43 pm
Hi all,

first of all thank you for providing OPNsense :-)
I've installed OPNsense 17.1.4-amd64 on a server with two SATA SSDs, and I have set up a GEOM Mirror during installation. I have used the target "mirror/OPNSenseMirror" as you can see in this screenshot:
https://www.thomas-krenn.com/de/wikiDE/images/9/9b/OPNsense-Installation-GEOM-07-Select-a-Disk.png

I'm now looking for a way to monitor the status of the gmirror, and I have searched in the web interface for such an option (but I did not find a site or widget for that). I only found this https://github.com/mibuthu/opnsense-core/blob/master/src/sbin/gmirror_status_check.php on a GitHub fork.
In pfSense, there are options to monitor the status: https://www.thomas-krenn.com/de/wiki/PfSense_Software_RAID_1#.C3.9Cberwachung

My questions:

Thank you & best regards,
Werner
Title: Re: Query status of GEOM Mirror (gmirror) RAID1
Post by: bartjsmit on April 27, 2017, 02:31:03 pm
There is a dashboard widget for disk status. You need to install the os-smart plugin to use it

Bart...
Title: Re: Query status of GEOM Mirror (gmirror) RAID1
Post by: wefinet on April 27, 2017, 03:40:03 pm
Thank you for the hint how to monitor the SMART status of the disks.

I've installed the plugin and added the widget.

Although this shows me the SMART status of the two disks, it does not show the the status of the GEOM mirror (gmirror) which should be "COMPLETE" like it is shown by pfSense here: https://www.thomas-krenn.com/de/wikiDE/images/3/30/PfSense-GEOM-02-Diagnostics-GEOM-Mirrors.png

Any other ideas if there is a way to monitor the gmirror state?

Otherwise I think a new plugin should be implemented for that. So if there are no other ideas, I'll open a GitHub issue here https://github.com/opnsense/plugins (they state: "Now we need your help to enrich the plugins. Feel free to contact us at project AT opnsense DOT org or open GitHub issue to get in touch.")
Title: Re: Query status of GEOM Mirror (gmirror) RAID1
Post by: faunsen on May 02, 2017, 10:17:45 am
Hi Werner,

you can do that with the new os-monit plugin and a little script.
The plugin is available since 17.1.5. It's a monitoring software that can execute scripts and generate alarms according to the return value.

Create a script e.g. /usr/local/bin/check_gmirror.sh and make it executable.

Code: [Select]
#!/bin/sh
ReturnString=$(/sbin/gmirror status)
ReturnStatus=$?
echo $ReturnString
if [ $ReturnStatus -ne 0 ]; then
   exit 1
fi
exit 0

Then create a Monit Service Test (Services -> Monit -> Settings -> Service Tests Settings)
Code: [Select]
Name: ExitStatus
Condition: status notequal 0
Action: Alert

and a Service Setting
Code: [Select]
Name: GMirrorTest
Type: Custom
Path: /usr/local/bin/check_gmirror.sh
Tests: ExecStatus

You can see the output of the script at the Monit status page.


Regards
Frank
Title: Re: Query status of GEOM Mirror (gmirror) RAID1
Post by: franco on May 03, 2017, 06:23:33 am
Hi Werner,

A bit late to the party. GEOM raid GUI parts were stripped a long time ago, maybe there is opportunity to bring something back, though users of this feature seem few (or silent).

At one point we also wanted to strip it from the installer, but somebody intervened, so it's still there, functioning ok it seems. :)

Just plugging old pages back may not be worth it in the long run. Monit may indeed be the way to go... we are looking for a generic notification / reporting replacement and maybe it's just that and it will be added to the core functionality in the long run. It's difficult to say yet without having started the replacement process.


Cheers,
Franco
Title: Re: [SOLVED] Query status of GEOM Mirror (gmirror) RAID1
Post by: wefinet on July 07, 2017, 09:23:25 am
Hi Frank, hi Franco,

sorry for my late reply - I've been out-of-office for some time :-)

Thank you for your valuable answers. I have written a wiki article (in German) and included the information regarding os-monit: https://www.thomas-krenn.com/de/wiki/OPNsense_Software_RAID_1

So thanks again for your help :-)
Best regards,
Werner