mosquitto.8.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <?xml-stylesheet type="text/xsl" href="manpage.xsl"?>
  3. <refentry xml:id="mosquitto" xmlns:xlink="http://www.w3.org/1999/xlink">
  4. <refmeta>
  5. <refentrytitle>mosquitto</refentrytitle>
  6. <manvolnum>8</manvolnum>
  7. <refmiscinfo class="source">Mosquitto Project</refmiscinfo>
  8. <refmiscinfo class="manual">System management commands</refmiscinfo>
  9. </refmeta>
  10. <refnamediv>
  11. <refname>mosquitto</refname>
  12. <refpurpose>an MQTT broker</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis>
  16. <command>mosquitto</command>
  17. <arg>-c <replaceable>config file</replaceable></arg>
  18. <group>
  19. <arg choice='plain'>-d</arg>
  20. <arg choice='plain'>--daemon</arg>
  21. </group>
  22. <arg>-p <replaceable>port number</replaceable></arg>
  23. <arg>-v</arg>
  24. </cmdsynopsis>
  25. </refsynopsisdiv>
  26. <refsect1>
  27. <title>Description</title>
  28. <para><command>mosquitto</command> is a broker for the MQTT protocol version 5.0/3.1.1/3.1.</para>
  29. </refsect1>
  30. <refsect1>
  31. <title>Options</title>
  32. <variablelist>
  33. <varlistentry>
  34. <term><option>-c</option></term>
  35. <term><option>--config-file</option></term>
  36. <listitem>
  37. <para>
  38. Load configuration from a file. If not given, then the broker will listen on port 1883 bound to the loopback interface,
  39. and the default values as described in
  40. <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>
  41. are used.
  42. </para>
  43. <important><para>See the <option>-p</option> option for a description of changes in behaviour from 1.6.x to 2.0.</para></important>
  44. </listitem>
  45. </varlistentry>
  46. <varlistentry>
  47. <term><option>-d</option></term>
  48. <term><option>--daemon</option></term>
  49. <listitem>
  50. <para>Run <command>mosquitto</command> in the background as a daemon. All other behaviour remains the same.</para>
  51. </listitem>
  52. </varlistentry>
  53. <varlistentry>
  54. <term><option>-p</option></term>
  55. <term><option>--port</option></term>
  56. <listitem>
  57. <para>Listen on the port specified. May be specified up to 10 times to open multiple sockets listening on different ports.</para>
  58. <important><para>In version 1.6.x and earlier, the listener defined by <option>-p</option> (or the default port of 1883) would be
  59. bound to all interfaces and so be accessible from any network. It could also be used in combination with <option>-c</option>.</para>
  60. <para>From version 2.0 onwards, the listeners defined with <option>-p</option> are bound to the loopback interface only, and so can
  61. only be connected to from the local machine. If both <option>-p</option> is used and a listener is defined in a configuration
  62. file, then the <option>-p</option> options are IGNORED.</para></important>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry>
  66. <term><option>-v</option></term>
  67. <term><option>--verbose</option></term>
  68. <listitem>
  69. <para>Use verbose logging. This is equivalent to setting
  70. <option>log_type</option> to <option>all</option> in
  71. the configuration file. This overrides and logging
  72. options given in the configuration file.</para>
  73. </listitem>
  74. </varlistentry>
  75. </variablelist>
  76. </refsect1>
  77. <refsect1>
  78. <title>Configuration</title>
  79. <para>The broker can be configured using a configuration file as
  80. described in
  81. <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>
  82. and this is the main point of information for mosquitto.
  83. The files required for SSL/TLS support are described in
  84. <citerefentry><refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle><manvolnum>7</manvolnum></citerefentry>.
  85. </para>
  86. </refsect1>
  87. <refsect1>
  88. <title>Platform limitations</title>
  89. <para>
  90. Some versions of Windows have limitations on the number of
  91. concurrent connections due to the Windows API being used. In
  92. modern versions of Windows, e.g. Windows 10 or Windows Server
  93. 2019, this is approximately 8192 connections. In earlier
  94. versions of Windows, this limit is 2048 connections.
  95. </para>
  96. </refsect1>
  97. <refsect1>
  98. <title>MQTT Support</title>
  99. <para>Mosquitto supports MQTT v5.0, v3.1.1, and v3.1.</para>
  100. <refsect2>
  101. <title>MQTT v5.0</title>
  102. <para>
  103. Mosquitto provides full MQTT v5.0 support, but some features
  104. are not used directly. The following sections describe the new
  105. features and explain where Mosquitto does not make use of a feature.
  106. </para>
  107. <refsect3>
  108. <title>Features</title>
  109. <variablelist>
  110. <varlistentry>
  111. <term><option>Enhanced authentication</option></term>
  112. <listitem><para>
  113. Basic MQTT authentication uses username/password
  114. checks. Enhanced authentication allows different
  115. authentication schemes to be integrated into MQTT,
  116. and even those schemes with multiple step processes.
  117. Clients request a particular type of authentication
  118. and if the broker is configured for that scheme the
  119. authentication continues. Mosquitto supports
  120. enhanced authentication through plugins.
  121. </para></listitem>
  122. </varlistentry>
  123. <varlistentry>
  124. <term><option>Error handling</option></term>
  125. <listitem><para>
  126. Most MQTT packets now have the concept of a
  127. <option>reason code</option>
  128. which indicates success or failure, and what the failure
  129. was. Mosquitto provides full support for reason codes,
  130. but does not make use of the
  131. <option>reason string</option>
  132. feature which can be used to provide a human readable
  133. error string to explain the reason code.
  134. </para></listitem>
  135. </varlistentry>
  136. <varlistentry>
  137. <term><option>Flow control</option></term>
  138. <listitem><para>
  139. The number of "in flight" messages for QoS 1 and QoS
  140. 2 can be controlled by both the client and the
  141. broker.
  142. </para></listitem>
  143. </varlistentry>
  144. <varlistentry>
  145. <term><option>Request / response</option></term>
  146. <listitem><para>
  147. MQTT v5.0 adds a request/response pattern that
  148. allows a client to publish a message and instruct
  149. the subscribers of that message where to publish a
  150. response.
  151. </para></listitem>
  152. </varlistentry>
  153. <varlistentry>
  154. <term><option>Server redirection</option></term>
  155. <listitem><para>
  156. Server redirection is the concept of telling a
  157. client to connect to a different MQTT broker, either
  158. on CONNECT or with a broker initiated DISCONNECT.
  159. Mosquitto does not currently make use of this
  160. feature.
  161. </para></listitem>
  162. </varlistentry>
  163. <varlistentry>
  164. <term><option>Shared subscriptions</option></term>
  165. <listitem><para>
  166. When multiple clients subscribe to the same shared
  167. subscription, only one client out of the group will
  168. receive each message which allows for distributing
  169. work loads.
  170. </para></listitem>
  171. </varlistentry>
  172. </variablelist>
  173. </refsect3>
  174. <refsect3>
  175. <title>Packet properties</title>
  176. <para>
  177. MQTT v5.0 allows properties to be added to packets to
  178. control certain behaviour. Unless noted, Mosquitto
  179. support the properties listed below.
  180. </para>
  181. <variablelist>
  182. <varlistentry>
  183. <term><option>CONNECT</option></term>
  184. <listitem>
  185. <itemizedlist>
  186. <listitem><para>Authentication data</para></listitem>
  187. <listitem><para>Authentication method</para></listitem>
  188. <listitem><para>Maximum packet size</para></listitem>
  189. <listitem><para>Receive maximum</para></listitem>
  190. <listitem><para>Request problem information - supported but not used</para></listitem>
  191. <listitem><para>Request response information - supported but not used</para></listitem>
  192. <listitem><para>Session expiry interval</para></listitem>
  193. <listitem><para>Topic alias maximum</para></listitem>
  194. <listitem><para>User property</para></listitem>
  195. </itemizedlist>
  196. </listitem>
  197. </varlistentry>
  198. <varlistentry>
  199. <term><option>Last will and testament</option></term>
  200. <listitem>
  201. <itemizedlist>
  202. <listitem><para>Content type</para></listitem>
  203. <listitem><para>Correlation data</para></listitem>
  204. <listitem><para>Message expiry interval</para></listitem>
  205. <listitem><para>Payload format indicator</para></listitem>
  206. <listitem><para>Response topic</para></listitem>
  207. <listitem><para>User property</para></listitem>
  208. <listitem><para>Will delay interval</para></listitem>
  209. </itemizedlist>
  210. </listitem>
  211. </varlistentry>
  212. <varlistentry>
  213. <term><option>CONNACK</option></term>
  214. <listitem>
  215. <itemizedlist>
  216. <listitem><para>Assigned client identifier</para></listitem>
  217. <listitem><para>Authentication data</para></listitem>
  218. <listitem><para>Authentication method</para></listitem>
  219. <listitem><para>Maximum packet size</para></listitem>
  220. <listitem><para>Maximum qos</para></listitem>
  221. <listitem><para>Reason string - supported but not used</para></listitem>
  222. <listitem><para>Receive maximum</para></listitem>
  223. <listitem><para>Response information - supported but not used</para></listitem>
  224. <listitem><para>Retain available</para></listitem>
  225. <listitem><para>Server keep alive</para></listitem>
  226. <listitem><para>Server reference - supported but not used</para></listitem>
  227. <listitem><para>Session expiry interval</para></listitem>
  228. <listitem><para>Shared subscription available</para></listitem>
  229. <listitem><para>Subscription identifiers available</para></listitem>
  230. <listitem><para>Topic alias maximum</para></listitem>
  231. <listitem><para>User property</para></listitem>
  232. <listitem><para>Wildcard subscription available</para></listitem>
  233. </itemizedlist>
  234. </listitem>
  235. </varlistentry>
  236. <varlistentry>
  237. <term><option>PUBLISH</option></term>
  238. <listitem>
  239. <itemizedlist>
  240. <listitem><para>Content type</para></listitem>
  241. <listitem><para>Correlation data</para></listitem>
  242. <listitem><para>Message expiry interval</para></listitem>
  243. <listitem><para>Payload format indicator</para></listitem>
  244. <listitem><para>Response topic</para></listitem>
  245. <listitem><para>Subscription identifier</para></listitem>
  246. <listitem><para>Topic alias</para></listitem>
  247. <listitem><para>User property</para></listitem>
  248. </itemizedlist>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry>
  252. <term><option>PUBACK / PUBREC / PUBREL / PUBCOMP / SUBACK / SUBSCRIBE / SUBACK</option></term>
  253. <listitem>
  254. <itemizedlist>
  255. <listitem><para>Reason string - supported but not used</para></listitem>
  256. <listitem><para>User property</para></listitem>
  257. </itemizedlist>
  258. </listitem>
  259. </varlistentry>
  260. <varlistentry>
  261. <term><option>SUBSCRIBE</option></term>
  262. <listitem>
  263. <itemizedlist>
  264. <listitem><para>Subscription identifier</para></listitem>
  265. <listitem><para>User property</para></listitem>
  266. </itemizedlist>
  267. </listitem>
  268. </varlistentry>
  269. <varlistentry>
  270. <term><option>DISCONNECT</option></term>
  271. <listitem>
  272. <itemizedlist>
  273. <listitem><para>Reason string - supported but not used</para></listitem>
  274. <listitem><para>Server reference - supported but not used</para></listitem>
  275. <listitem><para>Session expiry interval</para></listitem>
  276. <listitem><para>User property</para></listitem>
  277. </itemizedlist>
  278. </listitem>
  279. </varlistentry>
  280. <varlistentry>
  281. <term><option>AUTH</option></term>
  282. <listitem>
  283. <itemizedlist>
  284. <listitem><para>Authentication method</para></listitem>
  285. <listitem><para>Authentication data</para></listitem>
  286. <listitem><para>Reason string - supported but not used</para></listitem>
  287. <listitem><para>User property</para></listitem>
  288. </itemizedlist>
  289. </listitem>
  290. </varlistentry>
  291. </variablelist>
  292. </refsect3>
  293. </refsect2>
  294. <refsect2>
  295. <title>MQTT v3.1.1</title>
  296. <para>Mosquitto provides full MQTT v3.1.1 support.</para>
  297. </refsect2>
  298. <refsect2>
  299. <title>MQTT v3.1</title>
  300. <para>Mosquitto provides full MQTT v3.1 support.</para>
  301. </refsect2>
  302. <refsect2>
  303. <title>MQTT v3</title>
  304. <para>
  305. MQTT v3 is an obsolete version of the protocol that does not
  306. support username/password authentication and used the
  307. <option>clean start</option> flag in the CONNECT packet which
  308. applied only to the start of a session. An MQTT v3 client
  309. will be able to successfully connect to a Mosquitto instance
  310. that does not require authentication.
  311. </para>
  312. </refsect2>
  313. </refsect1>
  314. <refsect1>
  315. <title>Broker Status</title>
  316. <para>Clients can find information about the broker by subscribing to
  317. topics in the $SYS hierarchy as follows. Topics marked as static are
  318. only sent once per client on subscription. All other topics are updated
  319. every <option>sys_interval</option> seconds. If
  320. <option>sys_interval</option> is 0, then updates are not sent.</para>
  321. <para>Note that if you are using a command line client to interact with the
  322. $SYS topics and your shell interprets $ as an environment variable,
  323. you need to place the topic in single quotes '$SYS/...' or to
  324. escape the dollar symbol: \$SYS/... otherwise the $SYS will be
  325. treated as an environment variable.</para>
  326. <variablelist>
  327. <varlistentry>
  328. <term><option>$SYS/broker/bytes/received</option></term>
  329. <listitem>
  330. <para>The total number of bytes received since the broker
  331. started.</para>
  332. </listitem>
  333. </varlistentry>
  334. <varlistentry>
  335. <term><option>$SYS/broker/bytes/sent</option></term>
  336. <listitem>
  337. <para>The total number of bytes sent since the broker
  338. started.</para>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry>
  342. <term><option>$SYS/broker/clients/connected</option></term>
  343. <term><option>$SYS/broker/clients/active</option> (deprecated)</term>
  344. <listitem>
  345. <para>The number of currently connected clients.</para>
  346. </listitem>
  347. </varlistentry>
  348. <varlistentry>
  349. <term><option>$SYS/broker/clients/expired</option></term>
  350. <listitem>
  351. <para>The number of disconnected persistent clients that
  352. have been expired and removed through the
  353. persistent_client_expiration option.</para>
  354. </listitem>
  355. </varlistentry>
  356. <varlistentry>
  357. <term><option>$SYS/broker/clients/disconnected</option></term>
  358. <term><option>$SYS/broker/clients/inactive</option> (deprecated)</term>
  359. <listitem>
  360. <para>The total number of persistent clients (with clean
  361. session disabled) that are registered at the broker but are
  362. currently disconnected.</para>
  363. </listitem>
  364. </varlistentry>
  365. <varlistentry>
  366. <term><option>$SYS/broker/clients/maximum</option></term>
  367. <listitem>
  368. <para>The maximum number of clients that have been
  369. connected to the broker at the same time.</para>
  370. </listitem>
  371. </varlistentry>
  372. <varlistentry>
  373. <term><option>$SYS/broker/clients/total</option></term>
  374. <listitem>
  375. <para>The total number of active and inactive clients
  376. currently connected and registered on the
  377. broker.</para>
  378. </listitem>
  379. </varlistentry>
  380. <varlistentry>
  381. <term><option>$SYS/broker/connection/#</option></term>
  382. <listitem>
  383. <para>When bridges are configured to/from the broker,
  384. common practice is to provide a status topic that
  385. indicates the state of the connection. This is provided
  386. within $SYS/broker/connection/ by default. If the value
  387. of the topic is 1 the connection is active, if 0 then
  388. it is not active. See the Bridges section below for
  389. more information on bridges.</para>
  390. </listitem>
  391. </varlistentry>
  392. <varlistentry>
  393. <term><option>$SYS/broker/heap/current size</option></term>
  394. <listitem>
  395. <para>The current size of the heap memory in use by
  396. mosquitto. Note that this topic may be unavailable
  397. depending on compile time options.</para>
  398. </listitem>
  399. </varlistentry>
  400. <varlistentry>
  401. <term><option>$SYS/broker/heap/maximum size</option></term>
  402. <listitem>
  403. <para>The largest amount of heap memory used by
  404. mosquitto. Note that this topic may be unavailable
  405. depending on compile time options.</para>
  406. </listitem>
  407. </varlistentry>
  408. <varlistentry>
  409. <term><option>$SYS/broker/load/connections/+</option></term>
  410. <listitem>
  411. <para>The moving average of the number of CONNECT packets
  412. received by the broker over different time intervals.
  413. The final "+" of the hierarchy can be 1min, 5min or
  414. 15min. The value returned represents the number of
  415. connections received in 1 minute, averaged over 1, 5 or
  416. 15 minutes.</para>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry>
  420. <term><option>$SYS/broker/load/bytes/received/+</option></term>
  421. <listitem>
  422. <para>The moving average of the number of bytes received by
  423. the broker over different time intervals. The final "+"
  424. of the hierarchy can be 1min, 5min or 15min. The value
  425. returned represents the number of bytes received in 1
  426. minute, averaged over 1, 5 or 15 minutes.</para>
  427. </listitem>
  428. </varlistentry>
  429. <varlistentry>
  430. <term><option>$SYS/broker/load/bytes/sent/+</option></term>
  431. <listitem>
  432. <para>The moving average of the number of bytes sent by the
  433. broker over different time intervals. The final "+" of
  434. the hierarchy can be 1min, 5min or 15min. The value
  435. returned represents the number of bytes sent in 1
  436. minute, averaged over 1, 5 or 15 minutes.</para>
  437. </listitem>
  438. </varlistentry>
  439. <varlistentry>
  440. <term><option>$SYS/broker/load/messages/received/+</option></term>
  441. <listitem>
  442. <para>The moving average of the number of all types of MQTT
  443. messages received by the broker over different time
  444. intervals. The final "+" of the hierarchy can be 1min,
  445. 5min or 15min. The value returned represents the number
  446. of messages received in 1 minute, averaged over 1, 5 or
  447. 15 minutes.</para>
  448. </listitem>
  449. </varlistentry>
  450. <varlistentry>
  451. <term><option>$SYS/broker/load/messages/sent/+</option></term>
  452. <listitem>
  453. <para>The moving average of the number of all types of MQTT
  454. messages sent by the broker over different time
  455. intervals. The final "+" of the hierarchy can be 1min,
  456. 5min or 15min. The value returned represents the number
  457. of messages send in 1 minute, averaged over 1, 5 or 15
  458. minutes.</para>
  459. </listitem>
  460. </varlistentry>
  461. <varlistentry>
  462. <term><option>$SYS/broker/load/publish/dropped/+</option></term>
  463. <listitem>
  464. <para>The moving average of the number of publish messages
  465. dropped by the broker over different time intervals.
  466. This shows the rate at which durable clients that are
  467. disconnected are losing messages. The final "+" of the
  468. hierarchy can be 1min, 5min or 15min. The value
  469. returned represents the number of messages dropped in 1
  470. minute, averaged over 1, 5 or 15 minutes.</para>
  471. </listitem>
  472. </varlistentry>
  473. <varlistentry>
  474. <term><option>$SYS/broker/load/publish/received/+</option></term>
  475. <listitem>
  476. <para>The moving average of the number of publish messages
  477. received by the broker over different time intervals.
  478. The final "+" of the hierarchy can be 1min, 5min or
  479. 15min. The value returned represents the number of
  480. publish messages received in 1 minute, averaged over 1,
  481. 5 or 15 minutes.</para>
  482. </listitem>
  483. </varlistentry>
  484. <varlistentry>
  485. <term><option>$SYS/broker/load/publish/sent/+</option></term>
  486. <listitem>
  487. <para>The moving average of the number of publish messages
  488. sent by the broker over different time intervals. The
  489. final "+" of the hierarchy can be 1min, 5min or 15min.
  490. The value returned represents the number of publish
  491. messages sent in 1 minute, averaged over 1, 5 or 15
  492. minutes.</para>
  493. </listitem>
  494. </varlistentry>
  495. <varlistentry>
  496. <term><option>$SYS/broker/load/sockets/+</option></term>
  497. <listitem>
  498. <para>The moving average of the number of socket
  499. connections opened to the broker over different time
  500. intervals. The final "+" of the hierarchy can be 1min,
  501. 5min or 15min. The value returned represents the number
  502. of socket connections in 1 minute, averaged over 1, 5
  503. or 15 minutes.</para>
  504. </listitem>
  505. </varlistentry>
  506. <varlistentry>
  507. <term><option>$SYS/broker/messages/inflight</option></term>
  508. <listitem>
  509. <para>The number of messages with QoS>0 that are awaiting
  510. acknowledgments.</para>
  511. </listitem>
  512. </varlistentry>
  513. <varlistentry>
  514. <term><option>$SYS/broker/messages/received</option></term>
  515. <listitem>
  516. <para>The total number of messages of any type received since the broker started.</para>
  517. </listitem>
  518. </varlistentry>
  519. <varlistentry>
  520. <term><option>$SYS/broker/messages/sent</option></term>
  521. <listitem>
  522. <para>The total number of messages of any type sent since the broker started.</para>
  523. </listitem>
  524. </varlistentry>
  525. <varlistentry>
  526. <term><option>$SYS/broker/publish/messages/dropped</option></term>
  527. <listitem>
  528. <para>The total number of publish messages that have been
  529. dropped due to inflight/queuing limits. See the
  530. max_inflight_messages and max_queued_messages options
  531. in
  532. <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>
  533. for more information.</para>
  534. </listitem>
  535. </varlistentry>
  536. <varlistentry>
  537. <term><option>$SYS/broker/publish/messages/received</option></term>
  538. <listitem>
  539. <para>The total number of PUBLISH messages received since the broker started.</para>
  540. </listitem>
  541. </varlistentry>
  542. <varlistentry>
  543. <term><option>$SYS/broker/publish/messages/sent</option></term>
  544. <listitem>
  545. <para>The total number of PUBLISH messages sent since the broker started.</para>
  546. </listitem>
  547. </varlistentry>
  548. <varlistentry>
  549. <term><option>$SYS/broker/retained messages/count</option></term>
  550. <listitem>
  551. <para>The total number of retained messages active on the broker.</para>
  552. </listitem>
  553. </varlistentry>
  554. <varlistentry>
  555. <term><option>$SYS/broker/store/messages/count</option></term>
  556. <term><option>$SYS/broker/messages/stored</option> (deprecated)</term>
  557. <listitem>
  558. <para>The number of messages currently held in the message
  559. store. This includes retained messages and messages
  560. queued for durable clients.</para>
  561. </listitem>
  562. </varlistentry>
  563. <varlistentry>
  564. <term><option>$SYS/broker/store/messages/bytes</option></term>
  565. <listitem>
  566. <para>The number of bytes currently held by message payloads
  567. in the message store. This includes retained messages
  568. and messages queued for durable clients.</para>
  569. </listitem>
  570. </varlistentry>
  571. <varlistentry>
  572. <term><option>$SYS/broker/subscriptions/count</option></term>
  573. <listitem>
  574. <para>The total number of subscriptions active on the broker.</para>
  575. </listitem>
  576. </varlistentry>
  577. <varlistentry>
  578. <term><option>$SYS/broker/version</option></term>
  579. <listitem>
  580. <para>The version of the broker. Static.</para>
  581. </listitem>
  582. </varlistentry>
  583. </variablelist>
  584. </refsect1>
  585. <refsect1>
  586. <title>Wildcard Topic Subscriptions</title>
  587. <para>In addition to allowing clients to subscribe to specific topics,
  588. mosquitto also allows the use of two wildcards in subscriptions.
  589. <option>+</option> is the wildcard used to match a single level of
  590. hierarchy. For example, for a topic of "a/b/c/d", the following example
  591. subscriptions will match:</para>
  592. <itemizedlist mark="circle">
  593. <listitem><para>a/b/c/d</para></listitem>
  594. <listitem><para>+/b/c/d</para></listitem>
  595. <listitem><para>a/+/c/d</para></listitem>
  596. <listitem><para>a/+/+/d</para></listitem>
  597. <listitem><para>+/+/+/+</para></listitem>
  598. </itemizedlist>
  599. <para>The following subscriptions will not match:</para>
  600. <itemizedlist mark="circle">
  601. <listitem><para>a/b/c</para></listitem>
  602. <listitem><para>b/+/c/d</para></listitem>
  603. <listitem><para>+/+/+</para></listitem>
  604. </itemizedlist>
  605. <para>The second wildcard is <option>#</option> and is used to match
  606. all subsequent levels of hierarchy. With a topic of "a/b/c/d", the
  607. following example subscriptions will match:</para>
  608. <itemizedlist mark="circle">
  609. <listitem><para>a/b/c/d</para></listitem>
  610. <listitem><para>#</para></listitem>
  611. <listitem><para>a/#</para></listitem>
  612. <listitem><para>a/b/#</para></listitem>
  613. <listitem><para>a/b/c/#</para></listitem>
  614. <listitem><para>+/b/c/#</para></listitem>
  615. </itemizedlist>
  616. <para>The $SYS hierarchy does not match a subscription of
  617. "#". If you want to observe the entire $SYS hierarchy, subscribe to
  618. $SYS/#.</para>
  619. <para>Note that the wildcards must be only ever used on their own, so a
  620. subscription of "a/b+/c" is not valid use of a wildcard. The
  621. <option>#</option> wildcard must only ever be used as the final
  622. character of a subscription.</para>
  623. </refsect1>
  624. <refsect1>
  625. <title>Bridges</title>
  626. <para>Multiple brokers can be connected together with the bridging
  627. functionality. This is useful where it is desirable to share
  628. information between locations, but where not all of the information
  629. needs to be shared. An example could be where a number of users are
  630. running a broker to help record power usage and for a number of other
  631. reasons. The power usage could be shared through bridging all of the
  632. user brokers to a common broker, allowing the power usage of all
  633. users to be collected and compared. The other information would remain
  634. local to each
  635. broker.</para>
  636. <para>For information on configuring bridges, see
  637. <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
  638. </refsect1>
  639. <refsect1>
  640. <title>Signals</title>
  641. <para>
  642. On POSIX systems Mosquitto can receive signals and act on them as
  643. described below. To send signals, use e.g.
  644. <command>kill -HUP &lt;process id of mosquitto&gt;</command>
  645. </para>
  646. <variablelist>
  647. <varlistentry>
  648. <term>SIGHUP</term>
  649. <listitem>
  650. <para>Upon receiving the SIGHUP signal, mosquitto will
  651. attempt to reload configuration file data, assuming that
  652. the <option>-c</option> argument was provided when
  653. mosquitto was started. Not all configuration parameters can
  654. be reloaded without restarting. See
  655. <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>
  656. for details.</para>
  657. <para>If TLS certificates are in use, then mosquitto will
  658. also reload certificate on receiving a SIGHUP.</para>
  659. </listitem>
  660. </varlistentry>
  661. <varlistentry>
  662. <term>SIGUSR1</term>
  663. <listitem>
  664. <para>Upon receiving the SIGUSR1 signal, mosquitto will
  665. write the persistence database to disk. This signal is only
  666. acted upon if persistence is enabled.</para>
  667. </listitem>
  668. </varlistentry>
  669. <varlistentry>
  670. <term>SIGUSR2</term>
  671. <listitem>
  672. <para>The SIGUSR2 signal causes mosquitto to print out the
  673. current subscription tree, along with information about
  674. where retained messages exist. This is intended as a
  675. testing feature only and may be removed at any time.</para>
  676. </listitem>
  677. </varlistentry>
  678. </variablelist>
  679. </refsect1>
  680. <refsect1>
  681. <title>Files</title>
  682. <variablelist>
  683. <varlistentry>
  684. <term><filename>/etc/mosquitto/mosquitto.conf</filename></term>
  685. <listitem>
  686. <para>Configuration file. See <citerefentry><refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
  687. </listitem>
  688. </varlistentry>
  689. <varlistentry>
  690. <term><filename>/var/lib/mosquitto/mosquitto.db</filename></term>
  691. <listitem>
  692. <para>Persistent message data storage location if persist enabled.</para>
  693. </listitem>
  694. </varlistentry>
  695. <varlistentry>
  696. <term><filename>/etc/hosts.allow</filename></term>
  697. <term><filename>/etc/hosts.deny</filename></term>
  698. <listitem>
  699. <para>Host access control via tcp-wrappers as described in <citerefentry><refentrytitle><link xlink:href="https://linux.die.net/man/5/hosts_access">hosts_access</link></refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
  700. </listitem>
  701. </varlistentry>
  702. </variablelist>
  703. </refsect1>
  704. <refsect1>
  705. <title>Bugs</title>
  706. <para><command>mosquitto</command> bug information can be found at
  707. <ulink url="https://github.com/eclipse/mosquitto/issues"/></para>
  708. </refsect1>
  709. <refsect1>
  710. <title>See Also</title>
  711. <simplelist type="inline">
  712. <member>
  713. <citerefentry>
  714. <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle>
  715. <manvolnum>7</manvolnum>
  716. </citerefentry>
  717. </member>
  718. <member>
  719. <citerefentry>
  720. <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle>
  721. <manvolnum>7</manvolnum>
  722. </citerefentry>
  723. </member>
  724. <member>
  725. <citerefentry>
  726. <refentrytitle><link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link></refentrytitle>
  727. <manvolnum>5</manvolnum>
  728. </citerefentry>
  729. </member>
  730. <member>
  731. <citerefentry>
  732. <refentrytitle><link xlink:href="https://linux.die.net/man/5/hosts_access">hosts_access</link></refentrytitle>
  733. <manvolnum>5</manvolnum>
  734. </citerefentry>
  735. </member>
  736. <member>
  737. <citerefentry>
  738. <refentrytitle><link xlink:href="mosquitto_ctrl-1.html">mosquitto_ctrl</link></refentrytitle>
  739. <manvolnum>1</manvolnum>
  740. </citerefentry>
  741. </member>
  742. <member>
  743. <citerefentry>
  744. <refentrytitle><link xlink:href="mosquitto_passwd-1.html">mosquitto_passwd</link></refentrytitle>
  745. <manvolnum>1</manvolnum>
  746. </citerefentry>
  747. </member>
  748. <member>
  749. <citerefentry>
  750. <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle>
  751. <manvolnum>1</manvolnum>
  752. </citerefentry>
  753. </member>
  754. <member>
  755. <citerefentry>
  756. <refentrytitle><link xlink:href="mosquitto_rr-1.html">mosquitto_rr</link></refentrytitle>
  757. <manvolnum>1</manvolnum>
  758. </citerefentry>
  759. </member>
  760. <member>
  761. <citerefentry>
  762. <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle>
  763. <manvolnum>1</manvolnum>
  764. </citerefentry>
  765. </member>
  766. <member>
  767. <citerefentry>
  768. <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle>
  769. <manvolnum>3</manvolnum>
  770. </citerefentry>
  771. </member>
  772. </simplelist>
  773. </refsect1>
  774. <refsect1>
  775. <title>Thanks</title>
  776. <para>Thanks to Andy Stanford-Clark for being one of the people who
  777. came up with MQTT in the first place. Thanks to Andy and Nicholas
  778. O'Leary for providing clarifications of the protocol.</para>
  779. <para>Thanks also to everybody at the Ubuntu UK Podcast and Linux
  780. Outlaws for organising OggCamp, where Andy gave a talk that
  781. inspired mosquitto.</para>
  782. </refsect1>
  783. <refsect1>
  784. <title>Author</title>
  785. <para>Roger Light <email>roger@atchoo.org</email></para>
  786. </refsect1>
  787. </refentry>