cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Change Custom Property names (the tag name) easily

Change Custom Property names (the tag name) easily

At the moment you have to create a new property and move everything in to it, then delete the old.  But that often causes problems with reports, the reports won't run because the property name is missing.

a) change reports so they run regardless, or allow you to fix the problem easily.
b) change it so you can just change the Customer Property title/name easily (and make sure it updates Custom Property names used in Reports).

This is a business requirement, as systems evolve, or naming conventions change, or because people just want it changed, we need to change the Custom Property Name, and it's not good to have to explain to management that it's a limitation of Solarwinds.  Everything else is quite flexible, but certain things are very difficult to change.

Tags (1)
1 Comment

SQL is a real pain about changing column names, it's doable if there was an abstraction layer where all custom properties just showed up in the DB tables as something generic like node_CP1, interface_CP1, etc and then you have to reference another table to get the DisplayName associated with CP1.  Would definitely be a hassle for writing custom SQL reports though since people would end up having to memorize what node_CP1 was supposed to be.  You also still wouldn't be able to retroactively change their data types either. 

It all sounds pretty painful.

 

When assessing changes to my custom properties I always run this set of sql queries to figure out what the changes could break and where I'm going to need to fix things.  I deleted at least 20 custom properties in the last few months at my current gig using this method, spent lots of time chasing through reports removing references to things I wasn't keeping and redirecting them to the new property or ditching that column completely.

--Search for all instances of a custom property in Solarwinds
--Due to risks of slow execution I recommend doing these one at a time and not attempting to run all properties at once.

declare @Property as nvarchar(50) = 'mypropertyname'

--views and resources
SELECT distinct v.viewgroupname, v.viewtitle, r.resourcetitle, r.resourcename, rp.propertyvalue, v.viewid
FROM sys.columns cp
left join [dbo].[ResourceProperties] rp on propertyvalue like '%'+cp.Name+'%'
join resources r on r.resourceid=rp.resourceid
join views v on v.viewid=r.viewid
WHERE cp.name like @Property
order by v.viewid

--alert actions
SELECT distinct a.title, ap.propertyname, ap.propertyvalue
FROM sys.columns cp
left join [dbo].[ActionsProperties] AP on PROPERTYVALUE like '%'+cp.Name+'%'
join ACTIONS A ON A.ACTIONID=AP.ACTIONID 
WHERE cp.name like @Property
order by a.title

--alert configurations
SELECT distinct ac.name as Alertname
FROM sys.columns cp
Left join [dbo].[AlertConfigurations] ac on ([trigger] like '%'+cp.Name+'%' or reset like '%'+cp.Name+'%')
WHERE cp.name like @Property
and ac.enabled=1
order by ac.name

--groups
SELECT distinct c.Name as [Group], cm.name as [Rule Name], cm.expression, cm.definition
FROM sys.columns cp
join [dbo].[ContainerMemberDefinitions] cm on cm.expression like '%'+cp.Name+'%' or cm.definition like '%'+cp.Name+'%'
join containers c on c.containerid=cm.containerid
WHERE cp.name like @Property
order by c.Name

--view and account limitations
SELECT distinct l.LimitationID, l.whereclause, v2.viewgroupname, v2.viewtitle, acc.menuname, acc.limitationid1, acc.limitationid2, acc.limitationid3
FROM sys.columns cp
join [dbo].[Limitations] l on l.whereclause like '%'+cp.Name+'%'
join dbo.views v2 on v2.limitationid=l.limitationid
join dbo.accounts acc on acc.limitationid1=l.limitationid or acc.limitationid2=l.limitationid or acc.limitationid3=l.limitationid
WHERE cp.name like @Property
order by l.LimitationID

--reports
SELECT distinct rep.definition, rep.Title
FROM sys.columns cp
join  [dbo].[ReportDefinitions] rep on rep.definition like '%'+cp.Name+'%'
WHERE cp.name like @Property
order by rep.Title



/** uncommon use case
--SAM Arguments
SELECT distinct cts.[key], cts.value
FROM sys.columns cp
join  [dbo].[APM_ComponentTemplateSetting] cts on cts.value like '%${%'+cp.Name+'%}%'
WHERE cp.name like @Property

--SAM Arguments
SELECT distinct cts.[key], cts.value
FROM sys.columns cp
join  [dbo].[APM_ComponentSetting] cts on cts.value like '%${%'+cp.Name+'%}%'
WHERE cp.name like @Property
**/