1metadata    :name        => "puppet",
2            :description => "Information about Puppet agent state",
3            :author      => "R.I.Pienaar <rip@devco.net>",
4            :license     => "ASL 2.0",
5            :version     => "1.1",
6            :url         => "http://puppetlabs.com/",
7            :timeout     => 1
8
9usage <<-EOU
10This data plugin lets you extract information about the Puppet Agent Daemon
11for use in discovery and elsewhere.
12
13To force a Puppet catalog run on machine that has not recently run:
14
15   mco rpc puppet runonce -S "puppet().since_lastrun > 1800"
16EOU
17
18dataquery :description => "Puppet Agent state" do
19    output :applying,
20           :description => "Is a catalog being applied",
21           :display_as  => "Applying",
22           :default     => false
23
24    output :enabled,
25           :description => "Is the agent currently locked",
26           :display_as  => "Enabled",
27           :default     => false
28
29    output :daemon_present,
30           :description => "Is the Puppet agent daemon running on this system",
31           :display_as  => "Daemon Running",
32           :default     => false
33
34    output :lastrun,
35           :description => "When the Agent last applied a catalog in local time",
36           :display_as  => "Last Run",
37           :default     => 0
38
39    output :since_lastrun,
40           :description => "How long ago did the Agent last apply a catalog in local time",
41           :display_as  => "Since Last Run",
42           :default     => -1
43
44    output :status,
45           :description => "Current status of the Puppet agent",
46           :display_as  => "Status",
47           :default     => "unknown"
48
49    output :disable_message,
50           :description => "Message supplied when agent was disabled",
51           :display_as  => "Lock Message",
52           :default     => ""
53
54    output :idling,
55           :description => "Is the Puppet agent daemon running but not doing any work",
56           :display_as  => "Idling",
57           :default     => false
58end
59