Child pages
  • noc csv-import
Skip to end of metadata
Go to start of metadata


noc csv-import – load data from CSV file


noc csv-import [options] <model> <path1> [ .. <pathN>]


Upload data from CSV files <path1> .. <pathN> to database model <model>

To see the list of available models, run

/opt/noc$ ./noc csv-import

without parameters




Verbosity level:

  • 0 - minimal output
  • 1 - normal output
  • 2 - all output
--tracebackPrint traceback on exception
--r <action>

When loaded record is already exists in database do:

  • fail - stop loading and display an error message
  • skip - skip duplicated record and continue processing (do not update)
  • update - update changed fields and continue processing

CSV file format

CSV file must be in UTF8, columns separated by commas (,). First row must contain field names, following rows contain records, one row per one record. Rows must be separated by newlines (\n).

To dereference foreign key use doubled underscore notation. i.e. to dereference foreign key user by username set user__username as field name.

To get a list of all available fields in model use

/opt/noc$ ./noc csv-export --template <model>


Display as list of models

 /opt/noc$ ./noc csv-import 

Import file f1 to ip.address, fail if duplicated addresses found

/opt/noc$ ./noc csv-import ip.address f1

Update ip.address from file f1

/opt/noc$ ./noc csv-import --resolve=update ip.address f1

See Also

noc csv-export

  • No labels

1 Comment

  1. Сетки

    Несколько моментов касательно импорта сеток.

    • afi всегда 4
    • vrf default или свой
    • asn можно указать свой. это AS

    style это красивость таблички


    default4109.193.0.0/290NS Ядро сети
    default4109.193.24.0/210 "belg" 



    Несколько моментов касательно импорта хостов.

    • afi всегда 4
    • vrf -  default или свой
    • fqdn обязателен. это полностью квалифицированное доменное имя. потенциально либо генерируемое, либо везде одинаковое.