-
Notifications
You must be signed in to change notification settings - Fork 8
/
nyx.1
271 lines (271 loc) · 4.92 KB
/
nyx.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
.TH "nyx" "1" "March 6, 2019" "nyx user manual" ""
.SH NAME
.PP
nyx \- the lean, docker\-optimized linux process monitor
.SH SYNOPSIS
.PP
nyx \-c [\f[I]config\-file\f[]] [\f[I]options\f[]]...
.PP
nyx \-\-run [\f[I]command\f[]]
.PP
nyx [\f[I]command\f[]] [\f[I]argument\f[]]...
.SH DESCRIPTION
.PP
nyx is a linux process monitor that intents to ease the monitoring of
your applications.
You are able to configure multiple applications to be watched by the nyx
server.
The configuration is done via the \f[I]config\-file\f[] argument and is
expected to be a valid YAML file.
.PP
If no \f[I]config\-file\f[] is specified the executable works as a
command line interface to the (running) nyx server process.
That way you are able to control your application status\[aq] like
starting/stopping an instance of your application.
.SH OPTIONS
.TP
.B \-c \f[I]config\-file\f[], \-\-config=\f[I]config\-file\f[]
Specify the YAML configuration which results in nyx to be run in
server (daemon) mode.
.RS
.RE
.TP
.B \-\-run=\f[I]command\f[]
Pass a command that should be watched instead of specifying a
configuration file.
This is a simple shortcut to watch an application with the default
options in an \[aq]adhoc\[aq] fashion.
.RS
.RE
.TP
.B \-\-local
Start the nyx daemon in a directory-local mode based on the current
working directory.
You may connect to such a nyx instance only inside that specific
directory in contrast to nyx's usual 'system-wide' behavior.
All configured directories of executables and arguments are evaluated
based on that specific directory as well.
.RS
.RE
.TP
.B \-p, \-\-passive
Start nyx in passive-mode meaning processes won't be automatically
started on startup.
.RS
.RE
.TP
.B \-s, \-\-syslog
Activate logging via the syslog.
.RS
.RE
.TP
.B \-D, \-\-no\-daemon
Do not daemonize the nyx server process but run in foreground instead.
This is especially useful to inspect/debug your application\[aq]s
runtime behavior.
.RS
.RE
.TP
.B \-q, \-\-quiet
Log error messages only.
.RS
.RE
.TP
.B \-C, \-\-no\-color
No terminal output coloring.
.RS
.RE
.TP
.B \-V, \-\-version
Print the version information.
.RS
.RE
.TP
.B \-h, \-\-help
Display a short help.
.RS
.RE
.SH COMMANDS
.PP
The following commands are available to control your configured
applications using the nyx command line interface:
.TP
.B ping
Ping the running nyx server.
.RS
.RE
.TP
.B version
Request the nyx server version.
.RS
.RE
.TP
.B status \f[I]watch\f[]
Get the current status of the specified \f[I]watch\f[].
.RS
.RE
.TP
.B start \f[I]watch\f[]
Start the specified \f[I]watch\f[].
.RS
.RE
.TP
.B stop \f[I]watch\f[]
Stop the specified \f[I]watch\f[].
.RS
.RE
.TP
.B restart \f[I]watch\f[]
Restart the specified \f[I]watch\f[].
.RS
.RE
.TP
.B history \f[I]watch\f[]
Get the latest events of the specified \f[I]watch\f[].
.RS
.RE
.TP
.B config \f[I]watch\f[]
Print the configuration of the specified \f[I]watch\f[].
.RS
.RE
.TP
.B watches
Get all currently configured watches.
.RS
.RE
.TP
.B reload
Reload the nyx configuration.
.RS
.RE
.TP
.B terminate
Terminate the nyx server instance.
.RS
.RE
.TP
.B quit
Stop the nyx server and all watched processes.
.RS
.RE
.SH CONFIGURATION
.PP
The configuration is expected in form of a \f[I]YAML\f[] file.
An example could look like the following:
.IP
.nf
\f[C]
watches:
\ \ mongodb:
\ \ \ \ start:\ mongod\ \-f\ /etc/mongod.conf
\ \ \ \ uid:\ mongod
\ \ \ \ gid:\ mongod
\ \ \ \ dir:\ /var/lib/mongod
\f[]
.fi
.PP
You may specify the \f[I]start\f[] config value in form of a list as
well (which is especially useful with arguments containing whitespace):
.IP
.nf
\f[C]
watches:
\ \ mongodb:
\ \ \ \ start:\ [
\ \ \ \ \ \ \[aq]mongod\[aq],
\ \ \ \ \ \ \[aq]\-f\[aq],
\ \ \ \ \ \ \[aq]/etc/mongod.conf\[aq]
\ \ \ \ \ \ ]
\f[]
.fi
.PP
All config values apart from the \f[I]start\f[] value are optional.
.SS Adhoc usage
.PP
Using the \f[I]\-\-run\f[] argument you may specify an executable in an
\[aq]adhoc\[aq] fashion without using a configuration file at all:
.IP
.nf
\f[C]
nyx\ \-\-run\ \[aq]mongod\ \-f\ /etc/mongod.conf\[aq]
\f[]
.fi
.PP
Using this operation all configuration values are set to the appropriate
default values.
.SH EXIT STATUS
.PP
On successful invocation the exit status is 0.
In case of an error the status codes are the following:
.TP
.B 0
success
.RS
.RE
.TP
.B 1
general failure (i.e.
out of memory)
.RS
.RE
.TP
.B 2
invalid usage (i.e.
too few arguments)
.RS
.RE
.TP
.B 3
invalid configuration
.RS
.RE
.TP
.B 4
no command given
.RS
.RE
.TP
.B 5
command does not exist
.RS
.RE
.TP
.B 6
command execution failed (i.e.
unknown watch)
.RS
.RE
.TP
.B 7
another nyx instance is already running
.RS
.RE
.TP
.B 8
no valid watch configured
.RS
.RE
.TP
.B 9
cannot open/find any directory to store PID files into
.RS
.RE
.TP
.B 10
failed to daemonize the nyx process
.RS
.RE
.TP
.B 11
no running daemon found to communicate with
.RS
.RE
.SH SEE ALSO
.PP
\f[C]syslog\f[] (3).
.PP
The nyx source code can be found on github at
<https://github.com/kongo2002/nyx/>.
.SH AUTHORS
Gregor Uhlenheuer.