-
Notifications
You must be signed in to change notification settings - Fork 2
how to use
Welcome to the Bluecat-Proteus-import-export wiki!
- create a bulk import export script for the Proteus IPAM (IP address manager) of Bluecat Network.
- written in Powershell
- Proteus IP management of BlueCat network
- the import-export script
- create an API user on GUI IPAM Proteus
- the Proteus must allow the IP of the device accessing the server through API
- create the csv file with the commands. (default is "myimportexportfilename.ps" => "myimportexportfilename.csv" )
- check that the 'user's field' in the csv field are the same as in the IPAM-Proteus.
log file: by default the log file will have the same name as the script file. You can change the option with command file. output file: by default the log file will have the same name as the script file. You can change the option with command file.
If you omit some option a prompt will ask you
<file>.ps [-level] [-ip <ip>] [-help] [-commands <input file name>] [-output <output file name>] [-user <APIusername>] [-password <password>]``
- '#' at the begining means comment. This line will be ignored. So you can fix the order of the fields in the actions. This allow you the create the csv from any Tabulator programs like Excel, open office, ....
- Most of the time the names of the fields in the TITEL are the same as defined in the Proteus.
- The field 'action' (see Format) allows to do some different actions.
- the format is comma separated
- when you have a list of IP it is separated with ";" in order to differenciate it from ','
- you need at least:
- a line with CONFIG-NAME,...
- a line with TITLE....
- an line with actions,....
- CONFIG-NAME will set your default configuration you are working for the commands which need it
action,parameter1,prameter2,parameter3,parameter4,parameterX,...
- Option 'action': always first. If 'action' contains '_FORCE' that means deleted if it exists
- 'TITLE' the line is treated as title and give the order of the actions' fields. So it format the action lines
CONFIG-NAME, ADD_IP, ADD_IP_FORCE, MODIFY_IP, DEL_IP, ADD_SUBNET, ADD_SUBNET_FORCE
, MODIFY_SUBNET, ADD_DEVICE, ADD_DEVICE_FORCE, DEL_DEVICE, MODIFY_DEVICE, ADD_TAG, MODIFY_TAG , SEARCH_SUBNET, LIST_DEVICES, LIST_IPS, COMMENT_OUTPUT
DEL_SUBNET, LIST_DEVICE_WITHOUT_IP, LISTTAGS
all the examples (commands) could be mixed but do not forget that some command need a other TITLE with field order Before to use I added some new fields and device'types like
- in IP4Network : 'description,vlan'
- in IP4Address : 'description,virtual'
- in Tags : 'description,usedby,last-seen,alternative-name'
- in device'types: 'printer,PC'
#example global config CONFIG-NAME,NetworkConfig1
CONFIG-NAME,NetworkConfig1 TITLE_SUBNET,cidr,name,description,vlan ADD_SUBNET,10.1.0.0/24,network_10.1.0.0_24,add subnet if not exist,vlan50 MODIFY_SUBNET,10.1.0.0/24,network_10.1.0.0_24,modified subnet when field not empty,vlan51 ADD_SUBNET,10.2.0.0/24,net_10.2.0.0_24,add subnet if not exist,VLAN2
CONFIG-NAME,NetworkConfig1 TITLE_IP,name,ip,description,virtual ADD_IP_FORCE,TEST_1,10.1.0.5,rewritten 10.1.0.5,1 ADD_IP,TEST_gateway,10.1.0.1,updating gateway 10.1.0.1,1
- Obligatory is the IP's fields which could be ip or IP4Address
- optional the other fields. Ask your Proteus's administrator for having the name of the fields
CONFIG-NAME,NetworkConfig1 DEL_IP,,10.1.0.10,,,,,, DEL_IP,,10.1.0.11,,,,,, DEL_IP,,10.1.0.12,,,,,, DEL_IP,,10.1.0.13,,,,,, DEL_IP,,10.1.0.14,,,,,, DEL_IP,,10.1.0.15,,,,,, DEL_IP,,10.1.0.16,,,,,, DEL_IP,,10.1.0.17,,,,,,
DEL_IP,,10.1.0.5,,,,,, DEL_IP,,10.1.0.254,,,,,, ADD_IP,TEST_10,10.1.0.10,added TEST 10,false ADD_IP,TEST_11,10.1.0.11,added TEST 11,true ADD_IP,TEST_12,10.1.0.12,added TEST 12,true ADD_IP,TEST_13,10.1.0.13,added TEST 13,false ADD_IP,TEST_14,10.1.0.14,added TEST 14,false ADD_IP,TEST_15,10.1.0.15,added TEST 15,true ADD_IP,TEST_16,10.1.0.16,added TEST 16,true ADD_IP,TEST_17,10.1.0.17,added TEST 17,false ADD_IP_FORCE,TEST_5,10.2.0.5,added TEST 5,true ADD_IP_FORCE,TEST_6,10.2.0.6,added TEST 6,true MODIFY_IP,TESTNEW_10,10.1.0.17,modified TEST 17,
- Obligatory is the name's fields.
- optional the other fields. Ask your Proteus's administrator for having the name of the fields
CONFIG-NAME,NetworkConfig1 TITLE_DEVICE,name,DeviceType,DeviceSubtype,ip4Addresses,description DEL_DEVICE,test-device1,,,,, ADD_DEVICE,test-device1,PC,,10.1.0.10;10.1.0.11,added test-device1, MODIFY_DEVICE,test-device1,printer,,+10.1.0.15;+10.2.0.6;-10.1.0.17;-10.1.0.11,modified test-device1, ADD_DEVICE,test-device2,PC,,10.1.0.11,added test-device2 ADD_DEVICE_FORCE,test-device3,printer,,10.1.0.12,delete and replace test-device3
- Obligatory is the taggroup's and name's fields.
- optional the other fields. Ask your Proteus's administrator for having the name of the fields
- special is the parent-object-field because some overlapping with different parent's type.
parent-object-field is: . 'IP4Address' for binding an IP address, . 'cidr' or 'IP4Network:cidr' for a IP4Network, . IP4Block:cidr for an IP Block, other possibilities will follow when requested
- special is CONFIG-NAME for linking object of an other configuration
CONFIG-NAME,NetworkConfig1 TITLE_TAG,taggroup,name,description,cidr,usedby,last-seen,alternative-name ADD_TAG_FORCE,ListOfVlans,VLANXXXtest,test tag 1,10.2.0.0/24;10.0.2.0/24,devicexxx,Friday,myvlan ADD_TAG,ListOfVlans,VLANYYYtest,test tag 2,10.1.0.0/24,deviceyyy,lasttime,yourvlan TITLE_TAG,taggroup,name,description,IP4Block:cidr,usedby ADD_TAG,MygroupTest1,test-block-tag1,test block tag 1,10.0.0.0/8,a-lot-of #now link a second object to the TAG TITLE_TAG,CONFIG-NAME,taggroup,name,description,IP4Address,usedby ADD_TAG,NetworkConfig3,ListOfVlans,VLANYYY,test tag YYY,10.1.0.16,deviceyyy,lasttime,yourvlan MODIFY_TAG,NetworkConfig1,ListOfVlans,VLANYYY,modified by someone,10.1.0.17,super user
- cidr (obligatory fields) for the search
- configuration (optional field) for searching in a specific configuration or all other fields will be shown in the output at least -> TITLE_SEARCHSUBNET,cidr
CONFIG-NAME,NetworkConfig1 TITLE_SEARCHSUBNET,name,yourownfield,cidr,id,configuration,description
===Example comment and searching
COMMENT_OUTPUT,# COMMENT_OUTPUT,SEARCHING OF SUBNETS TITLE_SEARCHSUBNET,name,cidr,id,configuration,description SEARCHSUBNET,,10.1.0.0/24,,all SEARCHSUBNET,,10.2.0.0/24,,all TITLE_SEARCHSUBNET,cidr,name,configuration,description SEARCHSUBNET,10.1.0.0/24,,NetworkConfig2,
===Example: list IPs of subnet
- cidr (obligatory fields) for the search
- configuration (optional field) for searching in a specific configuration or all
- adding other fields will be show in the output
- in the output you will see the fields you have added
- at least -> TITLE_LISTIPS,cidr
- or example TITLE_LISTIPS,name,yourownfield,cidr,id,configurationX,description
COMMENT_OUTPUT,# COMMENT_OUTPUT,LIST of all devices TITLE_LISTIPS,cidr,configuration,name,address,state,type LISTIPS,10.1.0.0/24,all LISTIPS,10.2.0.0/24
- filter (special fields) for the search. If filter is empty it will search all devices.
- filter could be a RegEX
- configuration (optional field) for searching in a specific configuration or all
- deviceType (special field) for seeing the Device type name
- adding other fields will be show in the output
- in the output you will see the fields you have added
- at least -> TITLE_LISTDEVICES,name
- or example TITLE_LISTDEVICES,name,yourownfields,id,configurationX,deviceTypeId,deviceType
COMMENT_OUTPUT,# COMMENT_OUTPUT,LIST of all devices TITLE_LISTDEVICES,name,configuration,IP4Addresses,state,type,deviceType,description LISTDEVICES,,all COMMENT_OUTPUT,# COMMENT_OUTPUT,LIST of devices with first 'te' then any char and 't' TITLE_LISTDEVICES,filter,configuration,name,IP4Addresses,type,deviceTypeId,deviceType,description LISTDEVICES,te.*t,all