solarwinds  |  thwack
in
Search 44,783 posts and 623 resources contributed by 21,555 members or post a topic.

Already Joined? Sign in
Removing domain name from ${SysName}

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


21 Posts
Points 53
wjcmalana posted on 10-19-2007 10:22 AM
rated by 0 users

Can this be done? 

  • | Post Points: 5

Answered (Verified) Verified Answer


1 Posts
Points 3
Answered (Verified) jfkenneyjr replied on 08-26-2008 9:21 AM
rated by 0 users

 I've run into the same issue. I've got devices with and without domain names (e.g. routers (with) vs. firewalls (without)).

 What I did to get around this was to create a second custom property for ConfigFlag2 for my devices with domain names. Then I copied 62-Configs.Resource to 62-Configs2.Resource. I edited this file and changed the SQLResource.SQL statement "where ConfigFlag = 1" to "where ConfigFlag2 = 1".

In my Manage Views, I have two Config Listing entries. Add both to cover both types of SysName entries. Then just edit the views to correspond to your particular config folder pattern (e.g. I had to add the domain name .xxx.com after the ${Caption} for my devices with domain names).

I know its a bit of a brute force workaround but it's working fine for me and I can get the configs online for all my devices.
 

  • | Post Points: 3

All Replies


280 Posts
Points 728
SamuelB replied on 10-19-2007 1:10 PM
rated by 0 users

 I would like to know this as well. This would be one of the nicest things to happen to me. :)

  • | Post Points: 1

443 Posts
Points 2,234
Moderator
SolarWinds Employee
Haley replied on 10-19-2007 1:32 PM
rated by 0 users

The ${SysName} variable reports the value stored in the RFC1213-MIB:sysName MIB (OID: 1.3.6.1.2.1.1.5).  This MIB is an administratively asisgned name for the managed node.  By convention, this is the node's fully-qualified domain name.  

This value can be modified by updating the value via SNMP or for most devices, by modifying the device via the command line.  I recommend checking the documentation for your managed devices for more information.

 

 

 

Haley Oyler Project Manager SolarWinds
  • | Post Points: 3

40 Posts
Points 102
tgoyette replied on 11-14-2007 1:07 PM
rated by 0 users

I want to make sure  I understand what you are recommending. Are you saying to remove the IP domain name from the configuration of the device? If so, that is not easily done in some environments where the domain name is used for things such as encryption. 

You plugged what into my network?!

  • | Post Points: 3

280 Posts
Points 728
SamuelB replied on 11-14-2007 1:28 PM
rated by 0 users

Yes, and this is my problem. I have to configure the domain name on my devices in order to get ssh working on the device. I just wish there was a variable with the hostname but without the domain name. Currently, I have to manually rename each device in Cirrus when I add new devices.

  • | Post Points: 3

443 Posts
Points 2,234
Moderator
SolarWinds Employee
Haley replied on 11-14-2007 1:41 PM
rated by 0 users

Have you seen a standard (i.e., MIB II) SNMP MIB value that stores the name in the format you prefer?  If so, it would be great if you provided it.  I can add a feature request for Cirrus to collect that value.

Haley Oyler Project Manager SolarWinds
  • | Post Points: 5

40 Posts
Points 102
tgoyette replied on 11-14-2007 1:58 PM
rated by 0 users

No I have not.

You plugged what into my network?!

  • | Post Points: 1

280 Posts
Points 728
SamuelB replied on 11-15-2007 7:45 AM
rated by 0 users

Haley:

Have you seen a standard (i.e., MIB II) SNMP MIB value that stores the name in the format you prefer?  If so, it would be great if you provided it.  I can add a feature request for Cirrus to collect that value.

 

I have not seen a standard MIB either.

Would it be possible to have Cirrus take the string value that it obtains from SNMP and uses for ${SysName} and drop the first "." and everything after that and put it in a new variable?

Then there could be an setting that is user configurable that would allow the administrator to choose whether to use ${SysName} or this new variable (${HostName} for instance) as the default name in the Node Name field. This would be done much easier programmatically than having to retype the name by hand each time a new node is added.

 

  • | Post Points: 3

1 Posts
Points 3
Answered (Verified) jfkenneyjr replied on 08-26-2008 9:21 AM
rated by 0 users

 I've run into the same issue. I've got devices with and without domain names (e.g. routers (with) vs. firewalls (without)).

 What I did to get around this was to create a second custom property for ConfigFlag2 for my devices with domain names. Then I copied 62-Configs.Resource to 62-Configs2.Resource. I edited this file and changed the SQLResource.SQL statement "where ConfigFlag = 1" to "where ConfigFlag2 = 1".

In my Manage Views, I have two Config Listing entries. Add both to cover both types of SysName entries. Then just edit the views to correspond to your particular config folder pattern (e.g. I had to add the domain name .xxx.com after the ${Caption} for my devices with domain names).

I know its a bit of a brute force workaround but it's working fine for me and I can get the configs online for all my devices.
 

  • | Post Points: 3

1,211 Posts
Points 4,323
Moderator
SolarWinds Employee
chris.lapoint replied on 08-26-2008 9:41 AM
rated by 0 users

jfkenneyjr:

In my Manage Views, I have two Config Listing entries. Add both to cover both types of SysName entries. Then just edit the views to correspond to your particular config folder pattern (e.g. I had to add the domain name .xxx.com after the ${Caption} for my devices with domain names).

I know its a bit of a brute force workaround but it's working fine for me and I can get the configs online for all my devices

 

Are you in the v5 beta?  This release includes an official Orion NPM integration module and removes the need to worry about file naming/copying.   v5 is NOT released yet, but you can check out a pre-release view of both here:

NPM integration:   http://oriondemo.solarwinds.com

NCM (Cirrus v5) website:  http://thwack.com/forums/t/9596.aspx

Chris LaPoint Sr. Product Manager NCM (Cirrus), ipMonitor, LANsurveyor SolarWinds Austin, TX

  • | Post Points: 3

118 Posts
Points 267
sedmo replied on 08-26-2008 10:35 AM
rated by 0 users

This post http://thwack.com/forums/p/5859/25280.aspx#25280 contained SQL for removing the domain names that I think could be adapted to your needs.  ALWAYS make a backup of your database before executing SQL queries that are going to modify your database.

The SQL query below will take the value that is in the SysName field, remove the domain name and then place this value in the NodeCaption field.  Effectively renaming each node without the domain name.  Keep in mind that this query will update the name of every node in the database.

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

 If you would like to create a new field in the database to store the host name information without the domain name you can also create a custom property and use SQL to update this field based upon the SysName field.  To do this first create a new custom property.  For the example SQL I will assume the name of this custom property is HostName.  Then you can run the SQL query below to populate this new custom property field.

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

 Not sure if this will be helpful or not but I thought I would throw it out there. 

  • | Post Points: 8

280 Posts
Points 728
SamuelB replied on 10-14-2008 10:54 AM
rated by 0 users

sedmo,

That definitely helps, I meant to post a reply before.

Solarwinds,

I would, however, still like to see a variable that is effectively created by doing this behind the scenes within the application instead of using SQL queries.

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