Ad Widget

Collapse

HP P2000 G3 monitoring (Zabbix 2.0)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hoangtukasi
    Junior Member
    • Mar 2013
    • 1

    #31
    HI,
    I have install zabbix 2.0.5 on Unbuntu and monitor San P2000 G3, but I do not know to copy this file hp-msa.pl to directory. please help thanks

    Comment

    • dima_dm
      Senior Member
      • Dec 2009
      • 2697

      #32
      Originally posted by hoangtukasi
      HI,
      I have install zabbix 2.0.5 on Unbuntu and monitor San P2000 G3, but I do not know to copy this file hp-msa.pl to directory. please help thanks
      in zabbix_server.conf see
      Code:
      ExternalScripts=${datadir}/zabbix/externalscripts
      In my system ${datadir}=/usr/local/share/
      Path /usr/local/share/zabbix/externalscripts.
      You can define any other path in ExternalScripts.

      Comment

      • extress
        Member
        • Jul 2012
        • 32

        #33
        How to use this template/script with a Zabbix Proxy, does anyone known ?

        Comment

        • elvar
          Senior Member
          • Feb 2008
          • 226

          #34
          I decided to revisit this script today and the problem I get is that it returns the number "0" every time I run the script. Any suggestions?

          Code:
          ./hp-msa.pl hostname.example.com stats
          0
          Kind regards,

          Comment

          • dima_dm
            Senior Member
            • Dec 2009
            • 2697

            #35
            Originally posted by elvar
            I decided to revisit this script today and the problem I get is that it returns the number "0" every time I run the script. Any suggestions?

            Code:
            ./hp-msa.pl hostname.example.com stats
            0
            Kind regards,
            You can create test version of script
            Code:
             diff -u zabbix_hp_msa.pl zabbix_hp_msa_test.pl
            --- zabbix_hp_msa.pl    2013-03-06 18:14:37.646311331 +0400
            +++ zabbix_hp_msa_test.pl       2013-03-07 14:33:23.346248736 +0400
            @@ -14,7 +14,7 @@
            
             my $USERNAME = "admin";
             my $PASSWORD = "XXXXXXXX";
            -
            +my $test;
             sub getHPP200Objects {
                 my $ua = shift;
                 my $sessionKey = shift;
            @@ -165,13 +165,16 @@
                 die "Could not close file $sendFile!" unless (close(FH));
            
                 $zabbixSendCommand .= $sendFile." 2>&1";
            -    if ( qx($zabbixSendCommand) =~ /Failed 0/ ) {
            +    print "test $zabbixSendCommand\n";
            +    $test=qx($zabbixSendCommand);
            +    print "test $test\n";
            +    if ( $test =~ /Failed 0/ ) {
                     $res = 1;
                 } else {
                     $res = 0;
                 }
            
            -    die "Can not remove file $sendFile!" unless(unlink ($sendFile));
            +    #die "Can not remove file $sendFile!" unless(unlink ($sendFile));
                 print "$res\n";
                 exit ($res - 1);
             }
            Check zabbix_agentd.conf ServerActive parameter. Must be IP zabbix_server.
            ServerActive=127.0.0.1

            Comment

            • elvar
              Senior Member
              • Feb 2008
              • 226

              #36
              Originally posted by dima_dm
              You can create test version of script
              Code:
               diff -u zabbix_hp_msa.pl zabbix_hp_msa_test.pl
              --- zabbix_hp_msa.pl    2013-03-06 18:14:37.646311331 +0400
              +++ zabbix_hp_msa_test.pl       2013-03-07 14:33:23.346248736 +0400
              @@ -14,7 +14,7 @@
              
               my $USERNAME = "admin";
               my $PASSWORD = "XXXXXXXX";
              -
              +my $test;
               sub getHPP200Objects {
                   my $ua = shift;
                   my $sessionKey = shift;
              @@ -165,13 +165,16 @@
                   die "Could not close file $sendFile!" unless (close(FH));
              
                   $zabbixSendCommand .= $sendFile." 2>&1";
              -    if ( qx($zabbixSendCommand) =~ /Failed 0/ ) {
              +    print "test $zabbixSendCommand\n";
              +    $test=qx($zabbixSendCommand);
              +    print "test $test\n";
              +    if ( $test =~ /Failed 0/ ) {
                       $res = 1;
                   } else {
                       $res = 0;
                   }
              
              -    die "Can not remove file $sendFile!" unless(unlink ($sendFile));
              +    #die "Can not remove file $sendFile!" unless(unlink ($sendFile));
                   print "$res\n";
                   exit ($res - 1);
               }
              Check zabbix_agentd.conf ServerActive parameter. Must be IP zabbix_server.
              ServerActive=127.0.0.1

              It turns out the only problem was not having the ServerActive line set correctly since my agent was using passive checks. Once I configured that line correctly it resolved things and now this template is working great. Thanks for the suggestion, it did the trick!

              Kind regards,

              Comment

              • elvar
                Senior Member
                • Feb 2008
                • 226

                #37
                Has anyone added anything to this script / template to detect disk and volume failures by chance?

                Comment

                • dima_dm
                  Senior Member
                  • Dec 2009
                  • 2697

                  #38
                  Originally posted by elvar
                  Has anyone added anything to this script / template to detect disk and volume failures by chance?
                  I added SNMP Item
                  .1.3.6.1.4.1.232.11.2.10.1.0
                  And trigger
                  {Template_HP_P2000_G3_FC:cpqHoMibStatusArray.last( 0)}#133396

                  Comment

                  • Sententiosus
                    Junior Member
                    • Mar 2013
                    • 12

                    #39
                    HASH error

                    Hello,

                    we like to monitor our MSA 2000 and while we trying the script we getting the error:
                    Not a HASH reference at /usr/lib/zabbix/externalscripts/hp-msa.pl line 18.
                    Code:
                     my $ua = shift;
                        my $sessionKey = shift;
                        my $url = shift;
                        my $objectName = shift;
                        my $idName = shift;
                        my $type = shift;
                        my $zbxArray = shift;
                        my $req = HTTP::Request->new(GET => $url);
                        $req->header('sessionKey' => $sessionKey );
                        $req->header('dataType' => 'api' );
                        my $res = $ua->request($req);
                        my $ref = XMLin($res->content, KeyAttr => "oid");
                        foreach my $oid (values %{$ref->{OBJECT}}) {
                           [SIZE="2"][FONT="Arial Black"] if ($oid->{name} eq $objectName) {[/FONT][/SIZE]
                                my $reference;
                                foreach my $entry (@{$oid->{PROPERTY}}) {
                                    if ($entry->{name} =~ /^($idName)$/) {
                                        $reference = {'{#HP_P2000_ID}' => $entry->{content}, '{#HP_P2000_TYPE}' => $type};
                                        last;
                                    }
                                }
                                push @{$zbxArray}, {%{$reference}};
                            }
                        }
                    }
                    Line 18 is marked. Has someone the same issue or maybe the solution?

                    Thanks

                    Comment

                    • tikondrus
                      Member
                      • Jan 2011
                      • 36

                      #40
                      Originally posted by prem
                      Running CentOS 6.3 x86_64 with perl-5.10.1-127.el6.x86_64 hp-msa.pl returns the following error:

                      syntax error at line 1, column 0, byte 0 at /usr/lib64/perl5/XML/Parser.pm line 187

                      It would be great if someone could help me please. Thanks!
                      a have the same problem.
                      Running CentOS 6.5 x86_64 with perl-5.10.1-136.el6.x86_64

                      can anybody help me?

                      Comment

                      • tikondrus
                        Member
                        • Jan 2011
                        • 36

                        #41
                        simple sollution:
                        yum install 'perl(IO::Socket::SSL)'

                        Comment

                        • sarou
                          Member
                          • Feb 2014
                          • 30

                          #42
                          Hi,


                          Thanks for template & Perl script.

                          I have a little problem, I try to create Items to check LUNs & Volumes but nothing appear in Lastest Datas Tabs. I can see "Sensor" but that's all.

                          Does anybody could say if I create item correctly ?




                          Thank you for answer and have a nice day.



                          PS : The Sensor Item appears but the value is "0" since 3 days...
                          Last edited by sarou; 20-02-2014, 09:34.

                          Comment

                          • avk
                            Member
                            • Jul 2013
                            • 44

                            #43
                            ./hp-msa.pl fqdn stats

                            ./hp-msa.pl fqdn stats

                            Can't exec "/usr/bin/zabbix_sender": No such file or directory at ./hp-msa.pl line 168.
                            Use of uninitialized value in pattern match (m//) at ./hp-msa.pl line 168.

                            Comment

                            • extress
                              Member
                              • Jul 2012
                              • 32

                              #44
                              Originally posted by avk
                              ./hp-msa.pl fqdn stats

                              Can't exec "/usr/bin/zabbix_sender": No such file or directory at ./hp-msa.pl line 168.
                              Use of uninitialized value in pattern match (m//) at ./hp-msa.pl line 168.
                              You must adapt the $zabbixSender variable that fit your installation, in my case :
                              $zabbixSender="/usr/local/bin/zabbix_sender";

                              edit : the same goes with $zabbixConfd, $USERNAME and $PASSWORD ...
                              Last edited by extress; 12-03-2014, 12:26.

                              Comment

                              • avk
                                Member
                                • Jul 2013
                                • 44

                                #45
                                Originally posted by extress
                                You must adapt the $zabbixSender variable that fit your installation, in my case :
                                $zabbixSender="/usr/local/bin/zabbix_sender";
                                I can't find zabbix_sender in /usr/local/bin.
                                I have CentOS 6.5. Which path to look?

                                Comment

                                Working...