User Tools

Site Tools


commandlinetools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
commandlinetools [2007/09/16 07:54]
faltin
commandlinetools [2007/10/01 16:23] (current)
faltin
Line 1: Line 1:
  
  
 +====== Command line tools ======
  
-This wiki page gives a structured listing of the various ​command ​line tools of NAV, with a brief explaination.+NAV has some useful ​command ​lines tools. We document the most important ones here.
  
-FIXME 
  
-|| **Tool ** || **Subsystem** || **Description** || + 
-|| x           || y               || z                 ||+===== navclean.py ===== 
 + 
 +Machine tracker data, i.e. ARP and CAM data, are never deleted from NAV. To delete old data run ''​navclean.py''​. It behaves as 
 +the help option explains: 
 + 
 +<​code>​ 
 +% ./​navclean.py -h 
 +Delete old arp and cam records from the NAV database. 
 +  
 +Usage: navclean.py [options...] 
 +  
 +Unless options are given, the number of expired ARP/CAM records will 
 +be printed. ​ The default expiry limit is 6 months. ​ To actually delete 
 +the expired records, add the -f option. 
 +  
 +Available options are: 
 +  
 +  -h, --help ​   -- Show this help screen. 
 +  -q            -- Be quiet. 
 +  -f            -- Force deletion of expired records. 
 +  -e <​date> ​    -- Set a different expiry date (default is 6 months 
 +                   ago) on ISO format. 
 +  -E <​interval>​ -- Set a different expiry date using PostgreSQL 
 +                   ​interval syntax. ​ E.g.: '30 days', '4 weeks',​ '6 
 +                   ​months'​ 
 +</​code>​ 
 + 
 +===== dump.py ===== 
 + 
 +The script extract data from the NAV database to text file(s). This is useful if you are migrating from one NAV installation to another and want to seed the new installation with the equipment you were monitoring in the old installation. 
 + 
 +<​code>​ 
 +$ ./dump.py -h 
 +usage: dump.py [options] 
 +Dumps NAV database to importable files. 
 +  
 +options: 
 +  -h, --help ​             show this help message and exit 
 +  -sSEP, --seperator=SEP ​ use SEP to seperate fields in output, [default :] 
 +  -tTABLE, --table=TABLE ​ dump data from TABLE 
 +  -oFILE, --output=FILE ​  dump data to FILE instead of stdout 
 +  -a, --all               dump all tables to files named TABLE.txt 
 + 
 +</​code>​ 
 + 
 +The tables you typically want export from are the tables that give data for bulk import when seeding the database. This will include: 
 + 
 +  ​netbox 
 +  ​room 
 +  ​location 
 +  ​org 
 +  ​usage 
 +  ​type 
 +  ​vendor 
 +  ​subcat 
 +  ​prefix 
 +  ​service 
 + 
 +We currently do not support cabling and patch. 
 + 
 +:!: Run ''/​dump.py -a''​ and you get all tables supported.
  
commandlinetools.1189929266.txt.gz · Last modified: 2007/09/16 07:54 by faltin