监控ansible结果

本次只写思路&简单例子

....入门级

-- 比较简单,键盘侠直接忽略

思路:

将ansible语句编写成简单的脚本

ybt root /etc/ansible #cat syl.sh 
#!/bin/bash
ansible test -m shell -a 'df -h'

编写启动定时任务

ybt root /etc/ansible #crontab -l
*/1 * * * * /etc/ansible/syl.sh > /etc/ansible/ybttest.txt

监控结果

watch -b -n 10 'cat ybttest.txt' 
posted @ 2021-07-20 11:32  ybt&kexiao  阅读(59)  评论(0编辑  收藏  举报