Name

nnmfindattachedswport.sh — Find the switch port to which the input end node is attached

SYNOPSIS

nnmfindattachedswport.sh [-u <user>] [-p <password>] { -i <end node file> | -n <end node> } [-o <output file>]

DESCRIPTION

The nnmfindattachedswport.sh script displays the switch port that is connnected to an end node. When using the nnmfindattachedswport.sh script, specify the end node as a MAC address, an IP address, or a hostname. Specify the MAC address in upper case with no leading 0x or 0X. You can also specify the input as a seed file, using one line per entry within the seed file.

The display consists of the following:

  • The end node.

  • The switch hostname.

  • The interface name of the switch port that is connected to an end node.

  • The VLAN name that the end node belongs to.

  • The VLAN ID that the end node belongs to.

  • A status code for the interface.

The status code indicates either Success, if NNMi successfully retrieved the end node information, or an error code. The display is in Comma Separated Value (CSV) format. If any of the values are not present then NNMi displays the value -1 instead. NNMi indicates the completion of the script by displaying a CSV with all the values being -1.

NNMi initially displays a header naming each of the values in the CSV. There is an option to redirect the output to a file. The file can then be imported into Microsoft™ Excel.

Parameters

nnmfindattachedswport.sh supports the following parameters:

-u <user name>

Supply an NNMi user name to use when running the script. The user could be system, an administrator or a Level 2 operator.

-p <password>

Supply the password for the user.

-i <end node file>

Use -i to provide an input file containing a list of end nodes. NNMi then searches for the switch port connected to each end node. The file should have only one entry per line. The value on each line could be a MAC address, an IP address or a hostname. The MAC address needs to be specified in upper case with no leading 0x or 0X. This parameter is required if the -n is not specified.

-n <end node>

Use the -n to provide an end node for the nnmfindattachedswport.sh script. The nnmfindattachedswport.sh script finds the switch port that is connected to this end node. The end node could be a MAC address, an IP address or a hostname. The MAC address needs to be specified in upper case with no leading 0x or 0X.

-o <output file>

Use -o to supply a file name to which the output of the script will be redirected.

EXAMPLES

An example of an input file is given below:

      10.45.130.2
      # this is a comment line
      con5.acme.com
      000087D064CB
      10.12.149.4
      laserj.acme.com
      

An example of the display looks similar to the following:

      EndNode,SwitchName,IfName,VLANName,VLANId,StatusCode
      10.45.130.2,-1,-1,-1,-1,UNABLE_TO_LOCATE_ENTRY_IN_FDB
      con5.acme.com,-1,-1,-1,-1,UNABLE_TO_LOCATE_ENTRY_IN_ARP_CACHE
      000087D064CB,10.45.130.143,2/1,Network_B_IPv4,4,SUCCESS
      10.12.149.4,sw1-loop0.acme.com,Fa2/21,VLAN0490,490,SUCCESS
      laserj.acme.com,sw1-loop0.acme.com,Fa2/12,mpls-intercon,169,SUCCESS
      -1,-1,-1,-1,-1,-1
      

AUTHOR

nnmfindattachedswport.sh was developed by Hewlett Packard Enterprise.

Return to Reference Pages Index