Search 85,877 posts and 653 resources contributed by 43,513 members or post a topic.

Already Joined? Sign in
is a an easy way remove domain name from the node caption

Page 1 of 1 (6 items) | RSS

rated by 0 users
Answered (Verified) This post has 1 verified answer | 5 Replies | 3 Followers | 520 Views


106 Posts
Points 452
jcooler posted on Tue, Jun 30 2009 11:30 AM
rated by 0 users

I like to see all my devices listed as name only, without the domain name added to the end. It makes the alerts shorter and easier to read on SMS messages, and it just looks nicer, I think.

Anyway, i have been removing the domain name by going to Manage Nodes, then editing the node properties to manually remove the domain from the end of each node name. Its not that big of a deal, but its very time consuming if i import a large number of nodes.

Is there any way to make this process more effectient? Maybe a way to do this in bulk or with a SQL update script?

Thanks,

Jeremy

NPM 9.5 SP5  NCM, NTA, IPSLA, IPAM,  engineers Toolset      CatTools

Answered (Verified) Verified Answer


106 Posts
Points 452
Answered (Verified) jcooler replied on Wed, Jul 1 2009 10:23 AM
rated by 0 users
Verified by jcooler

So her is the SQL script that removes the domain names from the caption field. Thanks again for giving the code to make this happen.

 

UPDATE Nodes
  SET caption = (
    SELECT RTRIM( SUBSTRING(
        Caption, 1,( (
            Select CASE
            WHEN (CharIndex ('.', Caption) > 0)
              THEN (CharIndex ('.', Caption)-1)
              ELSE (LEN(Caption))
            END ) )
            )
         )
)

NPM 9.5 SP5  NCM, NTA, IPSLA, IPAM,  engineers Toolset      CatTools

  • | Post Points: 23

All Replies


500 Posts
Points 2,278
Thwack MVP
njoylif replied on Tue, Jun 30 2009 5:19 PM
rated by 0 users

I wanted this as well.
The caption field is auto populated and will be overwritten if you change, so...

Basically, I created a new column called HName (originally used HostName, but Netflow uses that and it caused issues).

This assumes that you don't have any periods (.) in your device name as that is what I cut off from the right using...
Here is a SQL script that I run daily to populate that field.

  UPDATE Nodes
  SET HostName = (
    SELECT RTRIM( SUBSTRING(
        Caption, 1,( (
            Select CASE
            WHEN (CharIndex ('.', Caption) > 0)
              THEN (CharIndex ('.', Caption)-1)
              ELSE (LEN(Caption))
            END ) )
            )
         )
  WHERE HostName is Null"

Larry J. Rice RelayHealth Network Architect 678-984-1686

  • | Post Points: 3

106 Posts
Points 452
jcooler replied on Wed, Jul 1 2009 9:42 AM
rated by 0 users

I have not had any problems with the node caption getting over written with the $sysname after i manually change it. I'm running NPM 9.5 SP2. Is this something that happened in another version maybe? Or maybe something happens that overwrites the caption field, and it just hasn't happened to mine yet. I have only been running NPM for about 2 months now.

The script you provided above should give me the basic steps to accomplish what I need to do though. So thank you for that.

I have a question though. You said that you are now using "HName" for the custom property field, but your script is updating the "Hostname" field. Am i misunderstanding something on that one?

 

I'll post my updated script and the results of whether it worked or not.

Thanks for your help

NPM 9.5 SP5  NCM, NTA, IPSLA, IPAM,  engineers Toolset      CatTools

  • | Post Points: 1

106 Posts
Points 452
Answered (Verified) jcooler replied on Wed, Jul 1 2009 10:23 AM
rated by 0 users
Verified by jcooler

So her is the SQL script that removes the domain names from the caption field. Thanks again for giving the code to make this happen.

 

UPDATE Nodes
  SET caption = (
    SELECT RTRIM( SUBSTRING(
        Caption, 1,( (
            Select CASE
            WHEN (CharIndex ('.', Caption) > 0)
              THEN (CharIndex ('.', Caption)-1)
              ELSE (LEN(Caption))
            END ) )
            )
         )
)

NPM 9.5 SP5  NCM, NTA, IPSLA, IPAM,  engineers Toolset      CatTools

  • | Post Points: 23

500 Posts
Points 2,278
Thwack MVP
njoylif replied on Wed, Jul 1 2009 12:29 PM
rated by 0 users

you are correct, that was a script I had saved off in archive and hadn't changed that yet.  Glad to see it worked with your tweaks.

Larry J. Rice RelayHealth Network Architect 678-984-1686

  • | Post Points: 3

972 Posts
Points 5,930
BryanBecker replied on Fri, Oct 30 2009 10:39 AM
rated by 0 users

Can we please add this to a feature request?  It would be nice to have some global check box or something to turn off the domain name to appear or not appear.

Thanks.

BB

(5) Orion V9.5 SLX running Web Site
(2) Orion EOC
IPSLA Monitor
NetFlow Traffic Analysis
13000+ elements

  • | Post Points: 1
Page 1 of 1 (6 items) | RSS

© 2003 - 2010 SolarWinds, Inc. All Rights Reserved.

Who is SolarWinds?

SolarWinds is rewriting the rules for how companies manage their networks. Guided by a global community of network engineers, SolarWinds develops simple and powerful network management software and network monitoring software for networks of all sizes. SolarWinds also offers a network certification program to become a SolarWinds Certified Professional (SCP).

What is thwack?

thwack, SolarWinds online community site, was designed by network engineers, for network engineers. thwack is a vibrant, growing community of more than 30,000 IT pros who share a passion for technology.

Explore Resources, Answers, Templates, and Advice

Download Free Networking Tools


Learn More About SolarWinds Products