Docker Need to discovery using servicenow Discovery

venkatesh Munag
Tera Contributor

Hi All,

 

One of my customers looking for Docker discovery in Linux devices.

 

I have already shared the required user privileges, but they are asking us what Sudo commands will execute to fetch that information into the CMDB ServiceNow.

 

Below link: I referred to and shared the User privileges

https://docs.servicenow.com/en-US/bundle/vancouver-it-operations-management/page/product/discovery/c...

 

note: all the dockers are in the Linux devices, Kindly let us know the commands.

 

Your quick help will be much more appreciated!!

2 REPLIES 2

Jon Runheim
Tera Contributor

Hi,

The commands executed by the pattern are:

$sudo#docker version

$sudo#docker info > /dev/null 2>&1; echo $?

$sudo#docker version --format '{{.Server.GitCommit}}'

date -d '$build_date_as_string#' +%s

$sudo#docker version --format '{{.Server.Version}}'

$sudo#docker version --format '{{.Server.Os}}/{{.Server.Arch}}'

date -d '$build_date_as_string#' '+%Y-%m-%d %H:%M:%S'

$sudo#docker version --format \\'{{.Server.Version}}\\'

$sudo#docker version --format '{{.Server.GoVersion}}'

$sudo#docker version --format '{{.Server.BuildTime}}'

docker info > /dev/null 2>&1; echo $?

$sudo#docker images --filter dangling=false --format '{{.ID}}' | sort -u | tr '\\n' ' '

$sudo# docker image ls --digests --format '{{.ID}},{{.Repository}},{{.Digest}}'

 

I hope it helps!
Kind regards / Jon

Sorry,
There are two more:
${sudo} + " docker ps --format '{{.ID}}'"
${sudo} + " docker inspect --size " + it.toString()

 

With these additions we got the pattern working at a customer I worked with.

Kind regards / Jon