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.

Display Server Name for Multiple Orion Web Servers

Abstract

We recommend regularly to our clients to deploy Orion Additional Web Servers, typically where we know the active user count will be pushing towards 20+ concurrent users and where platform resiliency is a requirement. In the latter situation, this means that we are putting a load balancer in front of the Orion web servers to act as the arbitrator on which server is used for a particular session.

This is important, you need to deploy an Orion multi web server architecture with a solution for ensuring session management is supported. This is often referred to a sticky session management, as a single session needs to be handled by a single Orion web server. If it is not, then you will have a situation where when navigating around the Orion web interface a page request or even auto page refresh may now get picked up by the other web server. That web server has not spoken to you before and therefore will ask you to login.

This is why it is not possible to use DNS round robin to provide Orion load balancing either.

OK, so that was the pre-amble, the purpose of this post is to provide a method to display which web server you are accessing when you are using such an architecture. For this, we are going to need to change the web application code to include output for the hostname of the server to which your page request is being served. This is especially useful to identify which server you may need to go collect logs for, or identify if you have issues with balancing of requests across the servers.

Information and Warning

This is a straightforward change to make and I would mark this as an easy change.

However! This is a change which is adjusting the code in the Orion web application. This has potential implications:

  1. This is an unsupported change. SolarWinds support might quite rightly ask you to remove this change to provide support if your issue relates to the web page
  2. If you ever run the Configuration Wizard or when you perform upgrades, the code may get reset and you will simply need to re-add it
  3. Post upgrade, this code structure may have changed and therefore it will need to be updated to support probably just the insertion point
  4. The change outlined below requires you to have your Orion website running with 'Precompiledwebsitedisabled="true", which is beautifully detailed by  here https://thwack.solarwinds.com/t5/SCM-Documents/Primary-Default-SolarWinds-Files-Used-To-Customize-Deployment/ta-p/517994
Solution

The easiest thing is for me to show you the outcome with a screenshot, as this will save me typing more and way easier for you to understand if this is something you wish to apply to your installation.

Which Server, ahh this one

I have chosen to put this in the footer section, as a this is nicely hidden away and secondly this is probably the easiest location to apply the change.

Steps to configure:

  1. Login to one of your Orion web servers
  2. Navigate to C:\inetpub\SolarWinds\Orion\Controls\ (if you have installed the SolarWinds website in a different folder, find the appropriate path 
  3. Make a copy of the file - PageFooter.ascx and save to a safe location
  4. Open in a text editor the original file
  5. In Orion 2019.4 release version on line 21 you will find the following text

    <a href="<%= Resources.CoreWebContent.SolarWindsComLocUrl %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a><%= FooterString %></div>

  6. Insert the following text into this line where the next text is highlighted her in bold

    <a href="<%= Resources.CoreWebContent.SolarWindsComLocUrl %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a> Server: <%= System.Environment.MachineName.ToString() %> <%= FooterString %> </div>

  7. Save the file
  8. Navigate to this web servers Orion URL and confirm that you see the hostname displayed in the footer
    1. Note: This save will cause IIS to recompile the SolarWinds web application as a change was detected, so the first time you hit the site, it will take 20 - 60 seconds to load
  9. Backup this new file to a safe location 
  10. Repeat on each of your other Orion web servers

I hope you find this useful.

Mark Roberts

Prosperon - UK SolarWinds Partners

Installation | Consultancy | Training | Licenses

  • I use PowerShell to keep a few .js, .ascx, and .config files modded. It's nothing fancy, and does not have any error correction, but it works. I added this edit to my list, so I can just run a PowerShell script instead of having to go into each file, on each server, and make the change.

    #Orion Platform 2018.4 HF3, SCM 1.1.0, NCM 7.9, NPM 12.4, DPAIM 11.1.1, VMAN 8.4.0, SAM 6.8.0, NetPath 1.1.4
    #F:\inetpub\SolarWinds\Orion\Controls\PageFooter.ascx
    $file = 'F:\inetpub\SolarWinds\Orion\Controls\PageFooter.ascx'
    $ChangeThis = '    <a href="<%= Resources.CoreWebContent.SolarWindsComLocUrl %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a><%= InstalledProducts %> &copy; 1999-<%= DateTime.Now.Year %> SolarWinds Worldwide, LLC. All Rights Reserved.</div>'
    $ToThis = '    <a href="<%= Resources.CoreWebContent.SolarWindsComLocUrl %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a> Server: <%= System.Environment.MachineName.ToString() %>  <%= InstalledProducts %> &copy; 1999-<%= DateTime.Now.Year %> SolarWinds Worldwide, LLC. All Rights Reserved.</div>'
    (Get-Content $file) -replace $ChangeThis, $ToThis | Set-Content $file
    Write-Output ' Updated PageFooter.ascx '

    Again, it's nothing fancy, but it helps me keep up with the changes after running the config wizard. Maybe it will help someone else too.

    Thanks, again,  !!

  • I think I must be missing something - I have tried put this into "production" and could not find the directories/files that were given here.

    I am at 2019.4.

    Any help or direction would be appreciated 

    Thank You

  • Same here...my Controls folder has only file in it....ChartImagePipe.aspx.  Version 2020.2

  • Again Thanks for this - Huge Help - Just pushed out to all my web servers and it worked.  Just what I have been looking for.

    Server: ORIONAWS4 Orion Platform, VNQM, NCM, NPM, LA, NTA HF1, UDT: 2020.2.1 Copyright 1999-2020 SolarWinds Worldwide, LLC. All Rights Reserved.

    Well Done!

  • If anyone is watching this thread.... has anyone found a new location to apply this fix?

  • see #4 in the Information and Warning section. You have to modify the file, then run config wizard before being able to see the file.

  • Should you want to have the hostname displayed with the original letter case, you can use "System.Net.Dns.GetHostName().ToString()" instead of "System.Environment.MachineName.ToString()". Call me OCD, but I hate when all is uppercase ;) . The nomenclature of our hostnames contains a lot of information, hence it's easier to read in original letter case. That said, big up to Thumbsup

  • Here's the script I have on my end. It's slightly more complicated than yours, but has a few simple checks... It's made on 2020.2.6, so any newer release would have to change the path and most likely the $findstr & $newStr variables.

    # Tested on Orion 2020.2.6
    #Requires -RunAsAdministrator
    
    #Set File Location:
    $FileLocation = "c:\inetpub\SolarWinds\Orion\Controls\PageFooter.ascx"
    
    # Strings to search and replace
    $FindStr = '<a href="<%= DefaultSanitizer.SanitizeHtml(Resources.CoreWebContent.SolarWindsComLocUrl) %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a><%= DefaultSanitizer.SanitizeHtml(FooterString) %></div>'
    $NewStr =  '<a href="<%= DefaultSanitizer.SanitizeHtml(Resources.CoreWebContent.SolarWindsComLocUrl) %>"><img alt="SolarWinds" height="19" width="77" src="/orion/images/SolarWinds.Logo.Footer.svg" /></a>Server: <%= System.Net.Dns.GetHostName().ToString() %> - <%= DefaultSanitizer.SanitizeHtml(FooterString) %></div>'
    
    #Let the magic happens.. 
    $FilePresence = Test-Path -Path $FileLocation
    if($FilePresence) {#If FilePresence is true:
        $FooterFile = Get-content -Path $FileLocation
        if($FooterFile | Select-String -SimpleMatch $FindStr){#If matching the find string, let's continue
            Copy-Item -path $FileLocation -Destination "$FileLocation.backup"
            Write-host "[INFO] Modifying $FileLocation "
            $FooterFile | % { $_.Replace($FindStr, $NewStr) } | Set-Content $FileLocation
            } else {
                Write-host "[INFO] $FileLocation does not require modification."
                }
    } else { #If FilePresence is false:
        Write-Host "[ERROR] $FileLocation was not found on this system. "-ForegroundColor Red
        Write-Host "        Website might not be decompiled. Have you modified the Configuration Wizard config file and ran it?" -ForegroundColor Red
        }

    Like , I'm dropping this here in hope it'll help somebody :)

  • as per the "Information and Warning section":  The change outlined below requires you to have your Orion website running with 'Precompiledwebsitedisabled="true", which is beautifully detailed by  here https://thwack.solarwinds.com/t5/SCM-Documents/Primary-Default-SolarWinds-Files-Used-To-Customize-Deployment/ta-p/517994

  • On behalf of THWACK Nation, thank you! I'm adding this to my stash of gems now.