Convert bb-mdstat for Variables XYMON
list FreeSoftwareServers
Hello XYMon Guru's! I am trying to configure bb-mdstat found on 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/] 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>
list Jeremy Laidman
On Fri, Jul 22, 2016 at 3:31 PM FreeSoftwareServers <
▸
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 , 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.?
It's designed to run in an Xymon/BB environment, such as via xymoncmd or bbcmd. Note that xymoncmd (and xymonlaunch) sets BB environment variables for backwards-compatibility, so no need to change the variables.
Testing : donut at FileServer:/usr/lib/xymon/client/ext$ ./bb-mdstat.sh
Try: ~xymon/client/bin/xymoncmd ./bb-mdstat.sh Cheers Jeremy
list FreeSoftwareServers
@Jeremy
This made everything come together, thank you!
Note that xymoncmd (and xymonlaunch) sets BB environment variables for backwards-compatibility, so no need to change the variables.
Try:
~xymon/client/bin/xymoncmd ./bb-mdstat.sh
Cheers
Jeremy
A few things:
Nowhere on the internet could I find the “default” XYMON/HOBBITHOME and its really hard to find because XYMon symlinks files all over the place, I think a note saying, Check here but it might not work would be useful to many.
Also I had to change the following in the config file for the [raid] flag, but really, I think xymon should have done this. [sudo ln –s hobbitclient.cfg xymonclient.cfg] for compatibility, I understand that it’s a lot to update each time xymon changes its name, but I think it’s finally settled down with xymon!
ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
TO :
ENVFILE $HOBBITCLIENTHOME/etc/xymonclient.cfg
I tried this >>
<http://www.it-eckert.com/software/raid-monitor/>; http://www.it-eckert.com/software/raid-monitor/
But my sd* get rearranged upon reboot so that didn’t work, but I was able to get bb-mdstat to work!
Only problem left, it doesn’t seem to be updating :(…. I used /etc/xymon/clientlaunch.d/bb-mdstat.cfg which everything seems setup to run correctly, but my status seems to stay unchanged…. But easy fix, I just run the below cmd in cron every 5 minutes.
/usr/lib/xymon/client/bin/xymoncmd /usr/lib/xymon/client/ext/bb-mdstat.sh
I made a few write-ups if anybody is interested, thanks for getting me rolling on my raid-monitoring!
https://www.freesoftwareservers.com/index.php/2016/07/24/xymon-home-page/
▸
From: Jeremy Laidman [mailto:user-71895fb2e44c@xymon.invalid] Sent: Friday, July 22, 2016 1:37 AM To: FreeSoftwareServers <user-ca3423890b9b@xymon.invalid>; xymon at xymon.com Subject: Re: [Xymon] Convert bb-mdstat for Variables XYMON On Fri, Jul 22, 2016 at 3:31 PM 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 , 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.? It's designed to run in an Xymon/BB environment, such as via xymoncmd or bbcmd. Note that xymoncmd (and xymonlaunch) sets BB environment variables for backwards-compatibility, so no need to change the variables. Testing : donut at FileServer:/usr/lib/xymon/client/ext$ ./bb-mdstat.sh Try: ~xymon/client/bin/xymoncmd ./bb-mdstat.sh Cheers Jeremy
list Thomas Eckert
(cc’ed the list)
FWIW now that you got bb-mdstat working:
Changes from 4.3.17 -> 4.3.18 (3 Feb 2015)
* Linux client:
- Generate 'raid' status from mdstat data
Cheers
Thomas
On 25 Jul 2016, at 00:00, FreeSoftwareServers <user-ca3423890b9b@xymon.invalid> wrote: Do you know which version upwards of the XYMon-Client includes /proc/mdstat? I am using apt-get in Ubuntu Currently, but I would compile manually if I found newer features embedded that I actually use. Going to try your alternate solution regardless, because my work uses AARCONF to check on the raid status currently and we use XYMon, so seems logical. Regards, John M. From: Thomas Eckert [mailto:user-2a86d6cd6326@xymon.invalid] Sent: Friday, July 22, 2016 2:16 AM To: FreeSoftwareServers <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/] 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>