Page 1 of 1

How can I quickly change device name ....

Posted: Tue Sep 15, 2009 12:06 am
by CGirardy
... to make them match the DNS Names ?
I have a lot of devices that are not correctly named. I would like to make them match their DNS resolution name...
Is it possible ?
Thanks

Re: How can I quickly change device name ....

Posted: Tue Sep 15, 2009 1:26 am
by fewi
There's several ways you could automate this out.

The fastest way would probably be to use the API to log into each device, and set the host name.

If you're not comfortable around the API, but can create one config file per device named after, for example, the only IP address on an interface named 'outside', you could paste something like this:
:local server [:resolve "your.webserver.com"]; :local url ([:pick [/ip address get [/ip address find interface=outside] address] 0 [:find [/ip address get [/ip address find interface=outside] address] "/"]] . ".txt"); :local fileName "hostnamescript"; /tool fetch mode=http address=$server src-path=$url dst-path=$fileName; /import hostnamescript; /file remove hostnamescript
into each device. On a router with 1.1.1.1/24 on interface 'outside', that would attempt to download http://your.webserver.com/1.1.1.1.txt to "hostnamescript", execute that file and delete it.

1.1.1.1.txt would then be a script file along the lines of
/system identity set "whatever"
Again, the API would be faster and more resilient to errors.

Re: How can I quickly change device name ....

Posted: Wed Sep 16, 2009 2:36 am
by keith
Are you talking about the displayed name in your maps or the computer's host name? If you are just talking about the display name on the map in the device discovery settings select device name preference to be DNS, SNMP, NETBIOS, IP. You may have to delete and rediscover your devices but they would show the dns names. That is the way i have mine setup

Re: How can I quickly change device name ....

Posted: Wed Sep 16, 2009 8:52 am
by CGirardy
Thanks fewi.
That's what I was looking for.

keith : no, not only the display (I'm already displaying DNS names).. I'm talking about all the objects names