Hi,

I am tryig to write an Ansible script which will Generat Alert on Disk 
Usage. Once the Disk Usage goes above the Threshold, alert will be 
generated. 

Below is start up code.

---
 - hosts: "{{ hostGroup }}"
   user: gamesroot
   become: true
   become_user: root
   gather_facts: no
   tasks:
   - shell: df -h "{{ item }}" | tail -n 1 | awk {'print $5 '}  | sed 
's/%//g'
     with_items:
      - /
      - /home
      - /backup
     register: test

   - debug:
       msg: "{{ test.results|map(attribute='stdout')|list }}"
   - name: Size is big
     shell: echo "tobig size "
     when: test.results > 20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Here Problem isi  not able to Register Value and Compare it with Threshold. 

PLEASE help me for the SAME.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8c729828-c2ba-48fd-bca2-56f6b13f9ab8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to