Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143434 - [EBUILD] megarc - Megaraid Controller utility
Summary: [EBUILD] megarc - Megaraid Controller utility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Wolfram Schlich (RETIRED)
URL: http://www.lsilogic.com/cm/License.do...
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2006-08-10 02:21 UTC by Pieter Steyn
Modified: 2008-04-29 08:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Ebuild for lsi-logic megarc (megarc-1.11.ebuild,1.16 KB, text/plain)
2006-08-10 02:23 UTC, Pieter Steyn
Details
Lsi Logic LICENSE (LICENSE,8.02 KB, text/plain)
2006-08-10 02:26 UTC, Pieter Steyn
Details
README for the nagios plugin (README.NAGIOS,829 bytes, text/plain)
2006-08-10 02:27 UTC, Pieter Steyn
Details
README for the nagios plugin (README.NAGIOS,829 bytes, text/plain)
2006-08-10 02:29 UTC, Pieter Steyn
Details
README for the nagios plugin (README.NAGIOS,829 bytes, text/plain)
2006-08-10 02:29 UTC, Pieter Steyn
Details
nagios plugin (check_megaraid.rb,615 bytes, text/ruby)
2006-08-10 02:35 UTC, Pieter Steyn
Details
Patch to fix insecure temp file creation by the binary (insecure-tmpfile.patch,327 bytes, patch)
2006-08-10 02:36 UTC, Pieter Steyn
Details | Diff
Update to insecure patch to not display cwd at end of execution (insecure-tmpfile.patch,330 bytes, patch)
2006-12-14 04:02 UTC, Phil Whineray
Details | Diff
Find only the correct device and handle no device at all (device-find.patch,579 bytes, patch)
2006-12-14 04:05 UTC, Phil Whineray
Details | Diff
ebuild including device-find.patch (megarc-1.11.ebuild,1.20 KB, application/octet-stream)
2006-12-14 04:07 UTC, Phil Whineray
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pieter Steyn 2006-08-10 02:21:04 UTC
Hi all,

I've created an ebuild for Lsi Logic's megarc Megaraid Controller utility, which allows you to monitor the hardware array status for one.

I've also created a nagios plugin, which will be installed if you have the nagios-plugin useflag set.

It's been a _real_ mission finding this software and actually figuring it out, so this ebuild should make alot of people's lives much easier as it would have mine had it existed.

Regards,
Pieter Steyn.
Comment 1 Pieter Steyn 2006-08-10 02:23:49 UTC
Created attachment 93892 [details]
Ebuild for lsi-logic megarc
Comment 2 Pieter Steyn 2006-08-10 02:26:41 UTC
Created attachment 93893 [details]
Lsi Logic LICENSE
Comment 3 Pieter Steyn 2006-08-10 02:27:20 UTC
Created attachment 93894 [details]
README for the nagios plugin
Comment 4 Pieter Steyn 2006-08-10 02:29:03 UTC
Created attachment 93895 [details]
README for the nagios plugin
Comment 5 Pieter Steyn 2006-08-10 02:29:59 UTC
Created attachment 93896 [details]
README for the nagios plugin
Comment 6 Pieter Steyn 2006-08-10 02:35:12 UTC
Created attachment 93897 [details]
nagios plugin
Comment 7 Pieter Steyn 2006-08-10 02:36:10 UTC
Created attachment 93898 [details, diff]
Patch to fix insecure temp file creation by the binary
Comment 8 Sheldon Hearn 2006-08-24 01:43:23 UTC
Is anyone willing to commit this?  I'd love to have it in the portage tree for all the Dell servers I manage.

Pieter was very careful to mark it x86-only only and honour the silly license agreement.
Comment 9 David Olivier 2006-08-29 11:52:24 UTC
Could this please be added to portage.
Comment 10 Phil Whineray 2006-12-14 04:02:46 UTC
Created attachment 104028 [details, diff]
Update to insecure patch to not display cwd at end of execution

I would like to add my voice to those that would like to see this included.

The following patch stops the script from outputting the current working directory at the end of execution (the cd - does this) by using cd /tmp. The user's cwd is unaffected in any case since the cd within the script does not affect the program calling it.
Comment 11 Phil Whineray 2006-12-14 04:05:48 UTC
Created attachment 104029 [details, diff]
Find only the correct device and handle no device at all

The script was failing on some of my systems because two devices were being found (megadev_legacy being the second). I took the opportunity to handle no device being found more gracefully too.
Comment 12 Phil Whineray 2006-12-14 04:07:42 UTC
Created attachment 104030 [details]
ebuild including device-find.patch
Comment 13 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-22 11:10:45 UTC
Guys, can you please have a look at the following:

sys-block/megacli (by LSI)
sys-block/megactl (OSS)

sys-block/lsiutil (by LSI, only for Fusion MPT based devices)
sys-block/mpt-status (OSS, only for Fusion MPT based devices)

Afterwards, please tell me whether you still want MegaRC in Portage.
If so, I'll add it. Thanks!
Comment 14 Phil Whineray 2008-04-22 11:34:08 UTC
Of the four listed, only sys-block/megactl recognises my adapter. It doesn't support much of the control functionality of megarc, so I would still like to see that added if possible.
Comment 15 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-22 12:48:12 UTC
(In reply to comment #14)
> Of the four listed, only sys-block/megactl recognises my adapter. It doesn't
> support much of the control functionality of megarc, so I would still like to
> see that added if possible.

Ok. Will let you know once it's committed.
Comment 16 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-22 13:11:16 UTC
(In reply to comment #11)
> Created an attachment (id=104029) [edit]
> Find only the correct device and handle no device at all
> 
> The script was failing on some of my systems because two devices were being
> found (megadev_legacy being the second). I took the opportunity to handle no
> device being found more gracefully too.

+MAJOR=`grep 'megadev\>' /proc/devices|awk '{print $1}'`

What does the \> do there?!
man 7 regex didn't help...
I'd suspect it to act just like $, but well, please enlighten me :)
Comment 17 Phil Whineray 2008-04-22 13:16:49 UTC
> What does the \> do there?!

It forces a match to the end of a word, so:
  megadev
  megadev,
both match, but
  megadeva
does not.

> man 7 regex didn't help...

I think the grep manpage may have a more complete explanation.
Comment 18 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-22 13:19:37 UTC
(In reply to comment #17)
> > What does the \> do there?!
> 
> It forces a match to the end of a word, so:
>   megadev
>   megadev,
> both match, but
>   megadeva
> does not.

I see... why not match against 'megadev$'?
Does /proc/devices sometimes contains stuff like this:
"123 megadev, foo, bar, baz"?! Cannot imagine that...

> > man 7 regex didn't help...
> 
> I think the grep manpage may have a more complete explanation.

Stupid me X-)

Thanks!
Comment 19 Phil Whineray 2008-04-22 13:32:47 UTC
> I see... why not match against 'megadev$'?
> Does /proc/devices sometimes contains stuff like this:
> "123 megadev, foo, bar, baz"?! Cannot imagine that...

Fair point; looking at the output of /proc/devices you should be able to switch to $ without affecting the behaviour I think.
Comment 20 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-23 21:34:08 UTC
Committed sys-block/megarc-1.11 with a new
wrapper shell script (please test it!).

I left out the Nagios plugin thingy for now.
Feel free to open a new bug for that one.
Comment 21 Phil Whineray 2008-04-24 11:02:07 UTC
Thanks for adding this.

Install seems fine, so not sure this should be re-opened for the following problem or I should have created a new bug. Sorry if you would prefer the latter.

Running the installed program:
  # megarc
  /usr/sbin/megarc: line 36: megarc/megarc.bin: No such file or directory
  Removing temporary megarc working directory
  Finished. Have a nice day.

Looks like the location of megarc.bin is being mis-calculated. As it's being looked at, would it be better somewhere other than sbin anyway, since it won't be called directly?

Also, if I had my way the last two echo statements would be removed since all they do is clutter up the output.
Comment 22 Wolfram Schlich (RETIRED) gentoo-dev 2008-04-24 13:06:11 UTC
(In reply to comment #21)
> Running the installed program:
>   # megarc
>   /usr/sbin/megarc: line 36: megarc/megarc.bin: No such file or directory
>   Removing temporary megarc working directory
>   Finished. Have a nice day.
> 
> Looks like the location of megarc.bin is being mis-calculated. As it's being
> looked at, would it be better somewhere other than sbin anyway, since it won't
> be called directly?

Thanks, I f**ked up ;) Fixed in CVS without revbump.

> Also, if I had my way the last two echo statements would be removed since all
> they do is clutter up the output.

Fixed.
Comment 23 Phil Whineray 2008-04-29 08:29:31 UTC
Works here, many thanks.

Sorry for my slow response.