Ad Widget

Collapse

Is it possible to make LLD from output of powershell external script?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Is it possible to make LLD from output of powershell external script?

    Hello!

    I have external python script which connects over winrm to Win Server and execute certaion powershell commands located in ps file.

    This is example of output of script:

    [email protected]_server:/usr/lib/zabbix/externalscripts$ python testwinrm.py 'ip_address' 'username' 'password' 'name_of_ps_file.ps'
    [
    {
    "DeviceID": "C:",
    "FreeSpace": 74742448128,
    "Size": 160533835776,
    "VolumeName": ""
    },
    {
    "DeviceID": "D:",
    "FreeSpace": 151431086080,
    "Size": 268234129408,
    "VolumeName": "Advanced baza"
    },
    {
    "DeviceID": "E:",
    "FreeSpace": 150398631936,
    "Size": 429295403008,
    "VolumeName": "Standard baza"
    },
    {
    "DeviceID": "F:",
    "FreeSpace": 624149921792,
    "Size": 857718390784,
    "VolumeName": "VIP baza"
    }
    ]


    So "Master Item" in zabbix will contain this data. Is it possible to create LLD from this output, with macros for Device ID, FreeSpace, Size etc... ?
    I can't figure it out how to make this work... Anyone smarter?

    #2
    If you want this file to work with LLD, then it need to contain LLD macros. LDD macro start with #
    "#DeviceID": "C:"
    "#DeviceID": "D:"
    now strings #DeviceID are LLD macro, and expand in items into C: D:....

    Comment


      #3
      absolutely. the general idea is to take an array of data and output a json with MACRO association that can get imported into your custom discovery

      Comment

      Announcement

      Collapse
      No announcement yet.
      Working...
      X