in More Search Options

Removing domain name from ${SysName}

Last post 10-14-2008 10:54 AM by SamuelB. 11 replies.
Page 1 of 1 (12 items)
Sort Posts:
  • 10-19-2007 10:22 AM

    Removing domain name from ${SysName}

    Can this be done? 

    • Post Points: 5
  • 10-19-2007 1:10 PM In reply to

    • SamuelB
    • Top 25 Contributor
    • Joined on 06-16-2005
    • USA
    • Posts 270
    • Points 702

    Re: Removing domain name from ${SysName}

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

    • Post Points: 1
  • 10-19-2007 1:32 PM In reply to

    • Haley
    • Top 25 Contributor
    • Joined on 01-23-2003
    • USA
    • Posts 443
    • Points 2,001
    • Moderator
      SolarWinds Employee

    Re: Removing domain name from ${SysName}

    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
  • 11-14-2007 1:07 PM In reply to

    • tgoyette
    • Top 200 Contributor
    • Joined on 01-24-2005
    • USA
    • Posts 39
    • Points 99

    Re: Removing domain name from ${SysName}

    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
  • 11-14-2007 1:28 PM In reply to

    • SamuelB
    • Top 25 Contributor
    • Joined on 06-16-2005
    • USA
    • Posts 270
    • Points 702

    Re: Removing domain name from ${SysName}

    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
  • 11-14-2007 1:41 PM In reply to

    • Haley
    • Top 25 Contributor
    • Joined on 01-23-2003
    • USA
    • Posts 443
    • Points 2,001
    • Moderator
      SolarWinds Employee

    Re: Removing domain name from ${SysName}

    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
  • 11-14-2007 1:58 PM In reply to

    • tgoyette
    • Top 200 Contributor
    • Joined on 01-24-2005
    • USA
    • Posts 39
    • Points 99

    Re: Removing domain name from ${SysName}

    No I have not.

    You plugged what into my network?!
    • Post Points: 1
  • 11-15-2007 7:45 AM In reply to

    • SamuelB
    • Top 25 Contributor
    • Joined on 06-16-2005
    • USA
    • Posts 270
    • Points 702

    Re: Removing domain name from ${SysName}

    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
  • 08-26-2008 9:21 AM In reply to

    Re: Removing domain name from ${SysName}

     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
  • 08-26-2008 9:41 AM In reply to

    Re: Removing domain name from ${SysName}

    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
  • 08-26-2008 10:35 AM In reply to

    • sedmo
    • Top 50 Contributor
    • Joined on 12-01-2005
    • USA
    • Posts 111
    • Points 248

    Re: Removing domain name from ${SysName}

    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
  • 10-14-2008 10:54 AM In reply to

    • SamuelB
    • Top 25 Contributor
    • Joined on 06-16-2005
    • USA
    • Posts 270
    • Points 702

    Re: Removing domain name from ${SysName}

    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)