Xymon Mailing List Archive search

Convert bb-mdstat for Variables XYMON - MDADM Changes config on Reboot even when in GOOD STATUS - Script not working

1 message in this thread

list Thomas Eckert · Mon, 25 Jul 2016 09:10:39 +0200 ·
John,

(cc’ed the list)

unfortunately this re-ordering happens. — not only for mdraid (linux soft raid) but also for megaraid (LSI controllers) for instance. Without sacrificing the simplicity of `raid-monitor` I see no solution for this. Excluding lines that might permute _could_ be an option but at the risk of “missing” some bad state of the RAID.

That being said: In a server setup where machines typically do not boot that often that’s an acceptable trade-off (for me).

To ease the “recreate reference file”-pain you could have a mini-script (ssh line) on the xymon-server that re-creates the file after you checked the raid-status on the Xymon web interface (`ssh my-server ‘/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/raid-monitor -r`).

All the best
Thomas
On 25 Jul 2016, at 01:14, FreeSoftwareServers <user-ca3423890b9b@xymon.invalid> wrote:

I love this concept, but it seems to have a flaw with MDADM. I will still be using it @ work with AARCONF, since I don’t think that will have the same problem…. But here is the issue, my sd* are in a different order after rebooting which caused red status, needed to rebuild known “good” config.
 @FileServer:~$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4][raid10]
md0 : active raid5 sdc1[4] sdd1[3] sde1[5] sdb1[0]
      14650914816 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4][UUUU]
 unused devices: <none>
@FileServer:~$ cat /var/lib/xymon/tmp/raid-monitor-ref.txt
module "linux_mdraid":
echo RAID fuer Softis
RAID fuer Softis
/bin/cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4][raid10]
md0 : active raid5 sdc1[4] sdb1[0] sde1[5] sdd1[3]
      14650914816 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4][UUUU]
 unused devices: <none>
@FileServer:# /usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/raid-monitor -d | grep "status .*\.raid"
2016-07-24 19:08:52 Using default environment file /usr/lib/xymon/client/etc/xymonclient.cfg
$BB $BBDISP "status ${MACHINE}.raid red Sun Jul 24 19:08:52 EDT 2016 - linux_mdraid RAID(s)
 Anything I can do? I can’t re-create the “known good config” automatically on reboot, or how would I know its “known good” without looking at it!
 Regards,
 John M.
 From: Thomas Eckert [mailto:user-2a86d6cd6326@xymon.invalid <mailto:user-2a86d6cd6326@xymon.invalid>] Sent: Friday, July 22, 2016 2:16 AM
To: FreeSoftwareServers <user-ca3423890b9b@xymon.invalid <mailto:user-ca3423890b9b@xymon.invalid>>
Subject: Re: [Xymon] Convert bb-mdstat for Variables XYMON
 /proc/mdstat monitoring is included in newer Xymon clients (producing a 'raid' status).

alternatively you might want to take a look at my raid-monitor extension which provides good/bad monitoring for afraid, LSI megaraid, 3ware/LSI, Adaptec aacraid:
http://www.it-eckert.com/software/raid-monitor/ <http://www.it-eckert.com/software/raid-monitor/>;
Cheers
Thomas

 On Jul 21, 2016 23:40, FreeSoftwareServers <user-ca3423890b9b@xymon.invalid <mailto:user-ca3423890b9b@xymon.invalid>> wrote:
Hello XYMon Guru’s!

 
I am trying to configure bb-mdstat found on https://wiki.xymonton.org/doku.php/monitors:bb-mdstat <https://wiki.xymonton.org/doku.php/monitors:bb-mdstat>; , but all the variables point to BB*** and it doesn’t work, I think all the “scripting” would work If I could just figure out how to set the variables correctly, any chance we could get this updated for XYMON Variables.?

 
Testing :

 
donut at FileServer:/usr/lib/xymon/client/ext$ ./bb-mdstat.sh

./bb-mdstat.sh: 62: [: unexpected operator

BBHOME is not set... exiting

 
Manually set :

 
BBHOME=/usr/lib/xymon/client

 
donut at FileServer:/usr/lib/xymon/client/ext$ ./bb-mdstat.sh

./bb-mdstat.sh: 62: [: unexpected operator

*** LOADING HOBBITCLIENT.CFG ***

./bb-mdstat.sh: 88: .: Can't open /usr/lib/xymon/client/etc/hobbitclient.cfg

 
Manually set :

 
if [ ! -d "$BBTMP" ] ; then             # GET DEFINITIONS IF NEEDED

          echo "*** LOADING HOBBITCLIENT.CFG ***"

        . $BBHOME/etc/xymonclient.cfg          # INCLUDE STANDARD DEFINITIONS

Fi

 
And this is where I draw a blank…

 
root at FileServer:/usr/lib/xymon/client/ext# ./bb-mdstat.sh

./bb-mdstat.sh: 62: [: unexpected operator

*** LOADING HOBBITCLIENT.CFG ***

./bb-mdstat.sh: 3: /usr/lib/xymon/client/etc/xymonclient.cfg: include: not found

./bb-mdstat.sh: 4: /usr/lib/xymon/client/etc/xymonclient.cfg: include: not found

./bb-mdstat.sh: 17: /usr/lib/xymon/client/etc/xymonclient.cfg: include: not found

./bb-mdstat.sh: 135: ./bb-mdstat.sh: [[: not found

./bb-mdstat.sh: 135: ./bb-mdstat.sh: raid5: not found

./bb-mdstat.sh: 177: [: :

blocks

 
devices:: unexpected operator

./bb-mdstat.sh: 177: [: :

blocks

 
devices:: unexpected operator

Xymon version 4.3.7

Usage: /usr/lib/xymon/client/bin/xymon [--debug] [--merge] [--proxy=http://ip.of.the.proxy:port/] <http://ip.of.the.proxy:port/]>; RECIPIENT DATA

  RECIPIENT: IP-address, hostname or URL

  DATA: Message to send, or "-" to read from stdin

 
My mdadm config, regular RAID5 only one mdadm, and its md0.

 
root at FileServer:/usr/lib/xymon/client/ext# cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]

md0 : active raid5 sdc1[4] sdb1[0] sde1[5] sdd1[3]

      14650914816 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]

 
unused devices: <none>