Skip Menu |

This queue is for tickets about the Cisco-UCS CPAN distribution.

Report information
The Basics
Id: 86107
Status: open
Priority: 0/
Queue: Cisco-UCS

People
Owner: LTP [...] cpan.org
Requestors: F.Coelho [...] payvision.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Perl Cisco::UCS issue?
Date: Thu, 13 Jun 2013 11:46:55 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>
Hi, I am starting to develop a probe for Nagios using the Cisco::UCS and I have this issue. See below the error. Using chassis: Show quoted text
--- Login --- --- Cookie --- 1371115985/159c1ec7-1547-46e7-a138-237db76087fd--- Cluster --- 10.202.27.102--- Dn --- sys---------- ---------- 1 ---- ---------- 2 ---- Use of uninitialized value $id in hash element at /usr/local/share/perl5/Cisco/UCS.pm line 965. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Chassis 1 serial : FOX1532GPBX ---------- close ucs ---- Using interconnect: ---------- 1 ---- Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. ---------- 2 ---- Interconnect Cisco::UCS::Interconnect=HASH(0x254ff70)->id operability is Cisco::UCS::Interconnect=HASH(0x254ff70)->operability Interconnect Cisco::UCS::Interconnect=HASH(0x254a650)->id operability is Cisco::UCS::Interconnect=HASH(0x254a650)->operability Platform: CENTOS 6.4 x64 Perl version is : This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi Test-Simple-0.98 XML-Simple-2.20 libwww-perl-6.05 sample of the code: # basic requirements use strict; use Getopt::Long; use File::Basename; use Pod::Usage; use Data::Dumper; use Cisco::UCS; code for chassis: # Open UCS Session my $ucs = new Cisco::UCS ( cluster => $opt_cluster, port => $port, proto => $proto, username => $opt_user, passwd => $opt_password ); print ("--- Login ---\n"); $ucs->login(); print ("--- Cookie ---\n"); print $ucs->cookie; print ("--- Cluster ---\n"); print $ucs->cluster; print ("--- Dn ---\n"); print $ucs->dn; print ("----------\n"); print ("---------- 1 ----\n"); map { print '-'x50,"\n"; print "ID : " . $_->id . "\n"; print "Severity : " . $_->severity . "\n"; print "Description : " . $_->description . "\n"; } grep { $_->severity !~ /cleared/i; } $ucs->get_errors; print ("---------- 2 ----\n"); foreach my $chassis ($ucs->chassis) { print "Chassis " . $chassis->id . " serial : " . $chassis->serial . "\n" } print ("---------- close ucs ----\n"); #close UCS $ucs->logout(); print ("---------- $states{OK} ----\n"); exit($states{OK}); [cid:image001.jpg@01CE682B.68F4F710]<http://www.payvision.com/payvision-wins-best-cnp-program-outside-the-us-award> Kind regards, Fernando Coelho Mission Critical Engineer Payvision B.V. Keizersgracht 668c 1017 ET Amsterdam The Netherlands Tel: +31 (0) 20 794 23 00 Mobile: +31 (0) 6 2628 68 41 Fax: +31 (0) 20 794 23 32 Email: f.coelho@payvision.com<mailto:f.coelho@payvision.com> www.payvision.com<http://www.payvision.com> - Connect and Grow! blog.payvision.com<http://blog.payvision.com/> - Corporate Blog Amsterdam | Auckland | Berlin | Hong Kong | London | Macau | Madrid | New York | Paris | Utah | Singapore | Tokyo Disclaimer: This e-mail message is intended exclusively for the addressee or addressees. If the e-mail was sent to you by mistake, would you please contact us immediately by e-mail at service@payvision.com<mailto:service@payvision.com>. In that case, we also request that you destroy the e-mail and that you neither use the contents nor disclose them in any manner to third parties, because the message may contain confidential information.

Message body is not shown because it is too large.

Download image001.jpg
image/jpeg 41.9k
image001.jpg
Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Fri, 14 Jun 2013 09:33:30 +1000
To: bug-Cisco-UCS [...] rt.cpan.org, F.Coelho [...] payvision.com
From: Luke Poskitt <luke.poskitt [...] gmail.com>
Hi Fernando, Thanks for the feedback and bug report. The first warning: Use of uninitialized value $id in hash element at /usr/local/share/perl5/Cisco/UCS.pm line 965. Is caused by the use of the chassis() method rather than the get_chassiss() method in the line below: foreach my $chassis ($ucs->get_chassiss) { The chassis() method currently works in this context due to unintended behaviour resulting from lax parameter checking only and will probably be "fixed" in a future version. In not entirely sure what is causing the second error below: Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. But suspect it might stem from the use of chassis() rather than get_chassiss() as above - the similar errors for the interconnect portion of your output are likely due to a similar call to interconnect() rather than get_interconnects(). Unfortunately, the get_objects() methods are required in this context as there is no easy and foolproof way to ensure that any cached copies of retrieved objects represent the total number of objects in the system. Could you make the above suggested changes to your script and let me know if this also resolves the "Warning: <trigMeta>" errors? Also, could you please let me know which version of the Cisco::UCS module you are using? Cheers, -Luke On Thu, Jun 13, 2013 at 7:47 PM, Fernando Coelho via RT < bug-Cisco-UCS@rt.cpan.org> wrote: Show quoted text
> Thu Jun 13 05:47:13 2013: Request 86107 was acted upon. > Transaction: Ticket created by F.Coelho@payvision.com > Queue: Cisco-UCS > Subject: Perl Cisco::UCS issue? > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: F.Coelho@payvision.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > > Hi, > > I am starting to develop a probe for Nagios using the Cisco::UCS and I > have this issue. > See below the error. > > > Using chassis: > > --- Login --- > --- Cookie --- > 1371115985/159c1ec7-1547-46e7-a138-237db76087fd--- Cluster --- > 10.202.27.102--- Dn --- > sys---------- > ---------- 1 ---- > ---------- 2 ---- > Use of uninitialized value $id in hash element at > /usr/local/share/perl5/Cisco/UCS.pm line 965. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Chassis 1 serial : FOX1532GPBX > ---------- close ucs ---- > > Using interconnect: > ---------- 1 ---- > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > ---------- 2 ---- > Interconnect Cisco::UCS::Interconnect=HASH(0x254ff70)->id operability is > Cisco::UCS::Interconnect=HASH(0x254ff70)->operability > Interconnect Cisco::UCS::Interconnect=HASH(0x254a650)->id operability is > Cisco::UCS::Interconnect=HASH(0x254a650)->operability > > Platform: > CENTOS 6.4 x64 > > Perl version is : This is perl, v5.10.1 (*) built for > x86_64-linux-thread-multi > Test-Simple-0.98 > XML-Simple-2.20 > libwww-perl-6.05 > > sample of the code: > # basic requirements > use strict; > use Getopt::Long; > use File::Basename; > use Pod::Usage; > use Data::Dumper; > use Cisco::UCS; > > > code for chassis: > > # Open UCS Session > my $ucs = new Cisco::UCS ( > cluster => $opt_cluster, > port => $port, > proto => $proto, > username => $opt_user, > passwd => $opt_password > ); > > print ("--- Login ---\n"); > $ucs->login(); > > print ("--- Cookie ---\n"); > print $ucs->cookie; > print ("--- Cluster ---\n"); > print $ucs->cluster; > print ("--- Dn ---\n"); > print $ucs->dn; > print ("----------\n"); > > print ("---------- 1 ----\n"); > map { > print '-'x50,"\n"; > print "ID : " . $_->id . "\n"; > print "Severity : " . $_->severity . "\n"; > print "Description : " . $_->description . "\n"; > } grep { > $_->severity !~ /cleared/i; > } $ucs->get_errors; > > print ("---------- 2 ----\n"); > foreach my $chassis ($ucs->chassis) { > print "Chassis " . $chassis->id . " serial : " . > $chassis->serial . "\n" > } > print ("---------- close ucs ----\n"); > #close UCS > $ucs->logout(); > > print ("---------- $states{OK} ----\n"); > exit($states{OK}); > > > > > [cid:image001.jpg@01CE682B.68F4F710]< > http://www.payvision.com/payvision-wins-best-cnp-program-outside-the-us-award
> >
> > Kind regards, > Fernando Coelho > Mission Critical Engineer > > Payvision B.V. > Keizersgracht 668c > 1017 ET Amsterdam > The Netherlands > > Tel: +31 (0) 20 794 23 00 > Mobile: +31 (0) 6 2628 68 41 > Fax: +31 (0) 20 794 23 32 > Email: f.coelho@payvision.com<mailto:f.coelho@payvision.com> > > www.payvision.com<http://www.payvision.com> - Connect and Grow! > blog.payvision.com<http://blog.payvision.com/> - Corporate Blog > > > > Amsterdam | Auckland | Berlin | Hong Kong | London | Macau | Madrid | New > York | Paris | Utah | Singapore | Tokyo > > Disclaimer: > This e-mail message is intended exclusively for the addressee or > addressees. If the e-mail was sent to you by mistake, would you please > contact us immediately by e-mail at service@payvision.com<mailto: > service@payvision.com>. In that case, we also request that you destroy > the e-mail and that you neither use the contents nor disclose them in any > manner to third parties, because the message may contain confidential > information. > > > > > >
Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Fri, 14 Jun 2013 11:48:44 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>
Hi Luke, See below the result with a test script with interconnect: # Open UCS Session my $ucs = new Cisco::UCS ( cluster => $cluster, port => $port, proto => $proto, username => $username, passwd => $password ); print ("--- Login ---\n"); $ucs->login(); print ("---------- 1 ----\n"); my @interconnects = $ucs->get_interconnects; print ("---------- 11 ----\n"); foreach my $ic (@interconnects) { print "Interconnect $ic->id operability is $ic->operability\n"; } print ("---------- 2 ----\n"); my $serial = $ucs->interconnect(A)->serial; print ("---------- 22 ----\n"); print "Interconnect $_ serial: " . $ucs->interconnect($_) . "\n" for qw(A B); print ("---------- 3 ----\n"); my $interconnect = $ucs->get_interconnect(A); print ("---------- 33 ----\n"); print $interconnect->model; print ("---------- close ucs ----\n"); #close UCS $ucs->logout(); Show quoted text
------------------ Result -------------------- ./ucs_test.pl --- Login --- ---------- 1 ---- Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. ---------- 11 ---- Interconnect Cisco::UCS::Interconnect=HASH(0x1805b90)->id operability is Cisco::UCS::Interconnect=HASH(0x1805b90)->operability Interconnect Cisco::UCS::Interconnect=HASH(0x1c30fa0)->id operability is Cisco::UCS::Interconnect=HASH(0x1c30fa0)->operability ---------- 2 ---- ---------- 22 ---- Interconnect A serial: Cisco::UCS::Interconnect=HASH(0x1805b90) Interconnect B serial: Cisco::UCS::Interconnect=HASH(0x1c30fa0) ---------- 3 ---- Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. ---------- 33 ---- N10-S6100---------- close ucs ---- About the version used is the last one form the Git. If you provide need to run your own sample test, please provide me it and I will run it. Kind regards, Fernando Coelho Payvision
-----Original Message----- From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] Sent: vrijdag 14 juni 2013 01:34 To: Fernando Coelho Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue? <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > Hi Fernando, Thanks for the feedback and bug report. The first warning: Use of uninitialized value $id in hash element at /usr/local/share/perl5/Cisco/UCS.pm line 965. Is caused by the use of the chassis() method rather than the get_chassiss() method in the line below: foreach my $chassis ($ucs->get_chassiss) { The chassis() method currently works in this context due to unintended behaviour resulting from lax parameter checking only and will probably be "fixed" in a future version. In not entirely sure what is causing the second error below: Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. But suspect it might stem from the use of chassis() rather than get_chassiss() as above - the similar errors for the interconnect portion of your output are likely due to a similar call to interconnect() rather than get_interconnects(). Unfortunately, the get_objects() methods are required in this context as there is no easy and foolproof way to ensure that any cached copies of retrieved objects represent the total number of objects in the system. Could you make the above suggested changes to your script and let me know if this also resolves the "Warning: <trigMeta>" errors? Also, could you please let me know which version of the Cisco::UCS module you are using? Cheers, -Luke On Thu, Jun 13, 2013 at 7:47 PM, Fernando Coelho via RT < bug-Cisco-UCS@rt.cpan.org> wrote:
> Thu Jun 13 05:47:13 2013: Request 86107 was acted upon. > Transaction: Ticket created by F.Coelho@payvision.com > Queue: Cisco-UCS > Subject: Perl Cisco::UCS issue? > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: F.Coelho@payvision.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > > Hi, > > I am starting to develop a probe for Nagios using the Cisco::UCS and I > have this issue. > See below the error. > > > Using chassis: > > --- Login --- > --- Cookie --- > 1371115985/159c1ec7-1547-46e7-a138-237db76087fd--- Cluster --- > 10.202.27.102--- Dn --- > sys---------- > ---------- 1 ---- > ---------- 2 ---- > Use of uninitialized value $id in hash element at > /usr/local/share/perl5/Cisco/UCS.pm line 965. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Chassis 1 serial : FOX1532GPBX > ---------- close ucs ---- > > Using interconnect: > ---------- 1 ---- > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > ---------- 2 ---- > Interconnect Cisco::UCS::Interconnect=HASH(0x254ff70)->id operability > is Cisco::UCS::Interconnect=HASH(0x254ff70)->operability > Interconnect Cisco::UCS::Interconnect=HASH(0x254a650)->id operability > is Cisco::UCS::Interconnect=HASH(0x254a650)->operability > > Platform: > CENTOS 6.4 x64 > > Perl version is : This is perl, v5.10.1 (*) built for > x86_64-linux-thread-multi > Test-Simple-0.98 > XML-Simple-2.20 > libwww-perl-6.05 > > sample of the code: > # basic requirements > use strict; > use Getopt::Long; > use File::Basename; > use Pod::Usage; > use Data::Dumper; > use Cisco::UCS; > > > code for chassis: > > # Open UCS Session > my $ucs = new Cisco::UCS ( > cluster => $opt_cluster, > port => $port, > proto => $proto, > username => $opt_user, > passwd => $opt_password > ); > > print ("--- Login ---\n"); > $ucs->login(); > > print ("--- Cookie ---\n"); > print $ucs->cookie; > print ("--- Cluster ---\n"); > print $ucs->cluster; > print ("--- Dn ---\n"); > print $ucs->dn; > print ("----------\n"); > > print ("---------- 1 ----\n"); > map { > print '-'x50,"\n"; > print "ID : " . $_->id . "\n"; > print "Severity : " . $_->severity . "\n"; > print "Description : " . $_->description . "\n"; > } grep { > $_->severity !~ /cleared/i; > } $ucs->get_errors; > > print ("---------- 2 ----\n"); > foreach my $chassis ($ucs->chassis) { > print "Chassis " . $chassis->id . " serial : " . > $chassis->serial . "\n" > } > print ("---------- close ucs ----\n"); > #close UCS > $ucs->logout(); > > print ("---------- $states{OK} ----\n"); > exit($states{OK}); > > > > > [cid:image001.jpg@01CE682B.68F4F710]< > http://www.payvision.com/payvision-wins-best-cnp-program-outside-the-u > s-award
> >
> > Kind regards, > Fernando Coelho > Mission Critical Engineer > > Payvision B.V. > Keizersgracht 668c > 1017 ET Amsterdam > The Netherlands > > Tel: +31 (0) 20 794 23 00 > Mobile: +31 (0) 6 2628 68 41 > Fax: +31 (0) 20 794 23 32 > Email: f.coelho@payvision.com<mailto:f.coelho@payvision.com> > > www.payvision.com<http://www.payvision.com> - Connect and Grow! > blog.payvision.com<http://blog.payvision.com/> - Corporate Blog > > > > Amsterdam | Auckland | Berlin | Hong Kong | London | Macau | Madrid | > New York | Paris | Utah | Singapore | Tokyo > > Disclaimer: > This e-mail message is intended exclusively for the addressee or > addressees. If the e-mail was sent to you by mistake, would you please > contact us immediately by e-mail at service@payvision.com<mailto: > service@payvision.com>. In that case, we also request that you destroy > the e-mail and that you neither use the contents nor disclose them in > any manner to third parties, because the message may contain > confidential information. > > > > > >
Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Fri, 14 Jun 2013 22:20:14 +1000
To: bug-Cisco-UCS [...] rt.cpan.org
From: Luke Poskitt <luke.poskitt [...] gmail.com>
Hi Fernando, If possible, could you please edit Cisco/UCS.pm and add the following at line 267: if ( defined $class_id ) { use Data::Dumper; print "\n---------- DEBUG --------\n", Dumper( $xml ) ,"\n---------- DEBUG --------\n" } Then, temporarily add an exit after the call to get_interconnects() in your script and then run it again, and copy and paste the output between the "---------- DEBUG ---------" lines into the ticket (please check the output thoroughly and remove any private, personal or company specific information). Many thanks, -Luke On Fri, Jun 14, 2013 at 7:49 PM, Fernando Coelho via RT < bug-Cisco-UCS@rt.cpan.org> wrote: Show quoted text
> Queue: Cisco-UCS > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Luke, > > See below the result with a test script with interconnect: > > # Open UCS Session > my $ucs = new Cisco::UCS ( > cluster => $cluster, > port => $port, > proto => $proto, > username => $username, > passwd => $password > ); > > print ("--- Login ---\n"); > $ucs->login(); > > print ("---------- 1 ----\n"); > my @interconnects = $ucs->get_interconnects; > print ("---------- 11 ----\n"); > foreach my $ic (@interconnects) { > print "Interconnect $ic->id operability is > $ic->operability\n"; > } > > print ("---------- 2 ----\n"); > my $serial = $ucs->interconnect(A)->serial; > print ("---------- 22 ----\n"); > print "Interconnect $_ serial: " . $ucs->interconnect($_) . "\n" > for qw(A B); > > print ("---------- 3 ----\n"); > my $interconnect = $ucs->get_interconnect(A); > print ("---------- 33 ----\n"); > print $interconnect->model; > > print ("---------- close ucs ----\n"); > #close UCS > $ucs->logout(); > > ------------------ Result -------------------- > ./ucs_test.pl > --- Login --- > ---------- 1 ---- > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > ---------- 11 ---- > Interconnect Cisco::UCS::Interconnect=HASH(0x1805b90)->id operability is > Cisco::UCS::Interconnect=HASH(0x1805b90)->operability > Interconnect Cisco::UCS::Interconnect=HASH(0x1c30fa0)->id operability is > Cisco::UCS::Interconnect=HASH(0x1c30fa0)->operability > ---------- 2 ---- > ---------- 22 ---- > Interconnect A serial: Cisco::UCS::Interconnect=HASH(0x1805b90) > Interconnect B serial: Cisco::UCS::Interconnect=HASH(0x1c30fa0) > ---------- 3 ---- > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > ---------- 33 ---- > N10-S6100---------- close ucs ---- > > > About the version used is the last one form the Git. > If you provide need to run your own sample test, please provide me it and > I will run it. > > Kind regards, > > Fernando Coelho > Payvision > > -----Original Message----- > From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] > Sent: vrijdag 14 juni 2013 01:34 > To: Fernando Coelho > Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue? > > <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Fernando, > > Thanks for the feedback and bug report. The first warning: > > Use of uninitialized value $id in hash element at > /usr/local/share/perl5/Cisco/UCS.pm line 965. > > Is caused by the use of the chassis() method rather than the > get_chassiss() method in the line below: > > foreach my $chassis ($ucs->get_chassiss) { > > The chassis() method currently works in this context due to unintended > behaviour resulting from lax parameter checking only and will probably be > "fixed" in a future version. In not entirely sure what is causing the > second error below: > > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > But suspect it might stem from the use of chassis() rather than > get_chassiss() as above - the similar errors for the interconnect portion > of your output are likely due to a similar call to interconnect() rather > than get_interconnects(). Unfortunately, the get_objects() methods are > required in this context as there is no easy and foolproof way to ensure > that any cached copies of retrieved objects represent the total number of > objects in the system. > > Could you make the above suggested changes to your script and let me know > if this also resolves the "Warning: <trigMeta>" errors? Also, could you > please let me know which version of the Cisco::UCS module you are using? > > Cheers, > > -Luke > > > On Thu, Jun 13, 2013 at 7:47 PM, Fernando Coelho via RT < > bug-Cisco-UCS@rt.cpan.org> wrote: >
> > Thu Jun 13 05:47:13 2013: Request 86107 was acted upon. > > Transaction: Ticket created by F.Coelho@payvision.com > > Queue: Cisco-UCS > > Subject: Perl Cisco::UCS issue? > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: F.Coelho@payvision.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > > > > > Hi, > > > > I am starting to develop a probe for Nagios using the Cisco::UCS and I > > have this issue. > > See below the error. > > > > > > Using chassis: > > > > --- Login --- > > --- Cookie --- > > 1371115985/159c1ec7-1547-46e7-a138-237db76087fd--- Cluster --- > > 10.202.27.102--- Dn --- > > sys---------- > > ---------- 1 ---- > > ---------- 2 ---- > > Use of uninitialized value $id in hash element at > > /usr/local/share/perl5/Cisco/UCS.pm line 965. > > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > Chassis 1 serial : FOX1532GPBX > > ---------- close ucs ---- > > > > Using interconnect: > > ---------- 1 ---- > > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > Warning: <trigMeta> element has non-unique value in 'name' key attribute: > > at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > ---------- 2 ---- > > Interconnect Cisco::UCS::Interconnect=HASH(0x254ff70)->id operability > > is Cisco::UCS::Interconnect=HASH(0x254ff70)->operability > > Interconnect Cisco::UCS::Interconnect=HASH(0x254a650)->id operability > > is Cisco::UCS::Interconnect=HASH(0x254a650)->operability > > > > Platform: > > CENTOS 6.4 x64 > > > > Perl version is : This is perl, v5.10.1 (*) built for > > x86_64-linux-thread-multi > > Test-Simple-0.98 > > XML-Simple-2.20 > > libwww-perl-6.05 > > > > sample of the code: > > # basic requirements > > use strict; > > use Getopt::Long; > > use File::Basename; > > use Pod::Usage; > > use Data::Dumper; > > use Cisco::UCS; > > > > > > code for chassis: > > > > # Open UCS Session > > my $ucs = new Cisco::UCS ( > > cluster => $opt_cluster, > > port => $port, > > proto => $proto, > > username => $opt_user, > > passwd => $opt_password > > ); > > > > print ("--- Login ---\n"); > > $ucs->login(); > > > > print ("--- Cookie ---\n"); > > print $ucs->cookie; > > print ("--- Cluster ---\n"); > > print $ucs->cluster; > > print ("--- Dn ---\n"); > > print $ucs->dn; > > print ("----------\n"); > > > > print ("---------- 1 ----\n"); > > map { > > print '-'x50,"\n"; > > print "ID : " . $_->id . "\n"; > > print "Severity : " . $_->severity . "\n"; > > print "Description : " . $_->description . "\n"; > > } grep { > > $_->severity !~ /cleared/i; > > } $ucs->get_errors; > > > > print ("---------- 2 ----\n"); > > foreach my $chassis ($ucs->chassis) { > > print "Chassis " . $chassis->id . " serial : " . > > $chassis->serial . "\n" > > } > > print ("---------- close ucs ----\n"); > > #close UCS > > $ucs->logout(); > > > > print ("---------- $states{OK} ----\n"); > > exit($states{OK}); > > > > > > > > > > [cid:image001.jpg@01CE682B.68F4F710]< > > http://www.payvision.com/payvision-wins-best-cnp-program-outside-the-u > > s-award
> > >
> > > > Kind regards, > > Fernando Coelho > > Mission Critical Engineer > > > > Payvision B.V. > > Keizersgracht 668c > > 1017 ET Amsterdam > > The Netherlands > > > > Tel: +31 (0) 20 794 23 00 > > Mobile: +31 (0) 6 2628 68 41 > > Fax: +31 (0) 20 794 23 32 > > Email: f.coelho@payvision.com<mailto:f.coelho@payvision.com> > > > > www.payvision.com<http://www.payvision.com> - Connect and Grow! > > blog.payvision.com<http://blog.payvision.com/> - Corporate Blog > > > > > > > > Amsterdam | Auckland | Berlin | Hong Kong | London | Macau | Madrid | > > New York | Paris | Utah | Singapore | Tokyo > > > > Disclaimer: > > This e-mail message is intended exclusively for the addressee or > > addressees. If the e-mail was sent to you by mistake, would you please > > contact us immediately by e-mail at service@payvision.com<mailto: > > service@payvision.com>. In that case, we also request that you destroy > > the e-mail and that you neither use the contents nor disclose them in > > any manner to third parties, because the message may contain > > confidential information. > > > > > > > > > > > >
> > >

Message body is not shown because it is too large.

Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Fri, 14 Jun 2013 14:41:07 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Mon, 17 Jun 2013 09:10:54 +1000
To: bug-Cisco-UCS [...] rt.cpan.org
From: Luke Poskitt <luke.poskitt [...] gmail.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Mon, 17 Jun 2013 09:44:26 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>

Message body is not shown because it is too large.

On Mon Jun 17 03:44:44 2013, F.Coelho@payvision.com wrote: Show quoted text
> Hi Luke, > > XML::Simple version: > perl -MXML::Simple -le 'print $XML::Simple::VERSION' > 2.20 > > Result TEST: > > # ./ucs_test.pl > --- Login --- > ---------- 1 ---- > Warning: <trigMeta> element has non-unique value in 'name' key > attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. > Warning: <trigMeta> element has non-unique value in 'name' key > attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. > > > Code modified on UCS.pm > > sub _ucsm_request { > my ($self, $content, $class_id) = @_; > > undef $self->{error}; > $self->{req}->content($content); > my $res = $self->{ua}->request($self->{req}); > > $self->error($res->status_line) unless $res->is_success; > > my $xml = ( $class_id > ? $self->{parser}->XMLin($res->content, > KeyAttr => $class_id) > : $self->{parser}->XMLin($res->content) > ); > # debug > if ( defined $class_id ) { use Data::Dumper; print "\n---------- > DEBUG --------\n", Dumper( $xml ), $res->content, "\n---------- DEBUG > --------\n" > } > > return ( $xml->{errorCode} > ? do { > $self->{error} = ( $xml-
> >{'errorDescr'} ? $xml->{'errorDescr'} : 'Unspecified error' );
> undef > } > : $xml > ); > } > > > > > Kind regards, > > Fernando Coelho > Payvision >
Hi Fernando, Sorry for the run-around but that did not capture what I was hoping it might; could you change the debug line to: use Data::Dumper; print "\n---------- DEBUG --------\n", Dumper( $xml ), $res->content, "\n---------- DEBUG --------\n"; _NOTE_ that this will output several DEBUG sections and a lot of data that could potentially contain sensitive detail of your implementation so please feel free to sanitise any IP addresses, hostnames, etc. If you prefer, please feel free to send the output to me directly at luke.poskitt@gmail.com rather than include it in the ticket notes (to prevent any unsanitised detail from remaining on public record).
Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Tue, 25 Jun 2013 13:05:55 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>

Message body is not shown because it is too large.

Hi Fernando, I have sent a response to your personal email (26-06-2013), please let me know if the recommended fix resolved your issue or if you have any further questions or problems. Cheers, -Luke On Tue Jun 25 07:06:19 2013, F.Coelho@payvision.com wrote: Show quoted text
> Hi Luke, > > I have sent the result to your personal email (18/06/2013). > Please check. > > Kind regards, > > Fernando Coelho > Payvision >
Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Mon, 1 Jul 2013 09:28:45 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>
Hi Luke, I have never received your email. Can you send it again? Kind regards, Fernando Coelho Payvision Show quoted text
-----Original Message----- From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] Sent: maandag 1 juli 2013 00:37 To: Fernando Coelho Subject: [rt.cpan.org #86107] Perl Cisco::UCS issue? <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > Hi Fernando, I have sent a response to your personal email (26-06-2013), please let me know if the recommended fix resolved your issue or if you have any further questions or problems. Cheers, -Luke On Tue Jun 25 07:06:19 2013, F.Coelho@payvision.com wrote:
> Hi Luke, > > I have sent the result to your personal email (18/06/2013). > Please check. > > Kind regards, > > Fernando Coelho > Payvision >
Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Mon, 1 Jul 2013 22:00:31 +1000
To: bug-Cisco-UCS [...] rt.cpan.org
From: Luke Poskitt <luke.poskitt [...] gmail.com>
Hi Fernando, My bad; your MTA rejected the first email I sent as it had a test script attached, I removed the extension and resent but it looks like it was smart enough to guess that it was still a possibly nasty file type. My original email is below, I'll attach the test script to the CPAN RT. Cheers, ---- Hi Fernando, My apologies for the delay in replying. Unfortunately, despite spending a lot of time today trying to recreate the error/warning output that you are receiving, I can't seem to reproduce it. The odd thing is that I am using the same version of XML::Simple (2.20) and the same version of UCSM (2.1(1e)A). I know why the error would be occurring (the three trigMeta elements in the output provided have no value for the id attribute), but for some reason it is being silently ignored in my testing. I've attached a test script that simply parses the problem XML - if you have time to do so, I'd be interested in knowing if executing this script generates any errors for you. Fortunately, there is a simple (ugly) fix that should resolve this issue however I haven't had time to thoroughly test it so have not yet pushed the change to CPAN. I have pushed it to github though so you should be able to download and test with the new version - I've also included the diff below should you just want to make the change to the module yourself: diff --git a/lib/Cisco/UCS.pm b/lib/Cisco/UCS.pm index 898c988..f633990 100644 --- a/lib/Cisco/UCS.pm +++ b/lib/Cisco/UCS.pm @@ -267,7 +267,7 @@ sub _ucsm_request { my $xml = ( $class_id ? $self->{parser}->XMLin($res->content, KeyAttr => $class_id) - : $self->{parser}->XMLin($res->content) + : $self->{parser}->XMLin($res->content, KeyAttr => [ 'name', 'key', 'id', 'intId' ] ) ); return ( $xml->{errorCode} Cheers, -Luke --- On Mon, Jul 1, 2013 at 5:29 PM, Fernando Coelho via RT < bug-Cisco-UCS@rt.cpan.org> wrote: Show quoted text
> Queue: Cisco-UCS > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Luke, > > I have never received your email. > Can you send it again? > > Kind regards, > > Fernando Coelho > Payvision > > -----Original Message----- > From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] > Sent: maandag 1 juli 2013 00:37 > To: Fernando Coelho > Subject: [rt.cpan.org #86107] Perl Cisco::UCS issue? > > <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Fernando, > > I have sent a response to your personal email (26-06-2013), please let me > know if the recommended fix resolved your issue or if you have any further > questions or problems. > > Cheers, > > -Luke > > On Tue Jun 25 07:06:19 2013, F.Coelho@payvision.com wrote:
> > Hi Luke, > > > > I have sent the result to your personal email (18/06/2013). > > Please check. > > > > Kind regards, > > > > Fernando Coelho > > Payvision > >
> > >
Subject: RE: [rt.cpan.org #86107] Perl Cisco::UCS issue?
Date: Mon, 1 Jul 2013 17:01:27 +0200
To: "bug-Cisco-UCS [...] rt.cpan.org" <bug-Cisco-UCS [...] rt.cpan.org>
From: Fernando Coelho <F.Coelho [...] payvision.com>
Hi luke, I have updated the ucs package (from git) ./ucs_test.pl Show quoted text
--- Login --- ---------- 1 ---- Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. Warning: <trigMeta> element has non-unique value in 'name' key attribute: at /usr/local/share/perl5/Cisco/UCS.pm line 268. So still the same. Kind regards, Fernando Coelho Payvision
-----Original Message----- From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] Sent: maandag 1 juli 2013 14:01 To: Fernando Coelho Subject: Re: [rt.cpan.org #86107] Perl Cisco::UCS issue? <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > Hi Fernando, My bad; your MTA rejected the first email I sent as it had a test script attached, I removed the extension and resent but it looks like it was smart enough to guess that it was still a possibly nasty file type. My original email is below, I'll attach the test script to the CPAN RT. Cheers, ---- Hi Fernando, My apologies for the delay in replying. Unfortunately, despite spending a lot of time today trying to recreate the error/warning output that you are receiving, I can't seem to reproduce it. The odd thing is that I am using the same version of XML::Simple (2.20) and the same version of UCSM (2.1(1e)A). I know why the error would be occurring (the three trigMeta elements in the output provided have no value for the id attribute), but for some reason it is being silently ignored in my testing. I've attached a test script that simply parses the problem XML - if you have time to do so, I'd be interested in knowing if executing this script generates any errors for you. Fortunately, there is a simple (ugly) fix that should resolve this issue however I haven't had time to thoroughly test it so have not yet pushed the change to CPAN. I have pushed it to github though so you should be able to download and test with the new version - I've also included the diff below should you just want to make the change to the module yourself: diff --git a/lib/Cisco/UCS.pm b/lib/Cisco/UCS.pm index 898c988..f633990 100644 --- a/lib/Cisco/UCS.pm +++ b/lib/Cisco/UCS.pm @@ -267,7 +267,7 @@ sub _ucsm_request { my $xml = ( $class_id ? $self->{parser}->XMLin($res->content, KeyAttr => $class_id) - : $self->{parser}->XMLin($res->content) + : $self->{parser}->XMLin($res->content, KeyAttr + => [ 'name', 'key', 'id', 'intId' ] ) ); return ( $xml->{errorCode} Cheers, -Luke --- On Mon, Jul 1, 2013 at 5:29 PM, Fernando Coelho via RT < bug-Cisco-UCS@rt.cpan.org> wrote:
> Queue: Cisco-UCS > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Luke, > > I have never received your email. > Can you send it again? > > Kind regards, > > Fernando Coelho > Payvision > > -----Original Message----- > From: Luke Poskitt via RT [mailto:bug-Cisco-UCS@rt.cpan.org] > Sent: maandag 1 juli 2013 00:37 > To: Fernando Coelho > Subject: [rt.cpan.org #86107] Perl Cisco::UCS issue? > > <URL: https://rt.cpan.org/Ticket/Display.html?id=86107 > > > Hi Fernando, > > I have sent a response to your personal email (26-06-2013), please let > me know if the recommended fix resolved your issue or if you have any > further questions or problems. > > Cheers, > > -Luke > > On Tue Jun 25 07:06:19 2013, F.Coelho@payvision.com wrote:
> > Hi Luke, > > > > I have sent the result to your personal email (18/06/2013). > > Please check. > > > > Kind regards, > > > > Fernando Coelho > > Payvision > >
> > >