The VMware Carbon Black Tech Zone is live! Checkout this great resource: Mastering Carbon Black Audit & Remediation.

check state of docker containers

Description: looks to see what state all docker containers are in. (running, paused, stopped)

What The Data Shows: gives an audit of all your docker containers, and their respective states. this will show your total number of containers, and how many are running, paused or stopped. this can help to ensure up-time of production containers, and troubleshoot any potential issues.

SQL: 

SELECT substr(id,0,5) as "first 5 of ID",

containers,containers_running,containers_paused,containers_stopped FROM (`docker_info`);

 

0 Votes
3 Comments
jnelson
Carbon Black Employee
Status changed to: Under Review

@coreymaygard would you consider just pulling the first five of the ID? That is about all you need to do anything in Docker with that container, and it doesn't clutter up the results. Here is an example:

SELECT substr(id,0,5) as "first 5 of ID",

containers,containers_running,containers_paused,containers_stopped FROM (`docker_info`);

coreymaygard
New Contributor III

thanks Jnelson. I edited the query to reflect your suggestion

jnelson
Carbon Black Employee
Status changed to: Approved