Quantcast
Viewing all articles
Browse latest Browse all 21093

Re: Bulk Import ICMP Nodes with Attributes Help

To update the Captions, try this:

***BACKUP YOUR DATABASE FIRST***

 

In Notepad++ (Somewhat quicker than Excel in my opinion, but you can use whatever you want to get to the end result)

1) Copy Captions and IP Addresses from Excel into Notepad++

Image may be NSFW.
Clik here to view.
caption1.jpg

 

2) CNTRL+H (Find/Replace)

3) Find ^, Replace with (using Regex)

UPDATE Nodes SET Caption = '

 

Image may be NSFW.
Clik here to view.
caption2.jpg

 

4) Find \t, Replace with (using Regex)

' WHERE IP_Address = '

 

Image may be NSFW.
Clik here to view.
caption3.jpg

 

5) Find $, Replace with (using Regex)

';

 

Image may be NSFW.
Clik here to view.
caption4.jpg

 

6) Copy the results of Column F into SQL, execute, enjoy.

 

Now, if this is something that you're going to be doing a lot, you might consider creating a Stored Procedure to make things even easier in the future.

 

CREATE PROCEDURE CUSTOM_UpdateCaption  @Caption NVARCHAR(50)  ,@Ip_Address NVARCHAR(50)
AS
UPDATE Nodes
SET Caption = @Caption
WHERE IP_Address = @Ip_Address
GO

 

This will store the procedure named 'CUSTOM_UpdateCaption' in your database, which you can call on at anytime to run your script like this:

 

EXEC CUSTOM_UpdateCaption '<caption>','<ipaddress>'

 

Where you place your list of Captions and IPs within the <caption> and <ipaddress> areas, respectively (keeping the single quotes)

 

As you can see, for this example, a stored procedure might be a little overkill. However, this will hopefully give you some insight into the power of stored procedures, and SQL in general when it comes to SolarWinds.

 

***AGAIN, I CANNOT EMPHASIZE HOW IMPORTANT IT IS TO BACKUP YOUR DATABASE BEFORE MAKING ANY OF THESE CHANGES***

 

As for the custom properties, while you can absolutely script that as well, the web-based import option is actually quite simple and easy to use as you have seen.

 

Enjoy!

 

-ZackM

Loop1Systems.com


Viewing all articles
Browse latest Browse all 21093

Trending Articles