Ansible 查询主机是否有360进程
Ansible 查询主机是否有360进程
编辑主机配置文件
vi hosts
ip ansible_ssh_user=用户 ansible_ssh_pass='密码'
ip ansible_ssh_user=用户 ansible_ssh_pass='密码'
#hosts所有主机都执行ps -ef|grep -v grep|grep 360 safe > ps360命令
ansible -i ~/hosts all -m shell -a 'ps -ef|grep -v grep|grep 360safe' >ps360

查询自启程序
ansible -i ~/hosts all -m shell -a 'ls /etc/rc.d/init.d/ |grep 360' >ls360


浙公网安备 33010602011771号