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.

Custom Property to auto populate another Custom Property?

Good Afternoon Solarwinders,

i have a scenario for you emoticons_happy.png i am looking for some assistance at the moment with Custom Properties and want to know can one custom property auto update another custom property?

so a node custom property known as 'Role' to update another custom property known as 'Tech'  

There is an Alert action that can do this but when we are adding nodes to Soalrwinds this is where i would like to have the auto populate set up rather then waiting for an alert to trigger.

pastedImage_1.png

cheers,

Dan

  • You *could* create an alert that triggers when a node is added that populates the custom property...depending on what you are trying to do and the logic/values to populate with.  you mentioned one CP causing another to update, that could be an escalation trigger action.

    Personally, I have a SQL "housekeeping" job that runs and populates stuff like this.  That would be another option if you have resources with SQL skills that can help.

  • njoylif​ thanks for that information i will propose the the first one to my manager and i cant help but want to know what the SQL looks like emoticons_happy.png would you be kind enough to share?, i did think maybe create a CASE statement when one CP is X then change Y and so on.

    i am relevantly new to SQL but not backing down from it emoticons_happy.png

  • sure...SQL knowledge will allow you to unlock a whole other level of potential within SW. 

    ***** DISCLAIMERS::: this is not supported by SW.

    ***** ALWAYS test work in a sandbox, not your production DB...and always backup your DB prior to work.  and there are tons of ways to do most everything...

    Update ncp

    SET custompropertyA='valueA'

    FROM NodeDetails nd

      join NodeCustomProperties ncp ON (nd.nodeid=ncp.nodeid)

    WHERE

         nd.machinetype='windows'

    you are correct in you could use a case statement for the logic part...*** all of this is off top of my head so syntax may not be just right...google is good. emoticons_happy.png

    update ncp

    SET custompropertyZ=CASE

         WHEN custompropertyA='ValueA' THEN 'Z'

         WHEN custompropertyA IS NULL THEN 'not Windows'

         ELSE 'something odd has happened'

         END

    FROM NodeCustomProperties ncp

  • Awesome cheers dude, really appreciate your time and knowledge  

    Dan

  • happy to help...that's part of what makes Thwack awesome!  Glad you found it useful