Ad Widget

Collapse

HP P2000 G3 monitoring (Zabbix 2.0)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Emir Imamagic
    Member
    • Mar 2008
    • 67

    #1

    HP P2000 G3 monitoring (Zabbix 2.0)

    Hello,

    I attached script and Zabbix template for transfer rates and IOPS for HP P2000 G3 storage system. I used LLD so this solution can be used only in Zabbix 2.0.
    For earlier versions it is possible to use statistic gathering & reporting part, but one needs to manually create templates.

    Script (hp-msa.pl) uses XML API and it is based on the example provided in "HP P2000 G3 MSA System CLI Reference Guide". Same script is used for LLD and reporting values as "Zabbix trappers". Execute hp-msa.pl to see usage. Unfortunately script does not have decent error/timeout handling, it is in my TODO list.

    Template uses LLD to discover all:
    • controllers
    • virtual disks
    • volumes


    Discovery item (HP Entities Discovery) uses {HOST.CONN} to connect to the storage system. Statistics gathering item (HP P2000 Sensor) uses {HOST.DNS1} for connecting and value reporting. Make sure that storage host has these two properly configured.

    Script execution time is ~10s so one needs to increase Zabbix server config file, e.g.:
    Timeout=30

    Big thanks to Zabbix team, LLD makes template generation soo much easier.

    Best regards,
    Emir Imamagic
    Attached Files
  • elvar
    Senior Member
    • Feb 2008
    • 226

    #2
    Wow, your timing is impeccable! I just installed my first P2000 G3 and I came here looking for a template and found this.


    Thanks!

    Comment

    • thesubmitter
      Member
      • Feb 2012
      • 42

      #3
      Would this work for a g2 msa2312i?

      Comment

      • i.kulagin
        Member
        • Aug 2011
        • 35

        #4
        Emir Imamagic
        Thanks for template and the script, but can you please provide some kind of guide how to use them? I need to monitor the P2000 G3 FC, but I can't understand how can I do it, using this script, and which services should I configure inside of the P2000 equipment to make monitoring possible.
        Thanks for your help.

        Comment

        • scr512
          Junior Member
          • Jul 2012
          • 7

          #5
          So i've got most of this working my end but I'm guessing that something isn't quite right.

          If I execute the script interactively using the stats option I get a return of 0. I suspect that maybe the P2000s I am running are a version or two behind what you used in testing?

          # show inquiry
          Inquiry Controller A
          --------------------
          Management Controller Code Version: L230S025
          Management Controller Loader Code Version: 2.5
          Storage Controller Code Version: T230P03

          Comment

          • Emir Imamagic
            Member
            • Mar 2008
            • 67

            #6
            Hello,

            I have exactly the same version so it should work fine.

            Is LLD working? Did you get all the controllers, vdisks and volumes configured in Zabbix? Script will report 0 if sending of at least a single value fails.

            Unfortunately I didn't have time to do decent debugging so I suggest commenting line:
            Code:
            die "Can not remove file $sendFile!" unless(unlink ($sendFile));
            After executing
            Code:
            hp-msa.pl FQDN stats
            check content of file "/var/tmp/zabbixSenderHPP2000".

            Also check Zabbix server logs for errors.


            Originally posted by scr512
            So i've got most of this working my end but I'm guessing that something isn't quite right.

            If I execute the script interactively using the stats option I get a return of 0. I suspect that maybe the P2000s I am running are a version or two behind what you used in testing?

            # show inquiry
            Inquiry Controller A
            --------------------
            Management Controller Code Version: L230S025
            Management Controller Loader Code Version: 2.5
            Storage Controller Code Version: T230P03

            Comment

            • Emir Imamagic
              Member
              • Mar 2008
              • 67

              #7
              Before adding anything to Zabbix make sure that the controller has DNS and IP address and that it is accessible from the Zabbix server.

              Script uses default username and password (monitor/monitor). If your storage admin changed these parameters, you have to modify them in the hp-msa.pl script, lines:
              Code:
              my $USERNAME = "monitor";
              my $PASSWORD = "monitor";
              Script uses https, but if that is causing a problem you can switch it to http. Unfortunately I didn't make a parameter for that so you can use sed:
              Code:
              sed -i s/https/http/ hp-msa.pl
              Adding script/template to Zabbix:
              1. Create host with your controller data (you must IP and DNS address)
              2. Import template from the ZIP file
              3. On the Zabbix server:
              3.1. check the value of ExternalScripts in Zabbix server config file
              3.2. put hp-msa.pl in that directory
              3.2. make sure that user zabbix has execution permission on hp-msa.pl
              4. Link host with the template Template_HP_P2000_G3

              Discovery rule has a long delay (3600s) so in order to get LLD items defined you might want to temporarily change it to something like 60.

              Wait until items (controllers, vdisks, volumes) appear. Afterwards external item "HP P2000 Sensor" should start reporting values and eventually switch from 0 to 1.

              Originally posted by i.kulagin
              Emir Imamagic
              Thanks for template and the script, but can you please provide some kind of guide how to use them? I need to monitor the P2000 G3 FC, but I can't understand how can I do it, using this script, and which services should I configure inside of the P2000 equipment to make monitoring possible.
              Thanks for your help.

              Comment

              • Emir Imamagic
                Member
                • Mar 2008
                • 67

                #8
                Unfortunately I don't have such storage here. Best way to find out is to give it a try

                Originally posted by thesubmitter
                Would this work for a g2 msa2312i?

                Comment

                • scr512
                  Junior Member
                  • Jul 2012
                  • 7

                  #9
                  Originally posted by Emir Imamagic
                  Hello,

                  I have exactly the same version so it should work fine.

                  Is LLD working? Did you get all the controllers, vdisks and volumes configured in Zabbix? Script will report 0 if sending of at least a single value fails.

                  Unfortunately I didn't have time to do decent debugging so I suggest commenting line:
                  Code:
                  die "Can not remove file $sendFile!" unless(unlink ($sendFile));
                  After executing
                  Code:
                  hp-msa.pl FQDN stats
                  check content of file "/var/tmp/zabbixSenderHPP2000".

                  Also check Zabbix server logs for errors.
                  So actually the script looks to be working just fine, at least when I run it interactively from CLI I can see a bunch of useful data I would love to ingest.

                  So, looking at the zabbix_server.log it is obvious that I am doing something wrong in my host configuration.

                  Code:
                  File does not exist: 500 Can't connect to *UNKNOWN*:443 (Bad hostname '*UNKNOWN*')
                   at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 120
                  I'll poke around and see what I am doing. I will note that when I configured the hosts, I used an SNMP interface, not an agent interface. I do have an IP and DNS name set on the SNMP interface.

                  Comment

                  • Emir Imamagic
                    Member
                    • Mar 2008
                    • 67

                    #10
                    Originally posted by scr512
                    So actually the script looks to be working just fine, at least when I run it interactively from CLI I can see a bunch of useful data I would love to ingest.

                    So, looking at the zabbix_server.log it is obvious that I am doing something wrong in my host configuration.

                    Code:
                    File does not exist: 500 Can't connect to *UNKNOWN*:443 (Bad hostname '*UNKNOWN*')
                     at /usr/local/share/zabbix/externalscripts/hp-msa.pl line 120
                    I'll poke around and see what I am doing. I will note that when I configured the hosts, I used an SNMP interface, not an agent interface. I do have an IP and DNS name set on the SNMP interface.
                    The tricky part is that I used DNS name for stats. You have to make sure that:
                    1. DNS attribute is properly defined in "Agent interfaces"
                    2. DNS can be used to access storage controller and
                    3. DNS is equivalent to the "Host name" attribute of the host.

                    Comment

                    • scr512
                      Junior Member
                      • Jul 2012
                      • 7

                      #11
                      Originally posted by Emir Imamagic
                      The tricky part is that I used DNS name for stats. You have to make sure that:
                      1. DNS attribute is properly defined in "Agent interfaces"
                      2. DNS can be used to access storage controller and
                      3. DNS is equivalent to the "Host name" attribute of the host.
                      Hmm I seem to be going crazy

                      I can definitely connect to the storage management interface from my Zabbix box using it's DNS name (SSH)

                      Yet I am still getting le crazy log messages complaining about "*UNKNOWN*". I'll do some more Googling.


                      So, does this look sane to you?

                      Comment

                      • Emir Imamagic
                        Member
                        • Mar 2008
                        • 67

                        #12
                        Originally posted by scr512
                        Hmm I seem to be going crazy

                        I can definitely connect to the storage management interface from my Zabbix box using it's DNS name (SSH)

                        Yet I am still getting le crazy log messages complaining about "*UNKNOWN*". I'll do some more Googling.


                        So, does this look sane to you?
                        You need to configure add at least one Agent interface and put IP and DNS there. Afterwards you can remove this SNMP interface.

                        Comment

                        • scr512
                          Junior Member
                          • Jul 2012
                          • 7

                          #13
                          Originally posted by Emir Imamagic
                          You need to configure add at least one Agent interface and put IP and DNS there. Afterwards you can remove this SNMP interface.

                          Ok, I have that now setup. I've also configured my zabbix_agentd.conf to have a Timeout=30.

                          Code:
                          cat /etc/zabbix/zabbix_agentd.conf | grep Timeout
                          ### Option: Timeout
                          #	Spend no more than Timeout seconds on processing
                          Timeout=30
                          So, I seem to be getting a little further along. I am now running into this
                          Code:
                          1328:20120718:164423.314 item [jckp2k-1a.rac.acl:hp-msa.pl["{HOST.DNS1}","stats"]] became not supported: timeout while executing a shell script
                          1328:20120718:164443.325 item [jckp2k-1a.rac.acl:hp-msa.pl["{HOST.CONN}"]] became not supported: timeout while executing a shell script
                          1328:20120718:164528.345 item [jckp2k-1b.rac.acl:hp-msa.pl["{HOST.DNS1}","stats"]] became not supported: timeout while executing a shell script
                          1326:20120718:164553.362 item [jckp2k-1b.rac.acl:hp-msa.pl["{HOST.CONN}"]] became not supported: timeout while executing a shell script

                          Comment

                          • Emir Imamagic
                            Member
                            • Mar 2008
                            • 67

                            #14
                            Originally posted by scr512
                            Ok, I have that now setup. I've also configured my zabbix_agentd.conf to have a Timeout=30.
                            You need to put this variable to Zabbix server config.

                            Cheers

                            Comment

                            • scr512
                              Junior Member
                              • Jul 2012
                              • 7

                              #15
                              Originally posted by Emir Imamagic
                              You need to put this variable to Zabbix server config.

                              Cheers
                              Yes, this is set in server config as well... no joy.

                              Comment

                              Working...