mosquitto_ctrl.1.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <?xml-stylesheet type="text/xsl" href="manpage.xsl"?>
  3. <refentry xml:id="mosquitto_ctrl" xmlns:xlink="http://www.w3.org/1999/xlink">
  4. <refmeta>
  5. <refentrytitle>mosquitto_ctrl</refentrytitle>
  6. <manvolnum>1</manvolnum>
  7. <refmiscinfo class="source">Mosquitto Project</refmiscinfo>
  8. <refmiscinfo class="manual">Commands</refmiscinfo>
  9. </refmeta>
  10. <refnamediv>
  11. <refname>mosquitto_ctrl</refname>
  12. <refpurpose>a tool for initialising/configuring a Mosquitto broker instance</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis>
  16. <command>mosquitto_ctrl</command>
  17. <arg choice='opt'>connection-options | -o config-file</arg>
  18. <arg choice='plain'>module-name</arg>
  19. <arg choice='plain'>module-command</arg>
  20. <arg choice='opt'>command-options</arg>
  21. </cmdsynopsis>
  22. <cmdsynopsis>
  23. <command>connection-options:</command>
  24. <group choice='req'>
  25. <arg choice='plain'>
  26. <arg><option>-h</option> <replaceable>hostname</replaceable></arg>
  27. <arg><option>--unix</option> <replaceable>socket path</replaceable></arg>
  28. <arg><option>-p</option> <replaceable>port-number</replaceable></arg>
  29. <arg><option>-u</option> <replaceable>username</replaceable></arg>
  30. <arg><option>-P</option> <replaceable>password</replaceable></arg>
  31. </arg>
  32. <arg choice='plain'><option>-L</option> <replaceable>URL</replaceable></arg>
  33. </group>
  34. <arg><option>-A</option> <replaceable>bind-address</replaceable></arg>
  35. <arg><option>-c</option></arg>
  36. <arg><option>-d</option></arg>
  37. <arg><option>-i</option> <replaceable>client-id</replaceable></arg>
  38. <arg><option>-q</option> <replaceable>message-QoS</replaceable></arg>
  39. <arg><option>--quiet</option></arg>
  40. <arg><option>-V</option> <replaceable>protocol-version</replaceable></arg>
  41. <group>
  42. <arg>
  43. <group choice='req'>
  44. <arg choice='plain'><option>--cafile</option> <replaceable>file</replaceable></arg>
  45. <arg choice='plain'><option>--capath</option> <replaceable>dir</replaceable></arg>
  46. </group>
  47. <arg><option>--cert</option> <replaceable>file</replaceable></arg>
  48. <arg><option>--key</option> <replaceable>file</replaceable></arg>
  49. <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg>
  50. <arg><option>--tls-version</option> <replaceable>version</replaceable></arg>
  51. <arg><option>--tls-alpn</option> <replaceable>protocol</replaceable></arg>
  52. <arg><option>--tls-engine</option> <replaceable>engine</replaceable></arg>
  53. <arg><option>--keyform</option>
  54. <group choice='req'>
  55. <arg choice='plain'><replaceable>pem</replaceable></arg>
  56. <arg choice='plain'><replaceable>engine</replaceable></arg>
  57. </group></arg>
  58. <arg><option>--tls-engine-kpass-sha1</option> <replaceable>kpass-sha1</replaceable></arg>
  59. <arg><option>--insecure</option></arg>
  60. </arg>
  61. <arg>
  62. <arg choice='plain'><option>--psk</option> <replaceable>hex-key</replaceable></arg>
  63. <arg choice='plain'><option>--psk-identity</option> <replaceable>identity</replaceable></arg>
  64. <arg><option>--ciphers</option> <replaceable>ciphers</replaceable></arg>
  65. <arg><option>--tls-version</option> <replaceable>version</replaceable></arg>
  66. </arg>
  67. </group>
  68. <arg><option>--proxy</option> <replaceable>socks-url</replaceable></arg>
  69. </cmdsynopsis>
  70. <cmdsynopsis>
  71. <command>mosquitto_ctrl</command>
  72. <arg><option>--help</option></arg>
  73. </cmdsynopsis>
  74. </refsynopsisdiv>
  75. <refsect1>
  76. <title>Description</title>
  77. <para><command>mosquitto_ctrl</command> is a tool for helping configure a Mosquitto broker instance.</para>
  78. </refsect1>
  79. <refsect1>
  80. <title>Encrypted Connections</title>
  81. <para><command>mosquitto_ctrl</command> supports TLS encrypted
  82. connections. It is strongly recommended that you use an encrypted
  83. connection for all remote use of mosquitto_ctrl.</para>
  84. <para>To enable TLS connections when using x509 certificates, one of
  85. either <option>--cafile</option> or <option>--capath</option> must
  86. be provided as an option.</para>
  87. <para>To enable TLS connections when using TLS-PSK, you must use the
  88. <option>--psk</option> and the <option>--psk-identity</option>
  89. options.</para>
  90. </refsect1>
  91. <refsect1>
  92. <title>Modules</title>
  93. <variablelist>
  94. <varlistentry>
  95. <term><option>Dynamic security</option></term>
  96. <listitem>
  97. <para>
  98. Authentication, and role based access control with users
  99. and groups. Uses the <command>dynsec</command> module name. See:
  100. <citerefentry>
  101. <refentrytitle><link xlink:href="mosquitto_ctrl_dynsec-1.html">mosquitto_ctrl_dynsec</link></refentrytitle>
  102. <manvolnum>1</manvolnum>
  103. </citerefentry>
  104. </para>
  105. </listitem>
  106. </varlistentry>
  107. <varlistentry>
  108. <term><option>External modules</option></term>
  109. <listitem>
  110. <para><command>mosquitto_ctrl</command> has the ability to load
  111. external modules in the form of shared libraries. For example
  112. using the module name <option>example</option> will try to load
  113. the external module <option>mosquitto_ctrl_example.so</option>
  114. or <option>mosquitto_ctrl_example.dll</option>, depending on platform.
  115. This allows new functionality to be added to Mosquitto by combining
  116. a plugin and mosquitto_ctrl module, without having to recompile any
  117. Mosquitto source code.
  118. </para>
  119. </listitem>
  120. </varlistentry>
  121. </variablelist>
  122. </refsect1>
  123. <refsect1>
  124. <title>Connection Options</title>
  125. <para>The options below may be given on the command line, but may also
  126. be placed in a config file located at
  127. <option>$XDG_CONFIG_HOME/mosquitto_ctrl</option> or
  128. <option>$HOME/.config/mosquitto_ctrl</option>.</para>
  129. <para>The config file may be specified manually with the
  130. <option>-o <replaceable>config-file</replaceable></option>
  131. option.</para>
  132. <para>The config file should have one pair of
  133. <option>-option <replaceable>value</replaceable></option>
  134. per line. The values in the config file will be used as defaults
  135. and can be overridden by using the command line. The exceptions to
  136. this are the message type options, of which only one can be
  137. specified. Note also that currently some options cannot be negated,
  138. e.g. <option>-S</option>. Config file lines that have a
  139. <option>#</option> as the first character are treated as comments
  140. and not processed any further.</para>
  141. <variablelist>
  142. <varlistentry>
  143. <term><option>-A</option></term>
  144. <listitem>
  145. <para>Bind the outgoing connection to a local ip
  146. address/hostname. Use this argument if you need to
  147. restrict network communication to a particular
  148. interface.</para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry>
  152. <term><option>--cafile</option></term>
  153. <listitem>
  154. <para>Define the path to a file containing PEM encoded CA
  155. certificates that are trusted. Used to enable SSL
  156. communication.</para>
  157. <para>See also <option>--capath</option></para>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry>
  161. <term><option>--capath</option></term>
  162. <listitem>
  163. <para>Define the path to a directory containing PEM encoded CA
  164. certificates that are trusted. Used to enable SSL
  165. communication.</para>
  166. <para>For <option>--capath</option> to work correctly, the
  167. certificate files must have ".crt" as the file ending
  168. and you must run "openssl rehash &lt;path to capath&gt;" each
  169. time you add/remove a certificate.</para>
  170. <para>See also <option>--cafile</option></para>
  171. </listitem>
  172. </varlistentry>
  173. <varlistentry>
  174. <term><option>--cert</option></term>
  175. <listitem>
  176. <para>Define the path to a file containing a PEM encoded
  177. certificate for this client, if required by the
  178. server.</para>
  179. <para>See also <option>--key</option>.</para>
  180. </listitem>
  181. </varlistentry>
  182. <varlistentry>
  183. <term><option>--ciphers</option></term>
  184. <listitem>
  185. <para>An openssl compatible list of TLS ciphers to support
  186. in the client. See
  187. <citerefentry><refentrytitle><link xlink:href="https://linux.die.net/man/1/ciphers">ciphers</link></refentrytitle><manvolnum>1</manvolnum></citerefentry>
  188. for more information.</para>
  189. </listitem>
  190. </varlistentry>
  191. <varlistentry>
  192. <term><option>-d</option></term>
  193. <term><option>--debug</option></term>
  194. <listitem>
  195. <para>Enable debug messages.</para>
  196. </listitem>
  197. </varlistentry>
  198. <varlistentry>
  199. <term><option>-D</option></term>
  200. <term><option>--property</option></term>
  201. <listitem>
  202. <para>Use an MQTT v5 property with this publish. If you use
  203. this option, the client will be set to be an MQTT v5
  204. client. This option has two forms:</para>
  205. <para><option>-D command identifier value</option></para>
  206. <para><option>-D command identifier name value</option></para>
  207. <para><option>command</option> is the MQTT command/packet
  208. identifier and can be one of CONNECT, PUBLISH, PUBREL,
  209. DISCONNECT, AUTH, or WILL. The properties available for
  210. each command are listed in the
  211. <link linkend='properties'>Properties</link>
  212. section.</para>
  213. <para><option>identifier</option> is the name of the
  214. property to add. This is as described in the
  215. specification, but with '-' as a word separator. For
  216. example:
  217. <option>payload-format-indicator</option>. More details
  218. are in the <link linkend='properties'>Properties</link>
  219. section.</para>
  220. <para><option>value</option> is the value of the property
  221. to add, with a data type that is property
  222. specific.</para>
  223. <para><option>name</option> is only used for the
  224. <option>user-property</option> property as the first of
  225. the two strings in the string pair. In that case,
  226. <option>value</option> is the second of the strings in
  227. the pair.</para>
  228. </listitem>
  229. </varlistentry>
  230. <varlistentry>
  231. <term><option>--help</option></term>
  232. <listitem>
  233. <para>Display usage information.</para>
  234. </listitem>
  235. </varlistentry>
  236. <varlistentry>
  237. <term><option>-h</option></term>
  238. <term><option>--host</option></term>
  239. <listitem>
  240. <para>Specify the host to connect to. Defaults to localhost.</para>
  241. </listitem>
  242. </varlistentry>
  243. <varlistentry>
  244. <term><option>-i</option></term>
  245. <term><option>--id</option></term>
  246. <listitem>
  247. <para>The id to use for this client. If not given, a client id will
  248. be generated depending on the MQTT version being used. For v3.1.1/v3.1,
  249. the client generates a client id in the format
  250. <option>mosq-XXXXXXXXXXXXXXXXXX</option>, where the
  251. <option>X</option> are replaced with random alphanumeric
  252. characters. For v5.0, the client sends a zero length client id, and the
  253. server will generate a client id for the client.</para>
  254. <para>This option cannot be used at the same time as the
  255. <option>--id-prefix</option> argument.</para>
  256. </listitem>
  257. </varlistentry>
  258. <varlistentry>
  259. <term><option>--insecure</option></term>
  260. <listitem>
  261. <para>When using certificate based encryption, this option
  262. disables verification of the server hostname in the
  263. server certificate. This can be useful when testing
  264. initial server configurations but makes it possible for
  265. a malicious third party to impersonate your server
  266. through DNS spoofing, for example. Use this option in
  267. testing <emphasis>only</emphasis>. If you need to
  268. resort to using this option in a production
  269. environment, your setup is at fault and there is no
  270. point using encryption.</para>
  271. </listitem>
  272. </varlistentry>
  273. <varlistentry>
  274. <term><option>--key</option></term>
  275. <listitem>
  276. <para>Define the path to a file containing a PEM encoded
  277. private key for this client, if required by the
  278. server.</para>
  279. <para>See also <option>--cert</option>.</para>
  280. </listitem>
  281. </varlistentry>
  282. <varlistentry>
  283. <term><option>--keyform</option></term>
  284. <listitem>
  285. <para>Specifies the type of private key in use when making
  286. TLS connections.. This can be "pem" or "engine". This
  287. parameter is useful when a TPM module is being used and
  288. the private key has been created with it. Defaults to
  289. "pem", which means normal private key files are
  290. used.</para>
  291. <para>See also <option>--tls-engine</option>.</para>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry>
  295. <term><option>-L</option></term>
  296. <term><option>--url</option></term>
  297. <listitem>
  298. <para>Specify specify user, password, hostname, port and
  299. topic at once as a URL. The URL must be in the form:
  300. mqtt(s)://[username[:password]@]host[:port]/topic</para>
  301. <para>If the scheme is mqtt:// then the port defaults to
  302. 1883. If the scheme is mqtts:// then the port defaults
  303. to 8883.</para>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry>
  307. <term><option>--nodelay</option></term>
  308. <listitem>
  309. <para>Disable Nagle's algorithm for the socket. This means
  310. that latency of sent messages is reduced, which is
  311. particularly noticable for small, reasonably infrequent
  312. messages. Using this option may result in more packets
  313. being sent than would normally be necessary.</para>
  314. </listitem>
  315. </varlistentry>
  316. <varlistentry>
  317. <term><option>-o</option> <replaceable>config-file</replaceable></term>
  318. <listitem>
  319. <para>Provide a path to a config file to load options from. The config file should have one pair of
  320. <option>-option <replaceable>value</replaceable></option>
  321. per line. The values in the config file will be used as defaults
  322. and can be overridden by using the command line. The exceptions to
  323. this are the message type options, of which only one can be
  324. specified. Note also that currently some options cannot be negated,
  325. e.g. <option>-S</option>. Config file lines that have a
  326. <option>#</option> as the first character are treated as comments
  327. and not processed any further.</para>
  328. </listitem>
  329. </varlistentry>
  330. <varlistentry>
  331. <term><option>-p</option></term>
  332. <term><option>--port</option></term>
  333. <listitem>
  334. <para>Connect to the port specified. If not given, the
  335. default of 1883 for plain MQTT or 8883 for MQTT over
  336. TLS will be used.</para>
  337. </listitem>
  338. </varlistentry>
  339. <varlistentry>
  340. <term><option>-P</option></term>
  341. <term><option>--pw</option></term>
  342. <listitem>
  343. <para>Provide a password to be used for authenticating with
  344. the broker. Using this argument without also specifying
  345. a username is invalid when using MQTT v3.1 or v3.1.1.
  346. See also the <option>--username</option> option.</para>
  347. </listitem>
  348. </varlistentry>
  349. <varlistentry>
  350. <term><option>--proxy</option></term>
  351. <listitem>
  352. <para>Specify a SOCKS5 proxy to connect through. "None" and
  353. "username" authentication types are supported. The
  354. <option>socks-url</option> must be of the form
  355. <option>socks5h://[username[:password]@]host[:port]</option>.
  356. The protocol prefix <option>socks5h</option> means that
  357. hostnames are resolved by the proxy. The symbols %25,
  358. %3A and %40 are URL decoded into %, : and @
  359. respectively, if present in the username or
  360. password.</para>
  361. <para>If username is not given, then no authentication is
  362. attempted. If the port is not given, then the default
  363. of 1080 is used.</para>
  364. <para>More SOCKS versions may be available in the future,
  365. depending on demand, and will use different protocol
  366. prefixes as described in <citerefentry>
  367. <refentrytitle><link xlink:href="https://linux.die.net/man/1/curl">curl</link></refentrytitle>
  368. <manvolnum>1</manvolnum> </citerefentry>.</para>
  369. </listitem>
  370. </varlistentry>
  371. <varlistentry>
  372. <term><option>--psk</option></term>
  373. <listitem>
  374. <para>Provide the hexadecimal (no leading 0x)
  375. pre-shared-key matching the one used on the broker to
  376. use TLS-PSK encryption support.
  377. <option>--psk-identity</option> must also be provided
  378. to enable TLS-PSK.</para>
  379. </listitem>
  380. </varlistentry>
  381. <varlistentry>
  382. <term><option>--psk-identity</option></term>
  383. <listitem>
  384. <para>The client identity to use with TLS-PSK support. This
  385. may be used instead of a username if the broker is
  386. configured to do so.</para>
  387. </listitem>
  388. </varlistentry>
  389. <varlistentry>
  390. <term><option>-q</option></term>
  391. <term><option>--qos</option></term>
  392. <listitem>
  393. <para>Specify the quality of service to use for messages, from 0, 1 and 2. Defaults to 1.</para>
  394. </listitem>
  395. </varlistentry>
  396. <varlistentry>
  397. <term><option>--quiet</option></term>
  398. <listitem>
  399. <para>If this argument is given, no runtime errors will be
  400. printed. This excludes any error messages given in case of
  401. invalid user input (e.g. using <option>--port</option> without a
  402. port).</para>
  403. </listitem>
  404. </varlistentry>
  405. <varlistentry>
  406. <term><option>--tls-alpn</option></term>
  407. <listitem>
  408. <para>Provide a protocol to use when connecting to a broker
  409. that has multiple protocols available on a single port,
  410. e.g. MQTT and WebSockets.</para>
  411. </listitem>
  412. </varlistentry>
  413. <varlistentry>
  414. <term><option>--tls-engine</option></term>
  415. <listitem>
  416. <para>A valid openssl engine id. These can be listed with
  417. openssl engine command.</para>
  418. <para>See also <option>--keyform</option>.</para>
  419. </listitem>
  420. </varlistentry>
  421. <varlistentry>
  422. <term><option>--tls-engine-kpass-sha1</option></term>
  423. <listitem>
  424. <para>SHA1 of the private key password when using an TLS
  425. engine. Some TLS engines such as the TPM engine may
  426. require the use of a password in order to be accessed.
  427. This option allows a hex encoded SHA1 hash of the
  428. password to the engine directly, instead of the user
  429. being prompted for the password.</para>
  430. <para>See also <option>--tls-engine</option>.</para>
  431. </listitem>
  432. </varlistentry>
  433. <varlistentry>
  434. <term><option>--tls-version</option></term>
  435. <listitem>
  436. <para>Choose which TLS protocol version to use when
  437. communicating with the broker. Valid options are
  438. <option>tlsv1.3</option>, <option>tlsv1.2</option> and
  439. <option>tlsv1.1</option>. The default value is
  440. <option>tlsv1.2</option>. Must match the protocol
  441. version used by the broker.</para>
  442. </listitem>
  443. </varlistentry>
  444. <varlistentry>
  445. <term><option>-u</option></term>
  446. <term><option>--username</option></term>
  447. <listitem>
  448. <para>Provide a username to be used for authenticating with
  449. the broker. See also the <option>--pw</option>
  450. argument.</para>
  451. </listitem>
  452. </varlistentry>
  453. <varlistentry>
  454. <term><option>--unix</option></term>
  455. <listitem>
  456. <para>Connect to a broker through a local unix domain socket
  457. instead of a TCP socket. This is a replacement for
  458. <option>-h</option> and <option>-L</option>. For example:
  459. <option>mosquitto_ctrl --unix /tmp/mosquitto.sock ...</option>
  460. </para>
  461. <para>See the <option>socket_domain</option> option in
  462. <refentrytitle>
  463. <link xlink:href="mosquitto-conf-5.html">mosquitto.conf</link>
  464. </refentrytitle><manvolnum>5</manvolnum>
  465. to configure Mosquitto to listen on a unix socket.</para>
  466. </listitem>
  467. </varlistentry>
  468. <varlistentry>
  469. <term><option>-V</option></term>
  470. <term><option>--protocol-version</option></term>
  471. <listitem>
  472. <para>Specify which version of the MQTT protocol should be
  473. used when connecting to the rmeote broker. Can be
  474. <option>5</option>, <option>311</option>,
  475. <option>31</option>, or the more verbose
  476. <option>mqttv5</option>, <option>mqttv311</option>, or
  477. <option>mqttv31</option>.
  478. Defaults to <option>311</option>.</para>
  479. </listitem>
  480. </varlistentry>
  481. </variablelist>
  482. </refsect1>
  483. <refsect1 id='properties'>
  484. <title>Properties</title>
  485. <para>The <option>-D</option> / <option>--property</option> option
  486. allows adding properties to different stages of the mosquitto_ctrl
  487. run. The properties supported for each command are as
  488. follows:</para>
  489. <refsect2>
  490. <title>Connect</title>
  491. <itemizedlist>
  492. <listitem><para><option>authentication-data</option> (binary data - note treated as a string in mosquitto_ctrl)</para></listitem>
  493. <listitem><para><option>authentication-method</option> (UTF-8 string pair)</para></listitem>
  494. <listitem><para><option>maximum-packet-size</option> (32-bit unsigned integer)</para></listitem>
  495. <listitem><para><option>receive-maximum</option> (16-bit unsigned integer)</para></listitem>
  496. <listitem><para><option>request-problem-information</option> (8-bit unsigned integer)</para></listitem>
  497. <listitem><para><option>request-response-information</option> (8-bit unsigned integer)</para></listitem>
  498. <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer, note use <option>-x</option> instead)</para></listitem>
  499. <listitem><para><option>topic-alias-maximum</option> (16-bit unsigned integer)</para></listitem>
  500. <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem>
  501. </itemizedlist>
  502. </refsect2>
  503. <refsect2>
  504. <title>Publish</title>
  505. <itemizedlist>
  506. <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem>
  507. <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_ctrl)</para></listitem>
  508. <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem>
  509. <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem>
  510. <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem>
  511. <listitem><para><option>topic-alias</option> (16-bit unsigned integer)</para></listitem>
  512. <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem>
  513. </itemizedlist>
  514. </refsect2>
  515. <refsect2>
  516. <title>Disconnect</title>
  517. <itemizedlist>
  518. <listitem><para><option>session-expiry-interval</option> (32-bit unsigned integer)</para></listitem>
  519. <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem>
  520. </itemizedlist>
  521. </refsect2>
  522. <refsect2>
  523. <title>Will properties</title>
  524. <itemizedlist>
  525. <listitem><para><option>content-type</option> (UTF-8 string)</para></listitem>
  526. <listitem><para><option>correlation-data</option> (binary data - note treated as a string in mosquitto_ctrl)</para></listitem>
  527. <listitem><para><option>message-expiry-interval</option> (32-bit unsigned integer)</para></listitem>
  528. <listitem><para><option>payload-format-indicator</option> (8-bit unsigned integer)</para></listitem>
  529. <listitem><para><option>response-topic</option> (UTF-8 string)</para></listitem>
  530. <listitem><para><option>user-property</option> (UTF-8 string pair)</para></listitem>
  531. <listitem><para><option>will-delay-interval</option> (32-bit unsigned integer)</para></listitem>
  532. </itemizedlist>
  533. </refsect2>
  534. </refsect1>
  535. <refsect1>
  536. <title>Exit Status</title>
  537. <para>
  538. mosquitto_sub returns zero on success, or non-zero on error. If
  539. the connection is refused by the broker at the MQTT level, then
  540. the exit code is the CONNACK reason code. If another error
  541. occurs, the exit code is a libmosquitto return value.
  542. </para>
  543. <para>MQTT v3.1.1 CONNACK codes:</para>
  544. <itemizedlist mark="circle">
  545. <listitem><para><option>0</option> Success</para></listitem>
  546. <listitem><para><option>1</option> Connection refused: Bad protocol version</para></listitem>
  547. <listitem><para><option>2</option> Connection refused: Identifier rejected</para></listitem>
  548. <listitem><para><option>3</option> Connection refused: Server unavailable</para></listitem>
  549. <listitem><para><option>4</option> Connection refused: Bad username/password</para></listitem>
  550. <listitem><para><option>5</option> Connection refused: Not authorized</para></listitem>
  551. </itemizedlist>
  552. <para>MQTT v5 CONNACK codes:</para>
  553. <itemizedlist>
  554. <listitem><para><option>0</option> Success</para></listitem>
  555. <listitem><para><option>128</option> Unspecified error</para></listitem>
  556. <listitem><para><option>129</option> Malformed packet</para></listitem>
  557. <listitem><para><option>130</option> Protocol error</para></listitem>
  558. <listitem><para><option>131</option> Implementation specific error</para></listitem>
  559. <listitem><para><option>132</option> Unsupported protocol version</para></listitem>
  560. <listitem><para><option>133</option> Client ID not valid</para></listitem>
  561. <listitem><para><option>134</option> Bad username or password</para></listitem>
  562. <listitem><para><option>135</option> Not authorized</para></listitem>
  563. <listitem><para><option>136</option> Server unavailable</para></listitem>
  564. <listitem><para><option>137</option> Server busy</para></listitem>
  565. <listitem><para><option>138</option> Banned</para></listitem>
  566. <listitem><para><option>139</option> Server shutting down</para></listitem>
  567. <listitem><para><option>140</option> Bad authentication method</para></listitem>
  568. <listitem><para><option>141</option> Keep alive timeout</para></listitem>
  569. <listitem><para><option>142</option> Session taken over</para></listitem>
  570. <listitem><para><option>143</option> Topic filter invalid</para></listitem>
  571. <listitem><para><option>144</option> Topic name invalid</para></listitem>
  572. <listitem><para><option>147</option> Receive maximum exceeded</para></listitem>
  573. <listitem><para><option>148</option> Topic alias invalid</para></listitem>
  574. <listitem><para><option>149</option> Packet too large</para></listitem>
  575. <listitem><para><option>148</option> Message rate too high</para></listitem>
  576. <listitem><para><option>151</option> Quota exceeded</para></listitem>
  577. <listitem><para><option>152</option> Administrative action</para></listitem>
  578. <listitem><para><option>153</option> Payload format invalid</para></listitem>
  579. <listitem><para><option>154</option> Retain not supported</para></listitem>
  580. <listitem><para><option>155</option> QoS not supported</para></listitem>
  581. <listitem><para><option>156</option> Use another server</para></listitem>
  582. <listitem><para><option>157</option> Server moved</para></listitem>
  583. <listitem><para><option>158</option> Shared subscriptions not supported</para></listitem>
  584. <listitem><para><option>159</option> Connection rate exceeded</para></listitem>
  585. <listitem><para><option>160</option> Maximum connect time</para></listitem>
  586. <listitem><para><option>161</option> Subscription IDs not supported</para></listitem>
  587. <listitem><para><option>162</option> Wildcard subscriptions not supported</para></listitem>
  588. </itemizedlist>
  589. </refsect1>
  590. <refsect1>
  591. <title>Bugs</title>
  592. <para><command>mosquitto</command> bug information can be found at
  593. <ulink url="https://github.com/eclipse/mosquitto/issues"/></para>
  594. </refsect1>
  595. <refsect1>
  596. <title>See Also</title>
  597. <simplelist type="inline">
  598. <member>
  599. <citerefentry>
  600. <refentrytitle><link xlink:href="mqtt-7.html">mqtt</link></refentrytitle>
  601. <manvolnum>7</manvolnum>
  602. </citerefentry>
  603. </member>
  604. <member>
  605. <citerefentry>
  606. <refentrytitle><link xlink:href="mosquitto_rr-1.html">mosquitto_rr</link></refentrytitle>
  607. <manvolnum>1</manvolnum>
  608. </citerefentry>
  609. </member>
  610. <member>
  611. <citerefentry>
  612. <refentrytitle><link xlink:href="mosquitto_pub-1.html">mosquitto_pub</link></refentrytitle>
  613. <manvolnum>1</manvolnum>
  614. </citerefentry>
  615. </member>
  616. <member>
  617. <citerefentry>
  618. <refentrytitle><link xlink:href="mosquitto_sub-1.html">mosquitto_sub</link></refentrytitle>
  619. <manvolnum>1</manvolnum>
  620. </citerefentry>
  621. </member>
  622. <member>
  623. <citerefentry>
  624. <refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle>
  625. <manvolnum>8</manvolnum>
  626. </citerefentry>
  627. </member>
  628. <member>
  629. <citerefentry>
  630. <refentrytitle><link xlink:href="libmosquitto-3.html">libmosquitto</link></refentrytitle>
  631. <manvolnum>3</manvolnum>
  632. </citerefentry>
  633. </member>
  634. <member>
  635. <citerefentry>
  636. <refentrytitle><link xlink:href="mosquitto-tls-7.html">mosquitto-tls</link></refentrytitle>
  637. <manvolnum>7</manvolnum>
  638. </citerefentry>
  639. </member>
  640. </simplelist>
  641. </refsect1>
  642. <refsect1>
  643. <title>Author</title>
  644. <para>Roger Light <email>roger@atchoo.org</email></para>
  645. </refsect1>
  646. </refentry>