Ad Widget

Collapse

Template for HP MSA 2040 (external check)

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

    Template for HP MSA 2040 (external check)

    Hi all,
    i created, based on Emir Imamagics HP P2000 G3 Template a new one for MSA2040 because his did not work on my System.

    First of all: i used Emir Imamagics Script snippets. If you dont agree please just delete this thread.

    For your hosts you Need to specific 2 macros:
    {$MSA1} = hostname/ip Controller 1
    {$MSA2} = hostname/ip Controller 2

    the request are perfmored with an external script hp-msa.pl

    In the script please specific the username+password for the MSA API user.

    Almost everything will be Auto discovered:
    - enclosure
    - disks
    - vdisks
    - Volumes

    Triggers for almost everything are definded.

    Important: allow HTTP Access, actuall i have issues with HTTPS. So you Need to active HTTP on the msa.

    Feel free to come back with Feedback or improvments

    Update:
    Thanks @varnav
    Template with Bugfixes here:

    https://share.zabbix.com/storage-devices/hp/hp-msa

    Please use varnavs Version.
    Attached Files
    Last edited by michael.weber; 16-03-2016, 11:20.

    #2
    Error

    Hi. Big thanks for your work.
    command:
    perl /usr/local/share/zabbix/externalscripts/hp-msa.pl 192.168.X.X lld
    answers:
    Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 115.
    Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 118.
    Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 121.
    Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 124.
    Use of uninitialized value $ARGV[2] in string eq at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 127.
    {
    "data" : []
    }

    Can you help me with it?
    Also, can you tell about "ICMP status" in Value mapping?

    Comment


      #3
      Hi, of Course!
      you Need to add a additionla Argument for the lld to tell the script about the items you want to discover.
      Code:
      [email protected]**-s-zab01:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 lld controller
      {
         "data" : [
            {
               "{#CLASS}" : "Controller",
               "{#KEY}" : "A"
            },
            {
               "{#KEY}" : "B",
               "{#CLASS}" : "Controller"
            }
         ]
      }

      the idea behind ICMP Check:
      Both Macros for the Host {$MSA1} and {$MSA2} and checked with ICMP to verify the availability of the Controllers.
      BUT the other checks are only performed on the {$MSA1}.
      so: if MSA2 goes down, you will get a ICMP error and additional Information with the other checks.
      if MSA1 goes down NO check will be performed because the script cant connect to the ip. But you will get a alert because of the ICMP check on MSA1.

      if you have any further questions just let me know

      Comment


        #4
        Thanks. All good, all working fine, but only from command line my zabbix-server says at discover rules: "Value should be a JSON object."
        i tried different methods to convert to JSON, but result is nothing. JSON output correct.
        Today i upgraded zabbix server from 2.4.3 to 2.4.7, error non go away Do you have any idea?
        michael.weber you have zabbix 3.0 and all working fine?

        Comment


          #5
          i have zabbix 3.0 Alpha

          if zabbix say that it should be a json please check the Output.
          Can you copy&paste your command + Output into a CODE Tag so i can recheck the Output

          here two example command for LLD and DATA (both are required), i highlighted the output:
          Note: lld command Needs JSON Format, data Output ONLY the Value

          Code:
          [email protected]:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 lld enclosure
          {
             "data" : [
                {
                   "{#CLASS}" : "Enclosure",
                   "{#KEY}" : "2"
                },
                {
                   "{#CLASS}" : "Enclosure",
                   "{#KEY}" : "1"
                }
             ]
          }
          
          [email protected]:/usr/local/share/zabbix/externalscripts# ./hp-msa.pl 192.168.1.94 data enclosure 2 health
          OK[email protected]:/usr/local/share/zabbix/externalscripts#

          Comment


            #6
            Ho-ho. It`s my stupid mistake. Before download you script to zabbix i edit it in notepad+ and at the and of each row appeared symbol "^M" are not displayed in nano. Discover now working.
            Big thanks for your work and help. Good luck.

            Comment


              #7
              I have Zabbix 2.4.7. And I also have problem with "Value should be a JSON object".
              This is result of LLD command:
              Code:
              [email protected]:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 lld enclosure
              
              {
                 "data" : [
                    {
                       "{#KEY}" : "Enclosure",
                       "{#CLASS}" : "1"
                    },
                    {
                       "{#CLASS}" : "2",
                       "{#KEY}" : "Enclosure"
                    }
                 ]
              }
              This is result of DATA command:
              Code:
              [email protected]:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 data enclosure 2 health
              
              [email protected]:~$
              I try to edit pl script in Notepad++, nano, mcedit. But this problem not solved.

              Also, I have "Unknown import version" problem, but i solve it, when i change "Zabbix Export Version" from 3.0 to 2.0.

              Comment


                #8
                Everything is fine
                Check the Output line:
                [email protected]:~$ perl /usr/lib/zabbix/externalscripts/hp-msa.pl 192.168.73.23 data enclosure 2 health

                OK[email protected]:~$
                You get a "OK" from the MSA, so the enclosure 2 health is fine!

                The Export Version is correct, sorry for that. I exported it with the Zabbix 3.0 Alpha Version.

                Comment


                  #9
                  Originally posted by michael.weber View Post
                  Everything is fine
                  Check the Output line:


                  You get a "OK" from the MSA, so the enclosure 2 health is fine!

                  The Export Version is correct, sorry for that. I exported it with the Zabbix 3.0 Alpha Version.
                  I know, that enclosure is fine. But template isn't working in my zabbix version.
                  I try to solve this problem, and ask you, why zabbix show this errors?
                  LLD command show correct JSON data, isn't it?
                  Maybe upgrade my zabbix to 3.0 can solve this problem?

                  Comment


                    #10
                    Please check the Server logs. In my logs i can see that sometimes to execution time for the script just to high and zabbix kills it. Can you check this?

                    Comment


                      #11
                      For use this with HTTPS, edit the script, add:

                      use LWP::Protocol::https;
                      $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;

                      and change everything from

                      http://

                      to

                      https://

                      Comment


                        #12
                        Thanks for that hint. I will add it to my first post and link to your post. Ok?

                        Comment


                          #13
                          Sure.

                          I also think this template would look well on http://share.zabbix.com

                          Comment


                            #14
                            Don't forget to increase Timeout value in zabbix_server.conf

                            Any ideas how to monitor IOPS?

                            Comment


                              #15
                              Also, there seems to be an error in disk trigger prototype. One of these should check for status that is "Up", not "Ok".

                              Should be:

                              Drive[{#KEY}] Status
                              {Template HP MSA 2040:hp-msa.pl[{$MSA1},"data", "disk", {#KEY}, "status"].iregexp(up)}=0

                              Comment

                              Announcement

                              Collapse
                              No announcement yet.
                              Working...
                              X