This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Removing domain name from ${SysName}

Can this be done? 

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

  • 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.

     


     


     

  • 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. 

  • 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.

  • 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.



  • 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.

  •  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.
     



  • 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://orionncmdemo.solarwinds.com

    If you're interested in checking out the beta, please signup here:

     

  • This post  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.