Code Monkey home page Code Monkey logo

elesai's Introduction

OVERVIEW

Elesai is a wrapper around LSI's MegaCli utility that provides access to common types of information about the RAID controllers via a show action without the need to speak martian. It is a line-oriented tool so that it can be combined with other Unix command-line tools to process and manipulate the data (i.e., sed, awk, and friends). It also provides a check action (currently as a Nagios plugin in both active and passive modes) which monitors the health of the array and its components and reports it accordingly (this is not yet configurable).

SYNOPSIS

elesai [global-options] <action> [action-options] [<component>]

where:

  • <action> is one of show or check
  • <component> (for show action) is one of
    • adapter
    • virtualdrive (or vd)
    • physicaldrive (or pd)
    • bbu

Global options include:

  • -d, --debug: enable debug mode
  • -f, --fake DIRECTORY: specifies path to directory containing output of MegaCli invocations:
    • adpallinfo_aall: output from MegaCli -adpallinfo -aall -nolog
    • ldlist_aall: output from MegaCli -pdlist -aall -nolog
    • ldpdinfo_aall: output from MegaCli -ldpdinfo -aall -nolog
    • adpbbucmd_aall: output from MegaCli -adpcbucmd -aall -nolog
  • -m, --megacli MEGACLI: path to MegaCli binary (if noth in $PATH)
  • -a, --about: display general information about elesai
  • -V, --version: display elesai's version

The <check> can have options specific to itself:

  • -M, --monitor MONITOR: Monitoring system (default: nagios)
  • -m, --mode [active|passive]: Monitoring mode
  • -H, --nsca_hostname HOSTNAME: NSCA hostname to send passive checks
  • -c, --config CONFIG: Path to Senedsa (send_nsca) configuration
  • -S, --svc_descr SVC_DESCR: Nagios service description

Elesai uses Senedsa for Nagios passive check submission, which can use a configuration file to set options. Additionally, it will invoke MegaCli with sudo if not run by root.

Invocations

Normal Invocation

root@boxie:~# elesai show pd | sort -k 4
[PD]   e253s3   27       online:spunup     1.82TB   HDD  SATA   0   0   9WM1B7VDST32000644NS SN11
[PD]   e252s7   23       online:spunup     1.82TB   HDD  SATA   0   0   9WM1FX1LST32000644NS SN11
[PD]   e253s0   24       online:spunup     1.82TB   HDD  SATA   0   0   9WM1GF2NST32000644NS SN11
[PD]   e253s1   25       online:spunup     1.82TB   HDD  SATA   0   0   9WM1GY85ST32000644NS SN11
[PD]   e252s6   22       online:spunup     1.82TB   HDD  SATA   0   0   9WM1GYKJST32000644NS SN11
[PD]   e253s2   26       online:spunup     1.82TB   HDD  SATA   0   0   9WM1HA0NST32000644NS SN11
[PD]   e253s5   29       online:spunup     1.82TB   HDD  SATA   0   0   9WM7L834ST32000644NS SN12
[PD]   e252s4   12       online:spunup   223.06GB   SSD  SATA   0   0   CVPR138405AQ300EGN INTEL SSDSA2CW300G3 4PC10362
[PD]   e252s2    9       online:spunup   223.06GB   SSD  SATA   0   0   CVPR140100MQ300EGN INTEL SSDSA2CW300G3 4PC10362
[PD]   e252s0   11       online:spunup   223.06GB   SSD  SATA   0   0   CVPR140201KZ300EGN INTEL SSDSA2CW300G3 4PC10362
[PD]   e252s1   10       online:spunup   223.06GB   SSD  SATA   0   0   CVPR141300K9300EGN INTEL SSDSA2CW300G3 4PC10362
[PD]   e252s3    8       online:spunup   223.06GB   SSD  SATA   0   0   CVPR141301KG300EGN INTEL SSDSA2CW300G3 4PC10362
[PD]   e253s4   30       failed:spunup     1.82TB   HDD  SATA   0   0   9WM5Y4AEST32000644NS SN12
[PD]   e252s5   13     hotspare:spunup   223.06GB   SSD  SATA   0   0   CVPR140100TT300EGN INTEL SSDSA2CW300G3 4PC10362

Remote Invocation

Pipe output to elesai:

root@boxie:~# ssh server.example.com sudo MegaCli -pdlist -aall | elesai show pd
[PD]   e252s0   16       online:spunup   278.46GB   HDD   SAS   0   0  a0  SEAGATE ST3300657SS 00066SJ01W4G
[PD]   e252s1   17       online:spunup   278.46GB   HDD   SAS   0   0  a0  SEAGATE ST3300657SS 00066SJ01TTR
[PD]   e252s2   20       online:spunup   278.46GB   HDD   SAS   0   0  a0  SEAGATE ST3300657SS 00066SJ02BCX
[PD]   e252s3   21       online:spunup   278.46GB   HDD   SAS   0   0  a0  SEAGATE ST3300657SS 00066SJ025LP
[PD]   e252s4   18       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1G6MXST32000644NS SN11
[PD]   e252s5   28       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM0FFYCST32000644NS SN11
[PD]   e252s6   22       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1GYKJST32000644NS SN11
[PD]   e252s7   23       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1FX1LST32000644NS SN11
[PD]   e253s0   24       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1GF2NST32000644NS SN11
[PD]   e253s1   25       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1GY85ST32000644NS SN11
[PD]   e253s2   26       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1HA0NST32000644NS SN11
[PD]   e253s3   27       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM1B7VDST32000644NS SN11
[PD]   e253s4   30       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM5Y4AEST32000644NS SN12
[PD]   e253s5   29       online:spunup     1.82TB   HDD  SATA   0   0  a0  9WM7L834ST32000644NS SN12
[PD]   e253s6   31  unconfigured(bad):     0.00KB   HDD   SAS   0   0  a0  SEAGATE ST33000650SS 0003Z29182VM
[PD]   e253s7   32  unconfigured(bad):     0.00KB   HDD   SAS   0   0  a0  SEAGATE ST33000650SS 0003Z291A3QV

elesai's People

Contributors

gerirgaudi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

elesai's Issues

Fix STDIN functionality

Elesai "hangs" when run over ssh remotely. It doesn't actually hang: it thinks it should be getting MegaCli output from STDIN, since ssh by default does not allocate a tty. This behavior can be circumvented by forcing the allocation of a tty with ssh -t, but it would be preferable to not force the use of that option.

Add 'Span' support from LDPDinfo

Elesai does not currently handle virtual disk spans. In fact, because of their format, spans are (incorrectly) treated as virtual disk attributes.

Error when trying to run after install.

elesai show pd | sort -k 4
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:11: undefined (?...) sequence: /^Adapter\s+#*(?<value>\d+)/ (SyntaxError) /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:12: undefined (?...) sequence: /^Virtual\s+Drive:\s+\d+\s+\((?<key>Target\s+Id):\s+(?<value>\d+)\)/ /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:13: undefined (?...) sequence: /^Span:\s+(?<value>\d+)/ /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:14: undefined (?...) sequence: /^(?<key>Enclosure\s+Device\s+ID):\s+(?<value>\d+)/ /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:15: undefined (?...) sequence: /^(?<key>[A-Za-z0-9()\s#'-.]+):(?<value>.*)/ /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:166: undefined (?...) sequence: /(?<number>[0-9\.]+)\s+(?<unit>[A-Z]+)/ /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai/megacli.rb:169: undefined (?...) sequence: /Primary-(?<primary>\d+),\s+Secondary-(?<secondary>\d+)/ from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/lib/elesai.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib/ruby/gems/1.8/gems/elesai-0.6.9/bin/elesai:8
from /usr/bin/elesai:19:in `load'
from /usr/bin/elesai:19

Installed with:

gem install elesai
Successfully installed workflow-0.8.1
Successfully installed log4r-1.1.10
Successfully installed senedsa-0.2.9
Successfully installed elesai-0.6.9
4 gems installed
Installing ri documentation for workflow-0.8.1...
Installing ri documentation for log4r-1.1.10...
Installing ri documentation for senedsa-0.2.9...
Installing ri documentation for elesai-0.6.9...
Installing RDoc documentation for workflow-0.8.1...
Installing RDoc documentation for log4r-1.1.10...
Installing RDoc documentation for senedsa-0.2.9...
Installing RDoc documentation for elesai-0.6.9...

Add SSH Support

Elesai can accept MegaCli input from STDIN and run MegaCli itself. It would be nice if it could also invoke MegaCli remotely over SSH, like so:

elesai --ssh <host> --sshport <port> --ssh-identity <path> --ssh-agent <path> show pd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.