monitoring.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Node monitoring
  2. ===============
  3. Gluon is capable of announcing information about each node to the mesh
  4. and to neighbouring nodes. This allows nodes to learn each others hostname,
  5. IP addresses, location, software versions and various other information.
  6. Format of collected data
  7. ------------------------
  8. Information to be announced is currently split into three categories:
  9. nodeinfo
  10. In this category (mostly) static information is collected. If
  11. something is unlikely to change without human intervention it should be
  12. put here.
  13. statistics
  14. This category holds fast changing data, like traffic counters, uptime,
  15. system load or the selected gateway.
  16. neighbours
  17. `neighbours` contains information about all neighbouring nodes of all
  18. interfaces. This data can be used to determine the network topology.
  19. All categories will have a ``node_id`` key. It should be used to
  20. relate data of different catagories.
  21. Accessing Node Information
  22. --------------------------
  23. There are two packages responsible for distribution of the information. For
  24. one, information is distributed across the mesh using alfred_. Information
  25. between neighbouring nodes is exchanged using `gluon-respondd`.
  26. .. _alfred: http://www.open-mesh.org/projects/alfred
  27. alfred (mesh bound)
  28. ~~~~~~~~~~~~~~~~~~~
  29. The package ``gluon-alfred`` is required for this to work.
  30. Using alfred both categories are distributed within the mesh. In order to
  31. retrieve the data you'll need both a local alfred daemon and alfred-json_
  32. installed. Please note that at least one alfred daemon is required to run as
  33. `master`.
  34. .. _alfred-json: https://github.com/tcatm/alfred-json
  35. The following datatypes are used:
  36. * `nodeinfo`: 158
  37. * `statistics`: 159
  38. * `neighbours`: 160
  39. All data is compressed using GZip (alfred-json can handle the decompression).
  40. In order to retrieve statistics data you could run:
  41. ::
  42. # alfred-json -z -r 159
  43. {
  44. "f8:d1:11:7e:97:dc": {
  45. "processes": {
  46. "total": 55,
  47. "running": 2
  48. },
  49. "idletime": 30632.290000000001,
  50. "uptime": 33200.07,
  51. "memory": {
  52. "free": 1660,
  53. "cached": 8268,
  54. "total": 29212,
  55. "buffers": 2236
  56. },
  57. "node_id": "f8d1117e97dc",
  58. "loadavg": 0.01
  59. },
  60. "90:f6:52:3e:b9:50": {
  61. "processes": {
  62. "total": 58,
  63. "running": 2
  64. },
  65. "idletime": 28047.470000000001,
  66. "uptime": 33307.849999999999,
  67. "memory": {
  68. "free": 2364,
  69. "cached": 7168,
  70. "total": 29212,
  71. "buffers": 1952
  72. },
  73. "node_id": "90f6523eb950",
  74. "loadavg": 0.34000000000000002
  75. }
  76. }
  77. You can find more information about alfred in its README_.
  78. .. _README: http://www.open-mesh.org/projects/alfred/repository/revisions/master/entry/README
  79. gluon-respondd
  80. ~~~~~~~~~~~~~~
  81. `gluon-respondd` allows querying neighbouring nodes for their information.
  82. It is a daemon listening on the multicast address ``ff02::2:1001`` on
  83. UDP port 1001 on both the bare mesh interfaces and `br-client`. Unicast
  84. requests are supported as well.
  85. The supported requests are:
  86. * ``nodeinfo``, ``statistics``, ``neighbours``: Returns the data of single category uncompressed.
  87. * ``GET nodeinfo``, ...: Returns the data of one or multiple categories (separated by spaces)
  88. compressed using the `deflate` algorithm (without a gzip header). The data may
  89. be decompressed using zlib and many zlib bindings using -15 as the window size parameter.
  90. gluon-neighbour-info
  91. ~~~~~~~~~~~~~~~~~~~~
  92. The programm `gluon-neighbour-info` can be used to retrieve
  93. information from other nodes.
  94. ::
  95. gluon-neighbour-info -i wlan0 \
  96. -p 1001 -d ff02:0:0:0:0:0:2:1001 \
  97. -r nodeinfo
  98. An optional timeout may be specified, e.g. `-t 5` (default: 3 seconds). See
  99. the usage information printed by ``gluon-neighbour-info -h`` for more information
  100. about the supported arguments.
  101. Adding a data provider
  102. ----------------------
  103. To add a provider, you need to install a shared object into ``/lib/gluon/respondd``.
  104. For more information, refer to the `respondd README <https://github.com/freifunk-gluon/packages/blob/master/net/respondd/README.md>`_
  105. and have a look the existing providers.