cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

How to get Orion to update the node name from the hostname

Jump to solution

Hi all,


 So I know that Orion grabs the system name or hostname and makes that the node name.  My problem is that if we update the hostname then it no longer is the same as the Orion node name.  Is there a way to update this?  I know that it updates automatically in Cirrus, but not Orion.  Any ideas?


 Thanks!


-Jason

1 Solution
Level 13

It is possible to make bulk changes using the SQL queries below but you have to keep a couple of things in mind.  First, if you are using a version of NPM prior to 9 then you have to stop the  Network Performance Monitor service prior to running the SQL query to update the caption.  Also, the queries supplied below will not change the caption for any nodes that have a blank sysname field.  This will keep the Caption field from being erased for things like icmp only nodes that do not have anything in the sysname field.  All other nodes will have their caption field set to whatever value is in the sysname field.  If you have specifically renamed a node to something different that what is in the sysname field then that will be overwritten by this query.

 This first query will show you all nodes in your database where the caption and sysname fields do not match and the sysname field is not empty.  This could also be done with a Solarwinds report as mdriskell talked about earlier in the thread.  You can run this query to see which nodes will have their caption fields updated.

SELECT Caption, SysName, IP_Address FROM Nodes

WHERE((Caption <> SysName) AND (SysName <> ''))

ORDER BY Caption

 This query will update the node caption field to whatever value is currently in the sysname field.

update nodes

set caption = sysname

where caption in (SELECT Caption FROM Nodes WHERE ((Nodes.Caption <> Nodes.SysName) AND (Nodes.SysName <> '')))

 

Use these queries at your own peril and always make a backup of your database before making any major changes. 😃

View solution in original post

0 Kudos
15 Replies
Level 7

Go to system manager right click the node and choose node details then delete the current Name (highlight and hit backspace) and then hit enter it will obtain the new hostname of the device then click Apply Chanages.

0 Kudos
Level 9

Hi dm5253,


 That works!  Thanks!  Luckily I only have a few switches that I need to convert using this method.  Anyone know of a way if I had to update say 900 nodes? 🙂


 -Jason

0 Kudos

 Get a friend to help update? Overtime maybe?!? haha

0 Kudos
Level 15

This doesn't help in the updating, but I wrote a report that I have scheduled to run monthly that lists all of the discrepancies where the caption and host name do not match.  I have this sent to my other admin who then goes through and updates Solarwinds.


I too would prefer an option to make this automatic, of course you also have the additional problem of updating any labels on the maps that have to be handled.

0 Kudos
Level 13

It is possible to make bulk changes using the SQL queries below but you have to keep a couple of things in mind.  First, if you are using a version of NPM prior to 9 then you have to stop the  Network Performance Monitor service prior to running the SQL query to update the caption.  Also, the queries supplied below will not change the caption for any nodes that have a blank sysname field.  This will keep the Caption field from being erased for things like icmp only nodes that do not have anything in the sysname field.  All other nodes will have their caption field set to whatever value is in the sysname field.  If you have specifically renamed a node to something different that what is in the sysname field then that will be overwritten by this query.

 This first query will show you all nodes in your database where the caption and sysname fields do not match and the sysname field is not empty.  This could also be done with a Solarwinds report as mdriskell talked about earlier in the thread.  You can run this query to see which nodes will have their caption fields updated.

SELECT Caption, SysName, IP_Address FROM Nodes

WHERE((Caption <> SysName) AND (SysName <> ''))

ORDER BY Caption

 This query will update the node caption field to whatever value is currently in the sysname field.

update nodes

set caption = sysname

where caption in (SELECT Caption FROM Nodes WHERE ((Nodes.Caption <> Nodes.SysName) AND (Nodes.SysName <> '')))

 

Use these queries at your own peril and always make a backup of your database before making any major changes. 😃

View solution in original post

0 Kudos
Level 7

Hello Sedmo,

The query you provide is very helpful, as i have similar scenario, since Im not a DBA expert at all, i was wondering if there is a way to excute this query only within a range of rows...

meaning of the 333 rows that I have with mismatches, i only want to execute from rows 1-171 and not the remaining... hoping that there is an easy command for this request... Thanks

0 Kudos
Level 8

And let's say that your System name has some extra information you don't want to add as Node Name, like say your domain name.  devicexzy.domain.net and you would like to get just devicexyz...

Here's what I've done, I'm by no mean an SQL expert so I used what I've learned from this post and added on.

I used the "Custom Properties Editor" to add a column called "StrippedNodeName" for the Nodes.  I sorted the data by IP and exported it to Excel.  So far this new column is empty.

In Excel I've filled the StrippedNodeName column with a stripped Caption Name (i.e. substitute .domain.com from column Caption).  So, in the Excel file, the result in column StrippedNodeName is all my captions without the .domain.com.

Then I went back in the Custom Properties Editor, still having it sorted by IP and pasted my Excel column to my new Custom Properties Editor Node column.

Then, in SQL, I've updated the nodes caption with this new column

update nodes
set caption = StrippedNodeName

0 Kudos
Level 9

sedmo,


 I'm not a SQL programmer, but I was able to copy and past your query straight into the MS SQL Server and both queries worked like a charm.  All of my nodes are updated!


 Thanks!


-Jason

0 Kudos
Level 15

Sedmo,


Would it be possible for you to post the SQL strings again but have it exclude devices with a blank sysname?  I have about 200 devices that are ICMP only and the sysname on all those would be blank and I wouldn't want it to overwrite my captions.


 Thanks,

0 Kudos
Level 13

mdriskell,


 The query is already written to exclude devices with blank sysname.

0 Kudos
Level 15

mdriskell,

 The query is already written to exclude devices with blank sysname.



Thanks, I didn't notice that in the query and did not want to risk running it and blank out 200 device names.  I will give this a try the next time I go through to make the changes.

0 Kudos
Level 13

No problem.  Always best to be cautious when making bulk changes.  Also, if you run the first query posted above you will get a list of the nodes that will be changed by the update query.

0 Kudos
Level 9

Do you have this same SQL process for updating "name" for al the interfaces?  We change descriptions on switchports all the time and the name field does not update to reflect the new description.  The only thing that changes is the Interface Alias. 


 I would think you could do an update to the "Name" field with "Interface Name" and " - " and "Interface Alias".


 


Can I request this functionality as an option in Orion?  An option box in the main setup that asks if updates to node names or interface names on rediscover/poll.  Or something like that.

0 Kudos

 If you go to the System Manager

Right Click and open the Node Details

On the right hand side there is a Rediscover Node button, This may refresh the host name. Its worth a try! 

0 Kudos
Level 13

Rediscover will poll the router for it's current hostname and update the SysName field in the Solarwinds database but it does not update the node name which is the Caption field.

0 Kudos