Package: infrasonar
The InfraSonar tool can be used to manage assets for a container. The tool has two main features. One is to read all assets from a container to YAML output. If needed, all collector and label information can be included.
The other feature of this tool is to apply a YAML file to InfraSonar. These two features combined allow you to easily add new assets as well as managing existing assets for a container.InstallationUsing pip:pipinstallinfrasonarOr, clone this project and use the setuppythonsetup.pyinstallApply assetsCreate ayamlfile, for example:assets.yaml(you may also useget-assetsto export the current assets and make modifications)container:12345labels:windows:3257configs:tcp:checkCertificatePorts:[443,995,993,465,3389,989,990,636,5986]assets:-name:foo.localkind:Windowslabels:["windows"]collectors:-key:lastseen-key:ping-key:tcpconfig:tcp-key:wmiNext, use the following command to apply the assets:(-awillonly addlabels and collectors,-dperforms adry-runwithout actually applying the changes)infrasonarapply-assetsassets.yaml-a-dThe script will create a new asset if an asset with the given name cannot be found, otherwise it will apply the changes to the existing asset. Existing labels and/or collectors willnotbe removed, but akindwill be overwritten if one is given. The propertieskind,description,mode,labelsandcollectorsare all optional.TokenA token might be included in the yaml file:token:xxxxxxOr, it will be asked in a prompt when starting the script.:point_right: Note that atokenwithAgentflags must be used for theapply-assetsaction to work. Acontainer tokenis required when nocontainer Idis given or when one or more assets without anasset Idare used.Get assetGet a single asset.(in the example below, 123 is a asset Id)infrasonarget-asset123-oyamlGet assetsGet container assets.(in the example below, 123 is a container Id)infrasonarget-assets123-oyamlVMware guestsGenerate YAML (or JSON) with VMware Guests which are found on ESX or vCenter but wherefore no asset with thevmwareguestcollector is found. This YAML can then be used to install the VMware Guest collector with a single command.Example:(in the example below, 123 is a container Id)infrasonarvmware-guests123>missing.yamlReview the missing.yaml file(open in editor or apply a dry-run)infrasonar apply-assets missing.yaml -a -d:point_right: Do not forget to use-ato prevent removing other collectors and use-dto perform a dry-run for verifying the changes.Hyper-V guestsGenerate YAML (or JSON) with Hyper-V Guests which are found on a Hyper-V asset(s) but wherefore no asset with thehypervguestcollector is found. This YAML can then be used to install the Hyper-V Guest collector with a single command.Example:(in the example below, 123 is a container Id)infrasonarhyperv-guests123>missing.yamlReview the missing.yaml file(open in editor or apply a dry-run)infrasonar apply-assets missing.yaml -a -d:point_right: Do not forget to use-ato prevent removing other collectors and use-dto perform a dry-run for verifying the changes.UniFi devicesGenerate YAML (or JSON) with UniFi devices which are found on a UniFi Controller asset(s) but wherefore no asset with theunifidevicecollector is found. This YAML can then be used to install the UniFi Device collector with a single command.Example:(in the example below, 123 is a container Id)infrasonarunifi-devices123>missing.yamlReview the missing.yaml file(open in editor or apply a dry-run)infrasonar apply-assets missing.yaml -a -d:point_right: Do not forget to use-ato prevent removing other collectors and use-dto perform a dry-run for verifying the changes.Helpinfrasonar -h
infrasonar get-asset -h
infrasonar get-assets -h
infrasonar apply-assets -h
infrasonar vmware-guests -h