Skip to content

Commit

Permalink
ENT-6610 - name change to abstract/more general
Browse files Browse the repository at this point in the history
  • Loading branch information
craigcomstock committed Feb 28, 2024
1 parent 36b062a commit f1606e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker_inventory.cf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ bundle agent docker_inventory
have_docker::
"status_list" slist => { "created", "restarting", "running", "removing", "pause", "exited", "dead" };
"status_count[${status_list}]" int => int(execresult(`${docker} ps -a --filter "status=${status_list}" --format "{{.Names}}" | wc -l`, "useshell", "stdout")),
meta => { "inventory", "attribute_name=Docker ${status_list} Count" };
meta => { "inventory", "attribute_name=Containers - ${status_list} Count" };
"running_string" string => execresult(`${docker} ps -a --filter "status=running" --format "{{.Names}}"`, "noshell", "stdout");
"running_names" slist => splitstring("${running_string}", "\n", "inf"),
meta => { "inventory", "attribute_name=Docker Running Names" };
meta => { "inventory", "attribute_name=Containers - Running Names" };
"dangling_count" int => int(execresult(`${docker} images --filter "dangling=true" --format "{{.Repository}}" | wc -l`, "useshell", "stdout")),
meta => { "inventory", "attribute_name=Docker Dangling Image Count" };
meta => { "inventory", "attribute_name=Containers - Dangling Image Count" };
"images_string" string => execresult(`${docker} images --format "{{.Repository}}:{{.Tag}}"`, "noshell", "stdout");
"images_list" slist => splitstring("${images_string}", "\n", "inf"),
meta => { "inventory", "attribute_name=Docker Image List" };
meta => { "inventory", "attribute_name=Containers - Image List" };

reports:
any::
Expand Down

0 comments on commit f1606e5

Please sign in to comment.