gnu: r-systemfonts: Update to 0.3.1.
[jackhill/guix/guix.git] / gnu / packages / monitoring.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
4 ;;; Copyright © 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
7 ;;; Copyright © 2018, 2019, 2020 Oleg Pykhalov <go.wigust@gmail.com>
8 ;;; Copyright © 2020 Alex ter Weele <alex.ter.weele@gmail.com>
9 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages monitoring)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix build-system perl)
32 #:use-module (guix build-system python)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system go)
35 #:use-module (guix utils)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages django)
45 #:use-module (gnu packages gd)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages mail)
49 #:use-module (gnu packages networking)
50 #:use-module (gnu packages libevent)
51 #:use-module (gnu packages pcre)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages python-web)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages rrdtool)
58 #:use-module (gnu packages time)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages web))
61
62 (define-public nagios
63 (package
64 (name "nagios")
65 (version "4.4.6")
66 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
67 (source (origin
68 (method url-fetch)
69 (uri (string-append
70 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
71 version "/nagios-" version ".tar.gz"))
72 (sha256
73 (base32
74 "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db"))
75 (modules '((guix build utils)))
76 (snippet
77 ;; Ensure reproducibility.
78 '(begin
79 (substitute* (find-files "cgi" "\\.c$")
80 (("__DATE__") "\"1970-01-01\"")
81 (("__TIME__") "\"00:00:00\""))
82 #t))))
83 (build-system gnu-build-system)
84 (native-inputs
85 `(("unzip" ,unzip)))
86 (inputs
87 `(("zlib" ,zlib)
88 ("libpng-apng" ,libpng)
89 ("gd" ,gd)
90 ("perl" ,perl)
91 ("mailutils" ,mailutils)))
92 (arguments
93 '(#:configure-flags (list "--sysconfdir=/etc"
94
95 ;; 'include/locations.h.in' defines file
96 ;; locations, and many things go directly under
97 ;; LOCALSTATEDIR, hence the extra '/nagios'.
98 "--localstatedir=/var/nagios"
99
100 (string-append
101 "--with-mail="
102 (assoc-ref %build-inputs "mailutils")
103 "/bin/mail"))
104 #:make-flags '("all")
105 #:phases (modify-phases %standard-phases
106 (add-before 'build 'do-not-chown-to-nagios
107 (lambda _
108 ;; Makefiles do 'install -o nagios -g nagios', which
109 ;; doesn't work for us.
110 (substitute* (find-files "." "^Makefile$")
111 (("-o nagios -g nagios")
112 ""))
113 #t))
114 (add-before 'build 'do-not-create-sysconfdir
115 (lambda _
116 ;; Don't try to create /var upon 'make install'.
117 (substitute* "Makefile"
118 (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
119 (string-append "# " all))
120 (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
121 (string-append "# " all))
122 (("chmod g\\+s.*" all)
123 (string-append "# " all)))
124 #t))
125 (add-before 'build 'set-html/php-directory
126 (lambda _
127 ;; Install HTML and PHP files under 'share/nagios/html'
128 ;; instead of just 'share/'.
129 (substitute* '("html/Makefile" "Makefile")
130 (("HTMLDIR=.*$")
131 "HTMLDIR = $(datarootdir)/nagios/html\n"))
132 #t)))
133 #:tests? #f)) ;no 'check' target or similar
134 (home-page "https://www.nagios.org/")
135 (synopsis "Host, service, and network monitoring program")
136 (description
137 "Nagios is a host, service, and network monitoring program written in C.
138 CGI programs are included to allow you to view the current status, history,
139 etc. via a Web interface. Features include:
140
141 @itemize
142 @item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
143 @item Monitoring of host resources (processor load, disk usage, etc.).
144 @item A plugin interface to allow for user-developed service monitoring
145 methods.
146 @item Ability to define network host hierarchy using \"parent\" hosts,
147 allowing detection of and distinction between hosts that are down
148 and those that are unreachable.
149 @item Notifications when problems occur and get resolved (via email,
150 pager, or user-defined method).
151 @item Ability to define event handlers for proactive problem resolution.
152 @item Automatic log file rotation/archiving.
153 @item Optional web interface for viewing current network status,
154 notification and problem history, log file, etc.
155 @end itemize\n")
156 (license license:gpl2)))
157
158 (define-public zabbix-agentd
159 (package
160 (name "zabbix-agentd")
161 (version "5.0.3")
162 (source
163 (origin
164 (method url-fetch)
165 (uri (string-append
166 "https://cdn.zabbix.com/zabbix/sources/stable/"
167 (version-major+minor version) "/zabbix-" version ".tar.gz"))
168 (sha256
169 (base32 "1dc3fb9pa2cr6mfwgfyy1hpx26pbrws7989wj2kiiilmvimvrz1l"))))
170 (build-system gnu-build-system)
171 (arguments
172 `(#:configure-flags
173 (list "--enable-agent"
174 (string-append "--with-iconv="
175 (assoc-ref %build-inputs "libiconv"))
176 (string-append "--with-libpcre="
177 (assoc-ref %build-inputs "pcre")))))
178 (inputs
179 `(("libiconv" ,libiconv)
180 ("pcre" ,pcre)))
181 (home-page "https://www.zabbix.com/")
182 (synopsis "Distributed monitoring solution (client-side agent)")
183 (description "This package provides a distributed monitoring
184 solution (client-side agent)")
185 (license license:gpl2)))
186
187 (define-public zabbix-server
188 (package
189 (inherit zabbix-agentd)
190 (name "zabbix-server")
191 (outputs '("out" "front-end" "schema"))
192 (arguments
193 (substitute-keyword-arguments
194 `(#:phases
195 (modify-phases %standard-phases
196 (add-after 'install 'install-front-end
197 (lambda* (#:key outputs #:allow-other-keys)
198 (let* ((php (string-append (assoc-ref outputs "front-end")
199 "/share/zabbix/php"))
200 (front-end-conf (string-append php "/conf"))
201 (etc (string-append php "/etc")))
202 (mkdir-p php)
203 (copy-recursively "ui" php)
204 ;; Make front-end write config to ‘/etc/zabbix’ directory.
205 (rename-file front-end-conf
206 (string-append front-end-conf "-example"))
207 (symlink "/etc/zabbix" front-end-conf))
208 #t))
209 (add-after 'install 'install-schema
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let ((database-directory
212 (string-append (assoc-ref outputs "schema")
213 "/database")))
214 (for-each delete-file
215 (find-files "database" "Makefile\\.in|\\.am$"))
216 (mkdir-p database-directory)
217 (copy-recursively "database" database-directory))
218 #t)))
219 ,@(package-arguments zabbix-agentd))
220 ((#:configure-flags flags)
221 `(cons* "--enable-server"
222 "--with-postgresql"
223 (string-append "--with-libevent="
224 (assoc-ref %build-inputs "libevent"))
225 "--with-net-snmp"
226 (string-append "--with-gnutls="
227 (assoc-ref %build-inputs "gnutls"))
228 "--with-libcurl"
229 (string-append "--with-zlib="
230 (assoc-ref %build-inputs "zlib"))
231 ,flags))))
232 (inputs
233 `(("curl" ,curl)
234 ("libevent" ,libevent)
235 ("gnutls" ,gnutls)
236 ("postgresql" ,postgresql)
237 ("zlib" ,zlib)
238 ("net-snmp" ,net-snmp)
239 ("curl" ,curl)
240 ,@(package-inputs zabbix-agentd)))
241 (synopsis "Distributed monitoring solution (server-side)")
242 (description "This package provides a distributed monitoring
243 solution (server-side)")))
244
245 (define-public darkstat
246 (package
247 (name "darkstat")
248 (version "3.0.719")
249 (source (origin
250 (method url-fetch)
251 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
252 version ".tar.bz2"))
253 (sha256
254 (base32
255 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
256 (build-system gnu-build-system)
257 (arguments '(#:tests? #f)) ; no tests
258 (inputs
259 `(("libpcap" ,libpcap)
260 ("zlib" ,zlib)))
261 (home-page "https://unix4lyfe.org/darkstat/")
262 (synopsis "Network statistics gatherer")
263 (description
264 "@command{darkstat} is a packet sniffer that runs as a background process,
265 gathers all sorts of statistics about network usage, and serves them over
266 HTTP. Features:
267
268 @itemize
269 @item Traffic graphs, reports per host, shows ports for each host.
270 @item Embedded web-server with deflate compression.
271 @item Asynchronous reverse DNS resolution using a child process.
272 @item Small. Portable. Single-threaded. Efficient.
273 @item Supports IPv6.
274 @end itemize")
275 (license license:gpl2)))
276
277 (define-public python-whisper
278 (package
279 (name "python-whisper")
280 (version "1.0.2")
281 (source
282 (origin
283 (method url-fetch)
284 (uri (pypi-uri "whisper" version))
285 (sha256
286 (base32
287 "1v1bi3fl1i6p4z4ki692bykrkw6907dn3mfq0151f70lvi3zpns3"))))
288 (build-system python-build-system)
289 (home-page "http://graphiteapp.org/")
290 (synopsis "Fixed size round-robin style database for Graphite")
291 (description "Whisper is one of three components within the Graphite
292 project. Whisper is a fixed-size database, similar in design and purpose to
293 RRD (round-robin-database). It provides fast, reliable storage of numeric
294 data over time. Whisper allows for higher resolution (seconds per point) of
295 recent data to degrade into lower resolutions for long-term retention of
296 historical data.")
297 (license license:asl2.0)))
298
299 (define-public python2-whisper
300 (package-with-python2 python-whisper))
301
302 (define-public python2-carbon
303 (package
304 (name "python2-carbon")
305 (version "1.0.2")
306 (source
307 (origin
308 (method url-fetch)
309 (uri (pypi-uri "carbon" version))
310 (sha256
311 (base32
312 "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn"))))
313 (build-system python-build-system)
314 (arguments
315 `(#:python ,python-2 ; only supports Python 2
316 #:phases
317 (modify-phases %standard-phases
318 ;; Don't install to /opt
319 (add-after 'unpack 'do-not-install-to-/opt
320 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
321 (propagated-inputs
322 `(("python2-whisper" ,python2-whisper)
323 ("python2-configparser" ,python2-configparser)
324 ("python2-txamqp" ,python2-txamqp)))
325 (home-page "http://graphiteapp.org/")
326 (synopsis "Backend data caching and persistence daemon for Graphite")
327 (description "Carbon is a backend data caching and persistence daemon for
328 Graphite. Carbon is responsible for receiving metrics over the network,
329 caching them in memory for \"hot queries\" from the Graphite-Web application,
330 and persisting them to disk using the Whisper time-series library.")
331 (license license:asl2.0)))
332
333 (define-public python2-graphite-web
334 (package
335 (name "python2-graphite-web")
336 (version "1.0.2")
337 (source
338 (origin
339 (method url-fetch)
340 (uri (pypi-uri "graphite-web" version))
341 (sha256
342 (base32
343 "0q8bwlj75jqyzmazfsi5sa26xl58ssa8wdxm2l4j0jqyn8xpfnmc"))))
344 (build-system python-build-system)
345 (arguments
346 `(#:python ,python-2 ; only supports Python 2
347 #:phases
348 (modify-phases %standard-phases
349 (add-after 'unpack 'relax-requirements
350 (lambda _
351 (substitute* "setup.py"
352 (("0.4.3") ,(package-version python2-django-tagging))
353 (("<1.9.99") (string-append "<="
354 ,(package-version python2-django))))
355 #t))
356 ;; Don't install to /opt
357 (add-after 'unpack 'do-not-install-to-/opt
358 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
359 (propagated-inputs
360 `(("python2-cairocffi" ,python2-cairocffi)
361 ("python2-pytz" ,python2-pytz)
362 ("python2-whisper" ,python2-whisper)
363 ("python2-django" ,python2-django)
364 ("python2-django-tagging" ,python2-django-tagging)
365 ("python2-scandir" ,python2-scandir)
366 ("python2-urllib3" ,python2-urllib3)
367 ("python2-pyparsing" ,python2-pyparsing)
368 ("python2-txamqp" ,python2-txamqp)))
369 (home-page "http://graphiteapp.org/")
370 (synopsis "Scalable realtime graphing system")
371 (description "Graphite is a scalable real-time graphing system that does
372 two things: store numeric time-series data, and render graphs of this data on
373 demand.")
374 (license license:asl2.0)))
375
376 (define-public python-prometheus-client
377 (package
378 (name "python-prometheus-client")
379 (version "0.7.1")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (pypi-uri "prometheus_client" version))
384 (sha256
385 (base32 "1ni2yv4ixwz32nz39ckia76lvggi7m19y5f702w5qczbnfi29kbi"))))
386 (build-system python-build-system)
387 (arguments
388 '(;; No included tests.
389 #:tests? #f))
390 (propagated-inputs
391 `(("python-twisted" ,python-twisted)))
392 (home-page
393 "https://github.com/prometheus/client_python")
394 (synopsis "Python client for the Prometheus monitoring system")
395 (description
396 "The @code{prometheus_client} package supports exposing metrics from
397 software written in Python, so that they can be scraped by a Prometheus
398 service.
399
400 Metrics can be exposed through a standalone web server, or through Twisted,
401 WSGI and the node exporter textfile collector.")
402 (license license:asl2.0)))
403
404 (define-public python2-prometheus-client
405 (package-with-python2 python-prometheus-client))
406
407 (define-public go-github-com-prometheus-node-exporter
408 (package
409 (name "go-github-com-prometheus-node-exporter")
410 (version "0.18.1")
411 (source (origin
412 (method git-fetch)
413 (uri (git-reference
414 (url "https://github.com/prometheus/node_exporter")
415 (commit (string-append "v" version))))
416 (file-name (git-file-name name version))
417 (sha256
418 (base32
419 "0s3sp1gj86p7npxl38hkgs6ymd3wjjmc5hydyg1b5wh0x3yvpx07"))))
420 (build-system go-build-system)
421 (arguments
422 '(#:import-path "github.com/prometheus/node_exporter"))
423 (synopsis "Prometheus exporter for hardware and OS metrics")
424 (description "Prometheus exporter for metrics exposed by *NIX kernels,
425 written in Go with pluggable metric collectors.")
426 (home-page "https://github.com/prometheus/node_exporter")
427 (license license:asl2.0)))
428
429 (define-public fswatch
430 (package
431 (name "fswatch")
432 (version "1.15.0")
433 (source (origin
434 (method git-fetch)
435 (uri (git-reference
436 (url "https://github.com/emcrisostomo/fswatch")
437 (commit version)))
438 (file-name (git-file-name name version))
439 (sha256
440 (base32
441 "1yz65jsbgdx4cmy16x24wz5di352lvyi7fp6jm90bhgl1vpzxlsx"))))
442 (build-system gnu-build-system)
443 (native-inputs
444 `(("autoconf" ,autoconf)
445 ("automake" ,automake)
446 ("gettext" ,gettext-minimal)
447 ("libtool" ,libtool)))
448 (synopsis "File system monitor")
449 (description "This package provides a file system monitor.")
450 (home-page "https://github.com/emcrisostomo/fswatch")
451 (license license:gpl3+)))
452
453 (define-public collectd
454 (package
455 (name "collectd")
456 (version "5.11.0")
457 (source (origin
458 (method url-fetch)
459 (uri (string-append
460 "https://storage.googleapis.com/collectd-tarballs/collectd-"
461 version
462 ".tar.bz2"))
463 (sha256
464 (base32
465 "1cjxksxdqcqdccz1nbnc2fp6yy84qq361ynaq5q8bailds00mc9p"))
466 (patches (search-patches "collectd-5.11.0-noinstallvar.patch"))))
467 (build-system gnu-build-system)
468 (arguments
469 `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")
470 #:phases (modify-phases %standard-phases
471 (add-before 'configure 'autoreconf
472 (lambda _
473 ;; Required because of patched sources.
474 (invoke "autoreconf" "-vfi"))))))
475 (inputs
476 `(("rrdtool" ,rrdtool)
477 ("curl" ,curl)
478 ("libyajl" ,libyajl)))
479 (native-inputs
480 `(("autoconf" ,autoconf)
481 ("automake" ,automake)
482 ("libtool" ,libtool)
483 ("pkg-config" ,pkg-config)))
484 (home-page "https://collectd.org/")
485 (synopsis "Collect system and application performance metrics periodically")
486 (description
487 "collectd gathers metrics from various sources such as the operating system,
488 applications, log files and external devices, and stores this information or
489 makes it available over the network. Those statistics can be used to monitor
490 systems, find performance bottlenecks (i.e., performance analysis) and predict
491 future system load (i.e., capacity planning).")
492 ;; license:expat for the daemon in src/daemon/ and some plugins,
493 ;; license:gpl2 for other plugins
494 (license (list license:expat license:gpl2))))
495