Forum Discussion

teppotahkapaa's avatar
9 months ago

Device configuration "key/value" pairs synchronization to ITSM

 

With Powerflow most data are pretty easy to sync from SL1 to ITSM/CMDB, in this case ServiceNow. But now we have requirement that we should sync cloud device tags from SL1 to SN.

The data from Azure virtual server, using Azure PP, is shown on SL1 like below, multiple key/value rows per device. So those are not easily stored into Attributes. And if I have understood correctly, quite a lot of tags used in cloud.

Any ideas how these could be synced with PF into ServiceNow?

 

  • One possible way to make this work with the data as is would be to update the DA and stringify the Key/Value pairs using json.dumps() into a single attribute or asset field in SL1.

    Then in the PowerFlow mappings configuration, you could utilize a jinja template to load that string back into an object, using json.loads(). Once you have that object, you can either iterate through every key/value pair, or select a specific key to map to a ServiceNow attribute.

    Something like: (note I have not run this personally, this is just an example)

    {%- set tagObj = json.loads(tagString) -%}
    {%- set oneTagValue = tagObj['desiredTagKey'] %}

    Hopefully this suffices using the DA data as it exists today. However, it does seem there is room for improvement in that the DA should set the tags in a way that is more easily and consistently consumable by PF.

    To best address this, please open a support ticket requesting the improvement, and let us know how you feel would be the best way to handle this tag data.

     

    Thanks

     

  • One possible way to make this work with the data as is would be to update the DA and stringify the Key/Value pairs using json.dumps() into a single attribute or asset field in SL1.

    Then in the PowerFlow mappings configuration, you could utilize a jinja template to load that string back into an object, using json.loads(). Once you have that object, you can either iterate through every key/value pair, or select a specific key to map to a ServiceNow attribute.

    Something like: (note I have not run this personally, this is just an example)

    {%- set tagObj = json.loads(tagString) -%}
    {%- set oneTagValue = tagObj['desiredTagKey'] %}

    Hopefully this suffices using the DA data as it exists today. However, it does seem there is room for improvement in that the DA should set the tags in a way that is more easily and consistently consumable by PF.

    To best address this, please open a support ticket requesting the improvement, and let us know how you feel would be the best way to handle this tag data.

     

    Thanks

     

    • teppotahkapaa's avatar
      teppotahkapaa
      Icon for Expert rankExpert

      Thanks Douglas,

      well, this solves one issue, but to root cause is still there. And actually there are even more issues found here. In normal ServiceNow way, those tags are to be stored in separate table (cmdb_key_value) [that's the way SN has decided it to work] and in that table there is only CI-sysid, key and value columns. 

      And as this DA is SL built, we can not just edit the code (that is in libraries, and anyway next PP update would overwrite it), so we need to built some other kind of magic here.

      So, to make this SN proof, needs some more work.

      br

      Teppo

  • Quick and dirty answer for you here. If this is DA data you could always edit the DA and map the collection object to an asset field that is then synced over the SN integration. 

    • teppotahkapaa's avatar
      teppotahkapaa
      Icon for Expert rankExpert

      This DA is: Microsoft: Azure Virtual Machine Configuration

      And as show, it actually retrieves multiple rows, with each one having key/value pair. In assets there is no such place to store those. Nor in PF, not easy way to send such information.

      Probably needs it's own DA (whooa) to read that data and store it into Attribute, probably easier than asset, or rewrite the SL made snippet to store that data also into other collection object, in one string, so that it can be sent to CMDB

    • teppotahkapaa's avatar
      teppotahkapaa
      Icon for Expert rankExpert

      Well, this is DA made by ScienceLogic. So I am trying to find the correct logic here.

      • SaraLeslieAdmin's avatar
        SaraLeslieAdmin
        Icon for Community Manager rankCommunity Manager

        Hello, thanks for your patience as we have been discussing this internally.

        It looks like the appropriate next step is to open a support ticket with the team to track this experience and identify next steps which may include creating a new Idea depending on what the team recommends.

        I know you are familiar with the customer support portal but for those who are new here: Support Portal

        Please keep us posted with your progress. 

        Best, Sara 

  • Hello and thank you for posting this question, I'm working internally to identify a solution. I will be back with you shortly. 

    Best, Sara