Ad Widget

Collapse

Autoregistration actions - running a custom script with provided parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ivgenyr
    Junior Member
    • Jun 2020
    • 17

    #1

    Autoregistration actions - running a custom script with provided parameters

    Hi all,
    i have a python script that i need to be executed when a certain type of server is discovered.
    Information is provided by HostMetaData.
    For example:
    <hostname> ILO=<ilo_ip>

    I need to execute the mention above script upon discovery, and provide it with hostname and ilo_ip from the metadata.
    Anybody can point me please in the correct direction ?

    I know that i need to create an autoregistrtion action "remote command", and then select "custom script", but how can i parse the values from metadata and provide it as arguments?
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I think you can only pass the full {host.metadata} in the *Commands field, you would have to parse it in python. The action conditions could be conditional on "host metadata contains ILO".

    Comment

    • ivgenyr
      Junior Member
      • Jun 2020
      • 17

      #3
      Thanks LenR , tha't what i did eventually. U used "<script> {HOST.METADATA}" in the command

      Comment

      Working...