McaFee更新日志所在目录位于 C:\Program Files\Common Files\McAfee\Engine\AMCoreUpdater\amupdate.dat
因此可以执行DOS命令
cd C:\Program Files\Common Files\McAfee\Engine\AMCoreUpdater&&dir
返回如下:
Volume in drive C is Windows
Volume Serial Number is DA32-CDE1
Directory of C:\Program Files\Common Files\McAfee\Engine\AMCoreUpdater
2018/01/18 12:17 <DIR> .
2018/01/18 12:17 <DIR> ..
2018/01/18 12:17 395,164 amupdate.dat
2017/07/19 10:59 2,399,984 amupdate.dll
2017/07/19 10:59 574,336 amupdate.exe
2017/07/19 10:59 2,564,256 amupdate64.dll
2017/07/19 10:59 234,072 amupdate_plugin.dll
5 File(s) 6,167,812 bytes
2 Dir(s) 15,317,721,088 bytes free
可以看到
2018/01/18 12:17 395,164 amupdate.dat
是最新更新时间。
这样在saltstack服务端可以这样执行
salt 'TIBERX' cmd.run 'cd C:\Program Files\Common Files\McAfee\Engine\AMCoreUpdater&&dir' | grep "amupdate.dat"
返回:
2018/01/18 12:17 395,164 amupdate.dat
如果没有安装Mcafee,则返回执行失败
ERROR: Minions returned with non-zero exit code