cancel
Showing results for 
Search instead for 
Did you mean: 
sonu_2311
Mission Specialist
Mission Specialist
  • 1,009 Views

Disk usage playbook

Hi all,

Can anyone guide me the playbook that display the disk usage. in that it display the folders/directories with maximum usage and also get the message... 

and one more thing for the logrotate playbook also.

 

Thanks.

Labels (1)
0 Kudos
1 Reply
lp3
Cadet
Cadet
  • 825 Views

To display disk usage you can grab the disk usage details using ansible_facts.mounts and a jinja2 conditional like this: "Drive is mounted at {{ item.mount }} {% if item.block_used/item.block_total * 100 > 80 -%} You'll notice at the end of the conditional a bit of simple math does the comparison for whether the drive is over 80% full. 

0 Kudos
Join the discussion
You must log in to join this conversation.