Announcement

Collapse
No announcement yet.

Monitoring Intel/LSI/Symbios RAID controllers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Monitoring Intel/LSI/Symbios RAID controllers

    Hello everyone,

    So, based on this thread I created my own script for monitoring RAID controllers on windows systems. Maybe it will be useful for someone else. I don't know which controllers is possible monitor with this, as I have only Intel RAID controllers here, but if it's possible to use megacli, cmdtool for this, script should work (I hope).

    Discovery script uses trapper items, so I'm running this script using windows scheduler

    LLD Script requirements:
    • Active Zabbix Agent, set paths to zabbix_sender and config in script (script uses zabbix_sender & zabbix agent config to send data to discovery items)
    • CmdTool2 (or MegaCLI, or smth like this. I got this from firmware update package from intel website, set path in script)
    • Powershell on server (With execution policy, which allows local script execution)

    Script for checking items.
    • The same CmdTool2. Set path to this tool in script ($CLI variable)

    With these scripts and template zabbix monitors physical disks, RAID volumes and BBUs. Triggers are also defined. All items (except discovery) are Zabbix Agent active items. It will be great to monitor also adapter log for critical events, but I just didn't figured out yet, how to do it.

    Items, defined in template:

    physical disks
    • disk state (unconfigured(good)/optimal/hotspare)
    • media errors
    • raw size
    • inquiry data (disk model and firmware)
    • predictive errors

    logical disks
    • vdisk state
    • vdisk size

    adapters
    • firmware version
    • model of adapter

    BBUs
    • State of charge
    • BBU state
    • BBU Capacity (current & design)


    You can download template and scripts from github

    p.s. Sorry for my poor English
    Last edited by ArtemK; 22-11-2016, 17:45.

    #2
    Surprisingly no comments so far. Useless scripts? No interest? No RAID controllers?

    Anyway, I've created also perl version of these scripts for unix systems. Other changes:
    Code:
    - fixed discovery of physical disks for windows (I thought, that there are always continuous order of drive's IDs on enclosure, i.e. 0-8, that is not true)
    - rearranged item's discovery in script for windows
    - firmware check for adapter now returns firmware package version
    for unix agents, tool for checking controllers should be run as root via sudo
    Code:
    # sudoers file
    Defaults:zabbix !requiretty
    zabbix  ALL=NOPASSWD:/opt/MegaRAID/CmdTool2/CmdTool2
    Other requirements are the same: active zabbix agent, paths in scripts to sender, config, etc...

    I've placed script on my servers to /etc/zabbix/scripts/ folder. Path must be the same in agent config.

    Template remains the same (changed name only). Thanks!

    It would be great, if someone will review my code. Any comments?

    download it from github
    Last edited by ArtemK; 03-06-2017, 21:20.

    Comment


      #3
      There is LSI RAID template for Linux

      https://www.zabbix.com/wiki/templates/start

      I am almost done with one for MD RAID (software) on LInux

      Comment


        #4
        Originally posted by linuxsquad View Post
        There is LSI RAID template for Linux

        https://www.zabbix.com/wiki/templates/start

        I am almost done with one for MD RAID (software) on LInux
        yep, that is template, which I used as a starting point. But it's not really usable, you should always generate new template for each RAID controller and each configuration. If you will add new RAID volume - you will need to generate template for that configuration again. I used low level discovery, which will automatically create items and triggers for every RAID controller.

        Comment


          #5
          - auto-discovery is welcomed. I've just contacted original creator of LSI RAID template and suggested to add LLD to his template.

          - Use of /etc/zabbix for binaries or executable is NOT recommended. I would use /usr/local/bin/

          - I can review your template on Linux systems, let you know
          Last edited by linuxsquad; 03-07-2013, 06:42.

          Comment


            #6
            Originally posted by linuxsquad View Post
            - Use of /etc/zabbix for binaries or executable is NOT recommended. I would use /usr/local/bin/
            There is no binaries, it's just a perl script. Feel free to place it wherever you want. File owner is root:root and zabbix user have only read and execute rights, I don't see there any security issue...

            Comment


              #7
              Awsome tool you made ArtemK.
              I used it today to monitor some LSI SAS controller on a Debian system. They work perfectly.

              THANKS

              One question: how often do i need to run the raid_discovery script? so i can put in in cron.

              Comment


                #8
                Originally posted by AbsesS View Post
                One question: how often do i need to run the raid_discovery script? so i can put in in cron.
                Hi, glad that this is working for someone else Discovery script...there is no any specific schedule, you can run it once an hour, 12 hours, 24 hours, etc. It depends on your environment.

                On my servers it's executed by cron every night, if there are some big changes, you can always execute it manually.

                Comment


                  #9
                  Thanks for the answer and thanks again for the contribution

                  Comment


                    #10
                    Hi ArtemK,

                    The tool for windows is run successful. thank you very much

                    But for linux (debian squeezy) I have problem when I try to run on terminal (for checking)

                    /usr/bin/perl -w /etc/zabbix/script/raid_check.pl -mode pdisk -item $4 -adapter $1 -enclosure $2 -pdisk $3

                    the error is: Adapter is not defined. Use --adapter paramater at etc/zabbix/script/raid_check.pl line 21.

                    And display Not Supported in zabbix server (web)

                    Which version of zabbix agent/server that your tool need?

                    Comment


                      #11
                      Hello,

                      I've tested it on 2.x server/agent, also works on 2.2. Not sure that it will work for 1.x (never used it)

                      you should substitute $1 variables with your actual configuration, this is what discovery script can make for you (create all items in zabbix)

                      but you can run once discovery script, which will create file /tmp/raid-discovery-zsend-data.tmp ($tmp_path in discovery script). This file contains discovery data for zabbix. Using it you can check smth on command line

                      i.e. discovery data file
                      Code:
                      [[email protected] ~]# cat /tmp/raid-discovery-zsend-data.tmp
                      - intel.raid.discovery.pdisks { "data":[{ "{#ENCLOSURE_ID}":"252", "{#PDRIVE_ID}":"1", "{#ADAPTER_ID}":"0" },{ "{#ENCLOSURE_ID}":"252", "{#PDRIVE_ID}":"3",
                      ....
                      so, you can run, for example, such command:
                      Code:
                      [[email protected] ~]# perl -w /etc/zabbix/scripts/raid_check.pl -mode pdisk -item 'firmware_state' -adapter 0 -enclosure 252 -pdisk 3
                      Online, Spun Up
                      [[email protected] ~]#
                      BTW, I made another version of this scripts, which actively uses trapper items (and I'm using it currently), works better for me, than active agents check (win powershell script sometimes gives empty value, not sure why)
                      Last edited by ArtemK; 13-12-2013, 14:57.

                      Comment


                        #12
                        Hi
                        Many thanks for your reply.

                        I have checked the agent on my server linux, it is 1.8.2 and no support. On another linux server with 2.0.9, the script runs well.

                        As you mentioned, you are using another version of this script which can run with passive agent on windows and linux? Could you please to share your script.

                        Comment


                          #13
                          UPD 17.12.2013

                          I've added template with trapper items for physical/logical disks and BBU. Personally I use that version now, cause powershell script on windows sometimes returns empty values for physical disk checks (not sure why), and item changes state to unsupported. That is annoying. In this version I use scheduled tasks for discovery (every hour) and reporting (every 5 minutes, raid_trapper_check script).

                          NB, adapter checks type is still 'active agent'. There is also trigger for BBU, which uses nodata() (it will report, if no data coming from monitored host). You will need to make similar trigger for physical disk, for example, if there is no BBU on adapter.

                          also, there are some small bugs fixed (and maybe more added)

                          Download from github

                          Code review will be appreciated
                          Last edited by ArtemK; 03-06-2017, 21:23.

                          Comment


                            #14
                            Originally posted by neo4is View Post
                            I have checked the agent on my server linux, it is 1.8.2 and no support. On another linux server with 2.0.9, the script runs well.
                            I don't really understand what are you talking about, which script? AFAIK, 1.8 also supports UserParameters and perl/powershell scripts doesn't require specific agent.

                            Originally posted by neo4is View Post
                            As you mentioned, you are using another version of this script which can run with passive agent on windows and linux? Could you please to share your script.
                            It's not passive agent, I've used trapper items there. See my previous message.

                            Comment


                              #15
                              Originally posted by ArtemK View Post
                              I don't really understand what are you talking about, which script? AFAIK, 1.8 also supports UserParameters and perl/powershell scripts doesn't require specific agent.

                              I mean I can run your tool on windows (2.0.9 agent) but on linux (agent 1.8.2) in the zabbix server show me "Not Support" for Trigger, Item

                              It's not passive agent, I've used trapper items there. See my previous message.
                              Yours noted with thanks.

                              Comment

                              Working...
                              X