Table of contents


The NOC team required an export of data for their OSS systems. This data needed to be included in a series of Excel Spreadsheets which were loaded by an ETL for upload into the OSS.






The code for this solution is included in the NMIS9 contrib folder which is available in the installation or from NMIS9@GitHub, it will be in the folder nmis9/contrib/noc_inventory_export

A good option to install is to create a util folder e.g. /usr/local/nmis9/util and then create a symbolic link so the file will run with the correct paths.

Some handy commands (sudo might be required):

sudo mkdir /usr/local/nmis9/util 
sudo ln -s /usr/local/nmis9/contrib/noc_inventory_export/ /usr/local/nmis9/util/
sudo ln -s /usr/local/nmis9/contrib/noc_inventory_export/ /usr/local/nmis9/util/
sudo /usr/local/nmis9/bin/nmis-cli act=fixperms

Run it

To run it on a single node, check the embedded help.

              - 2.0.0

NAME -  Exports nodes and ports from NMIS into an Excel spredsheet.

SYNOPSIS [options...] dir=<directory> [option=value] ...

       The program Exports NMIS nodes into an Excel spreadsheet in
       the specified directory with the required 'dir' parameter. The command
       also creates Comma Separated Value (CSV) files in the same directory.
       If the '--interfaces' option is specified, Interfaces will be
       exported as well.  They are not included by default because there may
       thousands of them on some devices.

 --debug=[1-9]            - global option to print detailed messages
 --help                   - display command line usage
 --interfaces             - include interfaces in the export
 --usage                  - display a brief overview of command syntax
 --version                - print a version message and exit

     dir=<directory>         - The directory where the files should be stored.
                                Both the Excel spreadsheet and the CSV files
                                will be stored in this directory. The
                                directory should exist and be writable.
     [conf=<filename>]       - The location of an alternate configuration file.
                                (default: '/usr/local/nmis9/util/../conf')
                             - Set the debug level.
     [separator=<character>] - A character to be used as the separator in the
                                 CSV files. The words 'comma' and 'tab' are
                                 understood. Other characters will be taken
                                 literally. (default: 'tab')
     [xls=<filename>]        - The name of the XLS file to be created in the
                                 directory specified using the 'dir' parameter'.
                                 (default: 'oss_export.xlsx')
     The following exit values are returned:
     0 Success
     215 Failure

EXAMPLE dir=/tmp separator=comma

  • No labels