Name

nnmdeleteattributes.ovpl — delete custom attributes from a comma separated values (CSV) file or line for Nodes, Interfaces, and PhysComps (Cards/Chassis).

SYNOPSIS

nnmdeleteattributes.ovpl [-?] -t <type> (-f <path & filename of csv file>) | (-s <"csv formatted line">) [-u <username> -p <password>] [-jndiHost <hostName> Default: localhost] [-jndiPort <port> Default: 1099]

DESCRIPTION

nnmdeleteattributes.ovpl allows custom attributes to be deleted from a comma separated values (CSV) file, such as a .csv file from Microsoft™ Excel. This command is useful if you have previously created custom attributes that are no longer needed. This command will delete attributes from either nodes, interfaces, or phys comps. For nodes, once the attributes are deleted, any nodes in a node group formed by referencing those attributes will disappear from the node group.

Parameters

nnmdeleteattributes.ovpl supports the following options:

-?

Prints the usage statement.

-t <type>

Supply the object type to delete attributes on. Must be either "node", "interface", or "physcomp".

-f <path & filename of csv file>

Supply the CSV file name (with path, e.g. /tmp/csvfile.csv) that contains the custom attributes to delete.

-s <"csv formatted line">

Supply a single CSV formatted line. Eliminates the need to create a file for a small change.

-u <username>

Supply the NNMi administrator username to run the script. This script requires the NNMi administrator username unless you use an nnm.properties file. See the nnm.properties.4 reference page for more information.

-p <password>

Supply the NNMi administrator password to run the script. This script requires the NNMi administrator password unless you use an nnm.properties file. See the nnm.properties.4 reference page for more information.

-jndiHost <serverName>

The server JNDI host; default is localhost.

-jndiPort <port>

The server JNDI port; default is 1099.

Syntax of Comma Separated File for Nodes

The CSV file you supply must have the following syntax for deleting attributes from nodes.

Empty lines are ignored.

Lines that being with the # character are ignored.

  • Column 1(A) : Node DNS | IP Address

    Specify the DNS name of the node OR the IP address. This field is compulsory.

  • Column 2(B) : Attribute Name

    The name of the custom attribute.

Additional attribute names may be specified on the same line or on a separate line with the same node DNS | IP Address.

Example lines:

192.168.1.1,Project,Service Type

192.168.1.1,Asset Tracking

192.168.2.2,Project,Service Type,Asset Tracking

Syntax of Comma Separated File for Interfaces

The CSV file you supply must have the following syntax for deleting attributes from interfaces.

Empty lines are ignored.

Lines that being with the # character are ignored.

  • Column 1(A) : Node DNS | IP Address

    Specify the DNS name of the node OR the IP address. This field is compulsory.

  • Column 2(B) : Interface Id

    Specify the identifier of the interface on the node specified in the previous field. The value may be the interface index, alias, name or description and is searched in this same order. All matching interfaces have the attribute(s) deleted. This field is compulsory.

  • Column 3(C) : Attribute Name

    The name of the custom attribute.

Additional attribute names may be specified on the same line or on a separate line with the same node DNS | IP Address and Interface Id.

Example lines:

192.168.1.1,1001,Project,Service Type

192.168.1.1,1001,Asset Tracking

192.168.2.2,A1,Project,Service Type,Asset Tracking

Syntax of Comma Separated File For PhysComp Attributes

The CSV file you supply must have the following syntax for adding attributes on PhysComps (Cards/Chassis).

Empty lines are ignored.

Lines that being with the # character are ignored.

  • Column 1(A) : Node DNS | IP Address

    Specify the DNS name of the node OR the IP address. This field is compulsory.

  • Column 2(B) : PhysComp Id

    Specify the identifier of the phys comp on the node specified in the previous field. The value may be the phys comp physical index, name or description and is searched in this same order. All matching phys comps will have the attribute(s) deleted. This field is compulsory.

  • Column 3(C) : PhysComp Type

    The name to identify the type of PhysComp. "card" and "chassis" are valid types.

  • Column 4(D) : Attribute Name

    The name of the custom attribute.

Additional attribute name and value pairs may be specified on the same line or on a separate line with the same node DNS | IP Address, PhysComp Id, and PhysComp Type.

Example lines:

192.168.1.1,7,chassis,Location,Service Type

192.168.1.1,7,chassis,Asset Tracking

192.168.2.2,/AmdFE,card,Location,Service Type,Asset Tracking

Use of Microsoft Excel

Microsoft Excel is a handy tool to create comma separated files, but .csv files do not maintain the Excel spreadsheet's column width, comments, etc. It is recommended that you store a nnmdeleteattributes.ovpl input file as a native .xls format, and then perform File:Save As... to create a .csv file. Then you can add Excel comments to the file, make columns wider, and you do not need to worry about escaping the comma character.

EXAMPLES

Sample CSV file contents for nodes:

192.168.2.2,Project,Service Type,Asset Tracking

To delete the Node custom attributes from a CSV file:

nnmdeleteattributes.ovpl -t node -f /tmp/test.csv

To delete the Node custom attributes from the command line:

nnmdeleteattributes.ovpl -t node -s "192.168.1.1,Project"

Sample CSV file contents for interfaces:

192.168.2.2,1001,Project,Service Type,Asset Tracking

To delete the Interface custom attributes from a CSV file:

nnmdeleteattributes.ovpl -t interface -f /tmp/test.csv

To delete the Interface custom attributes from the command line:

nnmdeleteattributes.ovpl -t interface -s "192.168.1.1,Project"

Sample phys comp CSV file (/tmp/test.csv) contents:

192.168.2.2,7,chassis,Location,Service Type,Asset Tracking

To delete the Phys Comp custom attributes from a CSV file:

nnmdeleteattributes.ovpl -t physcomp -f /tmp/test.csv

To load a single PhysComp custom attributes line from the command line:

nnmdeleteattributes.ovpl -t physcomp -s "192.168.1.1,/AmdFE,card,Project"

Error Codes

There are several error codes that help identify problems:

  • INFO : information message.

  • ATTR_ERROR : A problem was found with the specified attribute.

  • DEL_FAIL_ERROR : An attempt to delete the specified attribute failed.

  • OBJECT_ERROR : The specified object was not found.

  • BAD_LINE_ERROR : The line provided is not properly formatted.

  • IO_ERROR : The CSV file was not found or is not readable.

  • BAD_NAME_WARNING : The specified attribute name is too long (50 character maximum).

  • BAD_VALUE_WARNING : The specified value is too long (2000 character maximum).

AUTHOR

nnmdeleteattributes.ovpl was developed by Hewlett Packard Enterprise.

FILES

Windows: %NNM_BIN%\nnmdeleteattributes.ovpl

UNIX: $NNM_BIN/nnmdeleteattributes.ovpl

SEE ALSO

nnmloadattributes.ovpl (1M) , nnmloadnodegroups.ovpl (1M) , nnm.properties (4) .

Return to Reference Pages Index