symon.8 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. .\" -*- nroff -*-
  2. .\"
  3. .\" Copyright (c) 2001-2013 Willem Dijkstra
  4. .\" All rights reserved.
  5. .\"
  6. .\" Redistribution and use in source and binary forms, with or without
  7. .\" modification, are permitted provided that the following conditions
  8. .\" are met:
  9. .\"
  10. .\" - Redistributions of source code must retain the above copyright
  11. .\" notice, this list of conditions and the following disclaimer.
  12. .\" - Redistributions in binary form must reproduce the above
  13. .\" copyright notice, this list of conditions and the following
  14. .\" disclaimer in the documentation and/or other materials provided
  15. .\" with the distribution.
  16. .\"
  17. .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  24. .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  27. .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. .\" POSSIBILITY OF SUCH DAMAGE.
  29. .\"
  30. .Dd April 4, 2012
  31. .Dt SYMON 8
  32. .Os
  33. .Sh NAME
  34. .Nm symon
  35. .Nd system monitor
  36. .Sh SYNOPSIS
  37. .Nm
  38. .Op Fl dtuv
  39. .Op Fl f Ar filename
  40. .Pp
  41. .Sh DESCRIPTION
  42. .Nm
  43. is a lightweight system monitor that measures cpu, load, filesystem, interface, disk,
  44. memory, pf, pf queues, mbuf, proc and sensor statistics every 5 seconds. This
  45. information is then spooled to
  46. .Xr symux 8
  47. for further processing.
  48. .Pp
  49. .Nm
  50. has been designed to inflict minimal performance and security impact on
  51. the system it monitors.
  52. .Xr symux 8
  53. has performance impact proportional to the amount of streams it needs to
  54. manage. Ideally
  55. .Xr symux
  56. should live on a different system and collect data from several
  57. .Nm
  58. instances in a LAN.
  59. .Lp
  60. By default,
  61. .Nm
  62. will drop privileges and chroot(2) to home of the symon user. This behaviour
  63. is not strictly needed for the cpu, mem, mbuf, disk debug and interface probes
  64. as these will work even when
  65. .Nm
  66. is started as
  67. .Ar "nobody".
  68. .Lp
  69. The options:
  70. .Bl -tag -width Ds
  71. .It Fl d
  72. Stop
  73. .Nm
  74. from becoming a daemon and show debug information on stdout.
  75. .It Fl f Ar filename
  76. Read configuration from
  77. .Ar filename
  78. instead of
  79. .Pa /etc/symon.conf .
  80. .It Fl t
  81. Test configuration file and exit.
  82. .It Fl u
  83. By default
  84. .Nm
  85. will chroot(2) into
  86. .Pa _symon
  87. user home directory. The
  88. .Pa -u
  89. disables this behaviour.
  90. .It Fl v
  91. Show version information.
  92. .El
  93. .Sh CONFIGURATION
  94. .Nm
  95. obtains configuration data from
  96. .Pa /etc/symon.conf .
  97. The configuration file contains monitor stanzas that define what
  98. resources should be monitored and to which
  99. .Xr symux 8
  100. the information should be streamed to.
  101. .Pp
  102. Multiple monitor statements are allowed. Whitespace, newlines and text
  103. behind '#' are ignored. The format in BNF:
  104. .Pp
  105. .Bd -literal -offset indent -compact
  106. monitor-rule = "monitor" "{" resources "}" [every]
  107. "stream" ["from" host] ["to"] host [ port ]
  108. resources = resource [ version ] ["(" argument ")"]
  109. [ ","|" " resources ]
  110. resource = "cpu" | "cpuiow" | "debug" | "df" | "flukso" |
  111. "if" | "io" | "load" | "mbuf" | "mem" | "pf" |
  112. "pfq" | "proc" | "sensor" | "smart"
  113. version = number
  114. argument = number | name
  115. every = "every" time
  116. time = "second" | number "seconds"
  117. host = ip4addr | ip6addr | hostname
  118. port = [ "port" | "," ] portnumber
  119. .Ed
  120. .Pp
  121. Note that symux(8) data files default to receiving data every 5
  122. seconds. Adjusting the monitoring interval will also require adjusting the
  123. associated symux(8) datafile(s).
  124. .Pp
  125. The pf probe will return data that is collected for the
  126. .Pa loginterface
  127. set in /etc/pf.conf(5).
  128. .Pp
  129. The Linux io, df, and smart probes support device names via id, label, path and uuid.
  130. .Pp
  131. The FreeBSD io, df, and smart probes support gpt names, ufs names, ufs ids and paths.
  132. .Pp
  133. The OpenBSD io probe supports device uuids.
  134. .Pp
  135. .Sh EXAMPLE
  136. Here is an example OpenBSD
  137. .Ar symon.conf
  138. that monitors cpu, memory, pf, interfaces xl0/de0/lo0/wi0, disks
  139. wd[0-3]/cd[0-1], debug variables debug0 to debug19 and streams that
  140. information to localhost on port 2100.
  141. .Pp
  142. .Bd -literal -offset indent -compact
  143. monitor { cpu(0), mem, pf, if(xl0), if(de0),
  144. if(lo0), if(wi0), io(wd0), io(wd1),
  145. io(wd2), io(wd3), io(cd0), io(cd1),
  146. io(ccd0), df(sd0a), df(sd0d), df(sd0e),
  147. debug, proc(httpd) } stream to 127.0.0.1 2100
  148. .Ed
  149. .Sh EXAMPLE
  150. Here is an example Linux
  151. .Ar symon.conf
  152. that monitors cpu including iowait, memory, load, interface eth0, io and df for
  153. a set of disks every 5 seconds. Smart data is to be collected every 60 seconds.
  154. Disks in the smart and io statements are identified using ids, filesystem
  155. volumes in df using labels.
  156. .Bd -literal -offset indent -compact
  157. monitor { smart(ata-Hitachi_HDS722020ALA330_JK1130ABABABAB),
  158. smart(ata-Hitachi_HDS722020ALA330_JK1130ACACACAC),
  159. } every 60 seconds stream to 192.168.0.2 port 2100
  160. monitor { cpuiow(0), cpuiow(1), mem, if(eth0),
  161. io(ata-Hitachi_HDS722020ALA330_JK1130ABABABAB),
  162. io(ata-Hitachi_HDS722020ALA330_JK1130ACACACAC),
  163. df(data_1),
  164. df(data_2),
  165. df(data_3),
  166. df(home),
  167. df(var),
  168. load
  169. } stream to 192.168.0.2 port 2100
  170. .Ed
  171. .Sh SIGNALS
  172. .Bl -tag -width Ds
  173. .It SIGHUP
  174. Causes
  175. .Nm
  176. to read
  177. .Pa /etc/symon.conf .
  178. .Nm
  179. will keep the old configuration if errors occured during parsing of the
  180. configuration file. Note that the chroot(2) may cause resources to become
  181. unattainable, most notably the configuration file itself.
  182. .El
  183. .Sh FILES
  184. .Bl -tag -width Ds
  185. .It Pa /var/run/symon.pid
  186. Contains the program id of the
  187. .Nm
  188. daemon.
  189. .It Pa /etc/symon.conf
  190. .Nm
  191. system wide configuration file.
  192. .El
  193. .Sh BUGS
  194. Every monitored resource mentioned
  195. .Pa /etc/symon.conf
  196. gets queried. Mentioning, for example, cpu(0) twice for different muxes will
  197. result in two distinct cpu(0) measurement actions.
  198. .Pp
  199. The proc module is too simple: memory shared between two instances of the same
  200. process is simply counted twice.
  201. .Pp
  202. .Nm
  203. does not check whether all resources mentioned in
  204. .Pa /etc/symon.conf
  205. exist.
  206. .Pp
  207. .Sh AUTHOR
  208. Willem Dijkstra <wpd@xs4all.nl>. \%Daniel \%Hartmeier helped to port to big-endian
  209. architectures. \%Matthew \%Gream helped to port symon to other BSD platforms.
  210. .Pp
  211. Port contributors: \%Marc \%Balmer, \%Tito \%Dal \%Canton, \%Matthew
  212. \%Gream, \%Daniel \%Hartmeier, \%Lars \%Kotthoff, \%Constantine
  213. A. \%Murenin, J. \%Martin \%Petersen, \%Fredrik \%Soderblom, \%Harm
  214. \%Schotanus and \%Martin van der \%Werff.
  215. \%Valeriy \%Leshchinskiy maintains a windows symon client at
  216. https://github.com/ValHazelwood/SymonClient .
  217. .Sh SEE ALSO
  218. .Xr symux 8