Menu

SM 13.1 and Use of uninitialized value

2014-02-24
2024-01-04
  • Josh Malone

    Josh Malone - 2014-02-24

    Hi,

    So I'm finally getting around to upgrading from 12.something to 13.1. I've merged my ThisSite.pm and things are mostly running smoothly. However, I am getting a large number of "Use of uninitialized value" warnings:

    Use of uninitialized value $PortName in concatenation (.) or string at /opt/services/switchmap-13.1/PopulatePorts.pm line 155.
    Use of uninitialized value $PortName in hash element at /opt/services/switchmap-13.1/PopulatePorts.pm line 156.

    and

    Use of uninitialized value $ifName in hash element at /opt/services/switchmap-13.1/GetCiscoPortTrunkStatuses.pm line 76.

    Is this a known migration issue or is it obvious what I'm doing wrong? I looked (well, glanced) at the code and it wasn't obvious to me what was wrong.

    Thanks,

    -Josh

     
  • Pete Siemsen

    Pete Siemsen - 2014-02-25

    This isn't a known issue. It seems that you have a switch that doesn't support the Cisco Stack MIB, but does support the Cisco VTP MIB. What kind of switch is it?

    I can add some logic that avoids the errors. Would you mind if I sent you a special version of PopulatePorts.pm to try?

     
    • Josh Malone

      Josh Malone - 2014-02-25

      I must confess that I'm only the Linux guy and know little about our switch
      fabric. However, I'm pretty sure we only have Cisco and Netgear switches.
      Is there a way to identify the offending switch by ip or some such?

      Sure, I'll test whatever you've got! This is a new server that's not in
      production yet. I'm also upgrading Nagios and it's being a pain. (4.x has
      some bugs yet)

      Thanks
      On Feb 24, 2014 8:13 PM, "Pete Siemsen" siemsen@users.sf.net wrote:

      This isn't a known issue. It seems that you have a switch that doesn't
      support the Cisco Stack MIB, but does support the Cisco VTP MIB. What kind
      of switch is it?

      I can add some logic that avoids the errors. Would you mind if I sent you
      a special version of PopulatePorts.pm to try?


      SM 13.1 and Use of uninitialized valuehttps://sourceforge.net/p/switchmap/discussion/378009/thread/0f596ef6/?limit=25#692b

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/switchmap/discussion/378009/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Pete Siemsen

        Pete Siemsen - 2014-02-25

        Ok, here's a PopulatePorts.pm that has a little extra logging code. Please replace your file with this one, and then run SwitchMap like so:

        SwitchMap.pl -d 5 -f

        That will cause it to create a log file named SwitchMap.log in the current directory. After you run it, please send me the SwitchMap.log file. To avoid cluttering up SourceForge, please email the file directly to me at siemsen@ucar.edu.

         
        • Josh Malone

          Josh Malone - 2014-03-05

          Did the log file reveal anything noteworthy about what's going on?

          On Tue, Feb 25, 2014 at 11:51 AM, Pete Siemsen siemsen@users.sf.net wrote:

          Ok, here's a PopulatePorts.pm that has a little extra logging code. Please
          replace your file with this one, and then run SwitchMap like so:

          SwitchMap.pl -d 5 -f

          That will cause it to create a log file named SwitchMap.log in the current
          directory. After you run it, please send me the SwitchMap.log file. To avoid
          cluttering up SourceForge, please email the file directly to me at
          siemsen@ucar.edu.


          SM 13.1 and Use of uninitialized value


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/switchmap/discussion/378009/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           
  • Pete Siemsen

    Pete Siemsen - 2014-03-07

    Josh,

    Yes, the log file was revealing. Looks like you're processing 65 switches with SwitchMap. The first set of "uninitialized value" errors (generated by line 155 of PopulatePorts.pm) are all caused by one of your switches: 10.2.254.10.

    It's a Cisco Nexus 5000. I've had issues with poor SNMP support on those devices. It's running version 5.1(3)N2(1) of the NX-OS software. It's possible that upgrading the software would fix the problem.
    Per http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus5000/sw/release/recommended_releases/recommended_nx-os_releases.html, as of 4/19/2013, Cisco recommended 5.1(3)N2(1c) as the minimum recommended version, and 5.2(1)N1(4) as the recommended release. That was a year ago. If you can influence the folks that administer that switch, an upgrade might solve the problem.

    But that's a stinkin' mealy-mouthed dodge on my part :-) SwitchMap shouldn't barf just because a switch produces some improper SNMP tables. I've modified the attached PopulatePorts.pm so that it simply ignores the bad data. This means there may be missing data in the web page that SwitchMap produces for your Nexus, but it's better than runtime errors.

    To fix the other "uninitialized value" errors, please try swapping in the attached GetCiscoPortIsTrunking.pm.

    With those two modified files, SwitchMap might run without error. Maybe :-)

    Thanks,

    -- Pete

     
  • Josh Malone

    Josh Malone - 2014-03-07

    Pete,

    Thanks. I'll talk with my network guy regarding the Nexus OS. In the meantime, I don't see the PopulatePorts.pm as an attachment.

    Thanks again!

    -Josh

     
  • Pete Siemsen

    Pete Siemsen - 2014-03-07

    Ooops. Here it is.

     
  • Armin

    Armin - 2020-06-18

    Hi Pete,

    Thanks for your input. I use Switchmap nice for a long time, it is a wonderful tool.
    I recently made a switch IOS update to test for a rollout. Then these error messages started below:

    Use of uninitialized value in hash element at /var/www/switchmap/GetPortNameToVlanTable.pm line 36.
    Use of uninitialized value in hash element at /var/www/switchmap/GetPortNameToVlanTable.pm line 36.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 231.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 231.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 82.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 82.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 475.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 475.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.

    Then I followed your advice and changed the above files. Unfortunately, without success, now I get the following error messages:

    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.

    Can you help me?
    TIA

     
  • Armin

    Armin - 2020-07-07

    somebody can help me, i get these error messages since some time. with every switch exchange there are 2 error messages. please help me. thanks

    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 131.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 399.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value in hash element at /var/www/switchmap/PopulatePorts.pm line 78.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/PopulatePorts.pm line 644.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 104.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.
    Use of uninitialized value $ifName in hash element at /var/www/switchmap/GetCiscoPortTrunkStatuses.pm line 152.

     

Log in to post a comment.