DX NetOps Manager

Expand all | Collapse all

How to synchronize names of devices using serial number?

  • 1.  How to synchronize names of devices using serial number?

    Posted 08-26-2015 06:38 AM

    Hi,

    right now we are modeling devices into spectrum manually which ends up sometimes with my colleagues giving modeled devices non systematic names which after some time ended up as bit of a nightmare for me, because it is becoming hard to maintain some order in our modeled topology.

    So I was thinking if it would be possible somehow to use data from our in house built inventory system and use those to synchronize names on modeled devices by matching serial numbers of devices. Is something like this possible and if so what is the best/safest way to do this?

     

    Thanks in advance



  • 2.  Re: How to synchronize names of devices using serial number?

    Posted 09-01-2015 12:03 PM

    I can't think of an easy way to use your inventory to achieve what you want/need (without scripting), but you could rename models by using either SysName, IP Address, or Name Service configurable on the VNM model, under the Component Detail, in the SpectroSERVER Control area. On the right hand side is a Model Naming Order Option to change the order, and a button to reevaluate the model names.

     

    You might possibly need to run a search first to make sure that the models do not have the Lock_Model_Name attribute set to yes:

     

    Lock_Model_Name - attribute id 0x12a52

     

    Or maybe you should set this to Yes on the models that you do NOT want to change the name on before you press the "Reevaluate All Model Names" button.

    Hope that helps

    Jay



  • 3.  Re: How to synchronize names of devices using serial number?

    Posted 09-09-2015 02:15 PM

    If you have a file that has a column with the serial number and another column with the desired name, you could show only the name and serial number columns in Locater, search for all devices, and export the results to a text file.

     

    Then script a for loop to cat the first file and awk and print the column with the serial number.  While you're catting, set a variable for the name associated with the serial number ($namefromfile, for example)

    Grep the serial number you printed from the cat against the file from the Locater, and print the other column from the Locater file, which will give you the existing model name.  Call the variable for the model name $existingmodelname.

    Do an if expression -- if the model name from the Locater output file does not match the name from the file with the master names, run a CLI update for them to match:

     

     

    mhandle=`./show models | grep $existingmodelname| awk '{ print $1}'`

    ./update mh=$mhandle attr=0x1006e,val=$namefromfile

     

    You could do this a number of other ways - diff the two files, show the serial number via CLI and compare that with the master file, etc.

     

    Make sure you back up your db before doing this.

     

    Scott