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

1689161671239

查询自启程序

ansible -i ~/hosts all -m shell -a 'ls /etc/rc.d/init.d/ |grep 360' >ls360

1689559350332

posted @ 2025-11-18 22:27  小蓝莓  阅读(1)  评论(0)    收藏  举报