Added mcollective 2.3.1 package
[packages/trusty/mcollective.git] / website / reference / basic / daemon.md
1 ---
2 layout: default
3 title: Controlling the Daemon
4 ---
5
6 The main daemon that runs on nodes keeps internal stats and supports reloading of agents and changing
7 logging level without restarting.
8
9 If you want to reload all the agents without restarting the daemon you can just send it signal *USR1*
10 and it will reload its agents.
11
12 You can send *USR2* to cycle the log level through DEBUG to FATAL and back again, just keep sending
13 the signal and look at the logs.
14
15 Reloading agents work in most cases though we recommend a full daemon restart in production use
16 due to the nature of the ruby class loading system.  If you are changing agent contents and relying
17 on the reload behavior you might end up with agents not being in a consistent state.
18
19 ## Obtaining daemon statistics
20
21 The daemon keeps a number of statistics about its operation, you can view these using the _inventory_
22 application:
23
24 {% highlight console %}
25 % mco inventory example.com
26    Server Statistics:
27                       Version: 2.2.0
28                    Start Time: Mon Sep 24 17:37:28 +0100 2012
29                   Config File: /etc/mcollective/server.cfg
30                   Collectives: mcollective, fr_collective
31               Main Collective: mcollective
32                    Process ID: 24473
33                Total Messages: 52339
34       Messages Passed Filters: 44118
35             Messages Filtered: 8221
36              Expired Messages: 0
37                  Replies Sent: 29850
38          Total Processor Time: 527.06 seconds
39                   System Time: 349.32 seconds
40
41 .
42 .
43 .
44 {% endhighlight %}
45
46 The statistics mean:
47
48 |Statistic   |Meaning                                    |
49 |------------|-------------------------------------------|
50 |Start Time             |Local time on the node when the daemon started|
51 |Collectives            |All known collectives this agent responds on|
52 |Main Collective        |The primary collective|
53 |Process ID             |The process ID of the mcollectived|
54 |Total Messages         |Total messages received from the middleware|
55 |Messages Passed Filters|Amount of messages that was determined to be applicable to this node based on filters|
56 |Messages Filtered      |Messages that did not apply to this node|
57 |Expired Messages       |Received messages that had expired their TTL values|
58 |Replies Sent           |Not all received messages result in replies, this counts the actual replies sent|
59 |Total Processor Time   |Processor time including user and system time consumed since start|
60 |System Time            |System Processor time only|
61
62 You can get the raw values using the *rpcutil* agent using the *daemon_stats* action.
63
64 {% highlight console %}
65 % mco rpc rpcutil daemon_stats
66 Discovering hosts using the mongo method .... 26
67
68  * [ ============================================================> ] 26 / 26
69
70 .
71 .
72 .
73
74 example.com
75                Agents: ["stomputil",
76                         "nrpe",
77                         "package",
78                         "rpcutil",
79                         "rndc",
80                         "urltest",
81                         "iptables",
82                         "puppetd",
83                         "discovery",
84                         "service",
85                         "eximng",
86                         "filemgr",
87                         "process"]
88           Config File: /etc/mcollective/server.cfg
89         Failed Filter: 168432
90         Passed Filter: 91231
91                   PID: 1418
92               Replies: 91127
93            Start Time: 1347545937
94               Threads: ["#<Thread:0x7f44350964f8 sleep>",
95                         "#<Thread:0x7f4434f7f538 sleep>",
96                         "#<Thread:0x7f44390ce368 sleep>",
97                         "#<Thread:0x7f44350981b8 run>"]
98                 Times: {:cutime=>1111.13, :utime=>3539.21, :cstime=>1243.64, :stime=>5045.21}
99        Total Messages: 259842
100           TTL Expired: 179
101       Failed Security: 0
102    Security Validated: 259842
103               Version: 2.2.0
104
105
106 Summary of Agents:
107
108           package = 26
109           process = 26
110         discovery = 26
111           service = 26
112           puppetd = 26
113           filemgr = 26
114              nrpe = 26
115           rpcutil = 26
116         stomputil = 26
117          iptables = 11
118           urltest = 7
119           libvirt = 4
120            eximng = 4
121      registration = 3
122              rndc = 3
123     angelianotify = 2
124
125 Summary of Version:
126
127     2.2.0 = 26
128
129 Finished processing 26 / 26 hosts in 289.20 ms
130 {% endhighlight %}
131
132 ## Obtaining running configuration settings
133
134 All configuration settings of any mcollective daemon can be retrieved using the *get_config_item*
135 action of the *rpcutil* agent:
136
137 {% highlight console %}
138 % mco rpc rpcutil get_config_item item=collectives -I example.com
139 Discovering hosts using the mongo method .... 1
140
141  * [ ============================================================> ] 1 / 1
142
143
144 example.com:
145    Property: collectives
146       Value: ["mcollective", "fr_collective"]
147
148
149 Summary of Value:
150
151       mcollective = 1
152     fr_collective = 1
153
154
155 Finished processing 1 / 1 hosts in 59.05 ms
156 {% endhighlight %}