我了解
puppet agent --disable "my message" --verbose
但我希望在某个特定的机器上知道它的Puppet代理状态,但我不知道如何从中获取。
man puppet-agent
有没有一条命令可以告诉我代理是否已启用或禁用?
谢谢。
-
------------------- 编辑
CentOS release 6.6 (Final)
bash-4.1$ puppet --version
3.7.4
bash-4.1$ file /usr/bin/puppet
/usr/bin/puppet: a /usr/bin/ruby script text executable
无论它是启用还是禁用,我始终会得到这个:[root@p1al25 ~]# cat `sudo puppet agent --configprint agent_catalog_run_lockfile`
cat: /var/lib/puppet/state/agent_catalog_run.lock: No such file or directory
[root@p1al25 ~]# puppet agent --disable "my message"
[root@p1al25 ~]# cat `sudo puppet agent --configprint agent_catalog_run_lockfile`
cat: /var/lib/puppet/state/agent_catalog_run.lock: No such file or directory
[root@p1al25 ~]# service puppet status
puppet (pid 4387) is running...
这个有效,谢谢 daxlerod
[root@p1al25 ~]# service puppet status
puppet (pid 4387) is running...
[root@p1al25 ~]# puppet agent --disable "my message" --verbose
Notice: Disabling Puppet.
[root@p1al25 ~]# cat `puppet agent --configprint agent_disabled_lockfile`
{"disabled_message":"reason not specified"}