In my another post (http://thwack.solarwinds.com/docs/DOC-171082) I added a search function in Solarwinds Page header , also modified the search results page to show some direct links related to the nodes, such as Edit Node, List Resources, etc., but not the unmanage/re-manage links. Solarwinds build-in unmanage node page is a pop-up window; you cannot access the URL directly via web console.
Did some search and I found an alternative way to achieve it. I created a customised standalone ASP .Net page for unmanage or re-mange node using Solarwinds SDK (PowerShell SwisSnapin) and MS Visual Web Developer 2010 Express. The ASP .Net page will run Solarwinds Powershell commands on Solarwinds server to re/unmanage a node. The page takes three parameters:
NodeID: N:1234
NodeCaption:
NodeStatus: if it is 9, it means the node is unmanaged
You can call this page from your search result page to unmanage/remange the node, the search results look like:
Prerequisite:
On Solarwinds Master (Web) server:
• If not installed, Install PowerShell 2.0 or above. (http://technet.microsoft.com/en-gb/library/hh847837.aspx)
• If not installed, Install Windows SDK for Windows Server 2008 and .NET Framework 3.5/4.0 (http://www.microsoft.com/en-gb/download/details.aspx?id=11310)
• If not installed, install MS IIS Web Deploy (http://www.iis.net/downloads/microsoft/web-deploy)
• Install Orion SDK 1.8 ()
• Install Visual Studio - Visual Web Developer 2010 Express: (http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4)
Steps:
1. Create an ASP.NET Web Application
• Run Visual Web Developer 2010 Express to create a New Project C# ASP.NET Application
• Add “AjaxControlToolkit” to the project (http://www.codingfusion.com/Post/3-Different-ways-to-add-AjaxControlToolkit-in-Asp)
• Add a reference to the PowerShell assembly called “System.Management.Automation” from "C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0"
• Create a folder called “images” to save you images used by the web-page.
• Add a new aspx page (Add – New Item – Web Form). In my example it is called “swnodemanagement.aspx”.
Please see the attachments for the codes (aspx & cs files).
Some useful links to help you building the page
• http://devinfra-us.blogspot.co.uk/2011/02/using-powershell-20-from-aspnet-part-1.html
• http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
2. Build the Deployment Package
Build the Project as a zip file (Project -- Build the Deployment Package)
3. Deploy the application (zip) to Solarwinds
• Run IIS manager, Create a new website (Do not deploy the application to current Solarwinds website), called “Solarwinds SDK”, using different port, say 8080
• Deploy the package (zip file) from Deploy—Import Application
4. Update C:\inetpub\SolarWinds\Orion\NetPerfMon\Resources\NodeSearchResults.aspx
• Add codes below
<td> <a href="http://your-solarwinds-server-url:8080/SWNodeManagement/swnodemanagement.aspx?NodeID=N:<%#Eval("NodeID")%>&NodeCaption=<%#Eval("Name")%>&NodeStatus=<%#Eval("Status")%>" target="_blank"><img alt="img006" src="/Orion/images/StatusIcons/Unmanaged.gif" width="14" height="14">Re/Unmanage</a> </td> |
5. Test, the result should like:
Tested on Windows Server 2008 with PowerShell 2.0 and Solarwinds environment: NPM 10.6 + Solarwinds SDK1.8. Please feel free to use/ modify the codes. I am not a web developer please correct the errors in the codes if found.
Thanks