gnu: dnsmasq: Update to 2.87.
[jackhill/guix/guix.git] / gnu / packages / monitoring.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2021, 2021 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, 2021 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 ;;; Copyright © 2021, 2022 Marius Bakke <marius@gnu.org>
11 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
12 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
13 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
14 ;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
15 ;;; Copyright © 2022 ( <paren@disroot.org>
16 ;;; Copyright © 2022 Mathieu Laparie <mlaparie@disr.it>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages monitoring)
34 #:use-module (guix gexp)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix build-system perl)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system go)
43 #:use-module (guix utils)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages admin)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages databases)
52 #:use-module (gnu packages django)
53 #:use-module (gnu packages gd)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages gnome) ;libnotify
56 #:use-module (gnu packages image)
57 #:use-module (gnu packages mail)
58 #:use-module (gnu packages ncurses)
59 #:use-module (gnu packages networking)
60 #:use-module (gnu packages libevent)
61 #:use-module (gnu packages pcre)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages python-build)
66 #:use-module (gnu packages python-web)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages rrdtool)
69 #:use-module (gnu packages sphinx)
70 #:use-module (gnu packages time)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages web))
73
74 (define-public nagios
75 (package
76 (name "nagios")
77 (version "4.4.6")
78 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
79 (source (origin
80 (method url-fetch)
81 (uri (string-append
82 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
83 version "/nagios-" version ".tar.gz"))
84 (sha256
85 (base32
86 "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db"))
87 (modules '((guix build utils)))
88 (snippet
89 ;; Ensure reproducibility.
90 '(begin
91 (substitute* (find-files "cgi" "\\.c$")
92 (("__DATE__") "\"1970-01-01\"")
93 (("__TIME__") "\"00:00:00\""))
94 #t))))
95 (build-system gnu-build-system)
96 (native-inputs
97 (list unzip))
98 (inputs
99 `(("zlib" ,zlib)
100 ("libpng-apng" ,libpng)
101 ("gd" ,gd)
102 ("perl" ,perl)
103 ("mailutils" ,mailutils)))
104 (arguments
105 '(#:configure-flags (list "--sysconfdir=/etc"
106
107 ;; 'include/locations.h.in' defines file
108 ;; locations, and many things go directly under
109 ;; LOCALSTATEDIR, hence the extra '/nagios'.
110 "--localstatedir=/var/nagios"
111
112 (string-append
113 "--with-mail="
114 (assoc-ref %build-inputs "mailutils")
115 "/bin/mail"))
116 #:make-flags '("all")
117 #:phases (modify-phases %standard-phases
118 (add-before 'build 'do-not-chown-to-nagios
119 (lambda _
120 ;; Makefiles do 'install -o nagios -g nagios', which
121 ;; doesn't work for us.
122 (substitute* (find-files "." "^Makefile$")
123 (("-o nagios -g nagios")
124 ""))
125 #t))
126 (add-before 'build 'do-not-create-sysconfdir
127 (lambda _
128 ;; Don't try to create /var upon 'make install'.
129 (substitute* "Makefile"
130 (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
131 (string-append "# " all))
132 (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
133 (string-append "# " all))
134 (("chmod g\\+s.*" all)
135 (string-append "# " all)))
136 #t))
137 (add-before 'build 'set-html/php-directory
138 (lambda _
139 ;; Install HTML and PHP files under 'share/nagios/html'
140 ;; instead of just 'share/'.
141 (substitute* '("html/Makefile" "Makefile")
142 (("HTMLDIR=.*$")
143 "HTMLDIR = $(datarootdir)/nagios/html\n"))
144 #t)))
145 #:tests? #f)) ;no 'check' target or similar
146 (home-page "https://www.nagios.org/")
147 (synopsis "Host, service, and network monitoring program")
148 (description
149 "Nagios is a host, service, and network monitoring program written in C.
150 CGI programs are included to allow you to view the current status, history,
151 etc. via a Web interface. Features include:
152
153 @itemize
154 @item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
155 @item Monitoring of host resources (processor load, disk usage, etc.).
156 @item A plugin interface to allow for user-developed service monitoring
157 methods.
158 @item Ability to define network host hierarchy using \"parent\" hosts,
159 allowing detection of and distinction between hosts that are down
160 and those that are unreachable.
161 @item Notifications when problems occur and get resolved (via email,
162 pager, or user-defined method).
163 @item Ability to define event handlers for proactive problem resolution.
164 @item Automatic log file rotation/archiving.
165 @item Optional web interface for viewing current network status,
166 notification and problem history, log file, etc.
167 @end itemize\n")
168 (license license:gpl2)))
169
170 (define-public zabbix-agentd
171 (package
172 (name "zabbix-agentd")
173 (version "6.0.8")
174 (source
175 (origin
176 (method url-fetch)
177 (uri (string-append
178 "https://cdn.zabbix.com/zabbix/sources/stable/"
179 (version-major+minor version) "/zabbix-" version ".tar.gz"))
180 (sha256
181 (base32 "0ijf5d0kl2wb6amlz3bqfh7xg4wy00n1prislhszclj01sn0gy1g"))
182 (modules '((guix build utils)))
183 (snippet
184 '(substitute* '("src/zabbix_proxy/proxy.c"
185 "src/zabbix_server/server.c")
186 ;; 'fping' must be setuid, so look for it in the usual location.
187 (("/usr/sbin/fping6?")
188 "/run/setuid-programs/fping")))))
189 (build-system gnu-build-system)
190 (arguments
191 '(#:configure-flags
192 '("--enable-agent" "--enable-ipv6" "--with-libpcre2")))
193 (native-inputs
194 (list pkg-config))
195 (inputs
196 (list pcre2))
197 (home-page "https://www.zabbix.com/")
198 (synopsis "Distributed monitoring solution (client-side agent)")
199 (description "This package provides a distributed monitoring
200 solution (client-side agent)")
201 (license license:gpl2+)
202 (properties
203 '((release-monitoring-url . "https://www.zabbix.com/download_sources")
204 (upstream-name . "zabbix")))))
205
206 (define-public zabbix-server
207 (package
208 (inherit zabbix-agentd)
209 (name "zabbix-server")
210 (outputs '("out" "front-end" "schema"))
211 (arguments
212 (substitute-keyword-arguments (package-arguments zabbix-agentd)
213 ((#:phases phases '%standard-phases)
214 #~(modify-phases #$phases
215 (add-after 'install 'install-front-end
216 (lambda* (#:key outputs #:allow-other-keys)
217 (let* ((php (string-append (assoc-ref outputs "front-end")
218 "/share/zabbix/php"))
219 (front-end-conf (string-append php "/conf"))
220 (etc (string-append php "/etc")))
221 (mkdir-p php)
222 (copy-recursively "ui" php)
223 ;; Make front-end read config from ‘/etc/zabbix’ directory.
224 (rename-file front-end-conf
225 (string-append front-end-conf "-example"))
226 (symlink "/etc/zabbix" front-end-conf))))
227 (add-after 'install 'install-schema
228 (lambda* (#:key outputs #:allow-other-keys)
229 (let ((database-directory
230 (string-append (assoc-ref outputs "schema")
231 "/database")))
232 (for-each delete-file
233 (find-files "database" "Makefile\\.in|\\.am$"))
234 (mkdir-p database-directory)
235 (copy-recursively "database" database-directory))))))
236 ((#:configure-flags flags ''())
237 #~(append (list "--enable-server"
238 "--with-postgresql"
239 (string-append "--with-libevent="
240 (assoc-ref %build-inputs "libevent"))
241 "--with-net-snmp"
242 (string-append "--with-gnutls="
243 (assoc-ref %build-inputs "gnutls"))
244 "--with-libcurl"
245 (string-append "--with-zlib="
246 (assoc-ref %build-inputs "zlib")))
247 (delete "--enable-agent" #$flags)))))
248 (inputs
249 (modify-inputs (package-inputs zabbix-agentd)
250 (prepend curl
251 libevent
252 gnutls
253 net-snmp
254 postgresql
255 zlib)))
256 (synopsis "Distributed monitoring solution (server-side)")
257 (description "This package provides a distributed monitoring
258 solution (server-side)")))
259
260 (define-public zabbix-cli
261 (package
262 (name "zabbix-cli")
263 (version "2.3.0")
264 (source (origin
265 (method git-fetch)
266 (uri (git-reference
267 (url "https://github.com/unioslo/zabbix-cli")
268 (commit version)))
269 (file-name (git-file-name name version))
270 (sha256
271 (base32
272 "1p8xkq3mxg476srwrgqax76vjzji0rjx32njmgnpa409vaqrbj5p"))))
273 (build-system python-build-system)
274 (arguments
275 (list #:phases
276 #~(modify-phases %standard-phases
277 (add-after 'unpack 'use-absolute-ncurses
278 (lambda* (#:key inputs #:allow-other-keys)
279 (let ((clear (search-input-file inputs "bin/clear")))
280 (substitute* "bin/zabbix-cli"
281 (("'clear'")
282 (string-append "'" clear "'"))))))
283 (add-after 'unpack 'patch-setup.py
284 (lambda _
285 ;; Install data_files to $out/share instead of /usr/share.
286 (substitute* "setup.py"
287 (("/usr/") ""))))
288 (add-after 'build 'build-docs
289 (lambda _
290 (invoke "make" "-C" "docs" "manual")
291 (invoke "make" "-C" "docs" "singlehtml")))
292 (add-after 'install 'install-docs
293 (lambda _
294 (install-file "docs/_build/man/zabbix-cli.1"
295 (string-append #$output "/share/man/man1"))
296 (copy-recursively "docs/_build/singlehtml"
297 (string-append #$output "/share/doc/"
298 #$name "/html"))))
299 (replace 'check
300 (lambda _
301 (invoke "pytest" "-vv"))))))
302 (native-inputs
303 (list python-pytest python-sphinx))
304 (inputs
305 (list ncurses python-requests))
306 (home-page "https://github.com/unioslo/zabbix-cli")
307 (synopsis "Command-line interface to Zabbix")
308 (description
309 "@command{zabbix-cli} is a command-line client for the Zabbix
310 monitoring system. It can configure and display various aspects of Zabbix
311 through a text-based interface.")
312 (license license:gpl3+)))
313
314 (define-public python-pyzabbix
315 (package
316 (name "python-pyzabbix")
317 (version "1.2.1")
318 (home-page "https://github.com/lukecyca/pyzabbix")
319 ;; No tests on PyPI, use the git checkout.
320 (source
321 (origin
322 (method git-fetch)
323 (uri (git-reference (url home-page) (commit version)))
324 (file-name (git-file-name name version))
325 (sha256
326 (base32
327 "0ad5xac67brmwc3wd0f87pjplly3cqyrz1dp725lzz2hrjgiaqi8"))))
328 (build-system python-build-system)
329 (arguments
330 '(#:phases (modify-phases %standard-phases
331 (replace 'check
332 (lambda* (#:key tests? #:allow-other-keys)
333 (if tests?
334 (invoke "pytest" "-vv" "tests")
335 (format #t "test suite not run~%")))))))
336 (native-inputs
337 ;; For tests.
338 (list python-requests-mock python-pytest))
339 (propagated-inputs
340 (list python-packaging python-requests))
341 (synopsis "Python interface to the Zabbix API")
342 (description
343 "@code{pyzabbix} is a Python module for working with the Zabbix API.")
344 (license license:lgpl2.1+)))
345
346 (define-public darkstat
347 (package
348 (name "darkstat")
349 (version "3.0.719")
350 (source (origin
351 (method url-fetch)
352 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
353 version ".tar.bz2"))
354 (sha256
355 (base32
356 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
357 (build-system gnu-build-system)
358 (arguments '(#:tests? #f)) ; no tests
359 (inputs
360 (list libpcap zlib))
361 (home-page "https://unix4lyfe.org/darkstat/")
362 (synopsis "Network statistics gatherer")
363 (description
364 "@command{darkstat} is a packet sniffer that runs as a background process,
365 gathers all sorts of statistics about network usage, and serves them over
366 HTTP. Features:
367
368 @itemize
369 @item Traffic graphs, reports per host, shows ports for each host.
370 @item Embedded web-server with deflate compression.
371 @item Asynchronous reverse DNS resolution using a child process.
372 @item Small. Portable. Single-threaded. Efficient.
373 @item Supports IPv6.
374 @end itemize")
375 (license license:gpl2)))
376
377 (define-public python-whisper
378 (package
379 (name "python-whisper")
380 (version "1.1.8")
381 (source
382 (origin
383 (method url-fetch)
384 (uri (pypi-uri "whisper" version))
385 (sha256
386 (base32
387 "1bk29w09zcpsv8hp0g0al7nwrxa07z0ycls3mbh83wfavk83aprl"))))
388 (build-system python-build-system)
389 (native-inputs (list python-six))
390 (home-page "http://graphiteapp.org/")
391 (synopsis "Fixed size round-robin style database for Graphite")
392 (description "Whisper is one of three components within the Graphite
393 project. Whisper is a fixed-size database, similar in design and purpose to
394 RRD (round-robin-database). It provides fast, reliable storage of numeric
395 data over time. Whisper allows for higher resolution (seconds per point) of
396 recent data to degrade into lower resolutions for long-term retention of
397 historical data.")
398 (license license:asl2.0)))
399
400 (define-public python-carbon
401 (package
402 (name "python-carbon")
403 (version "1.1.8")
404 (source
405 (origin
406 (method url-fetch)
407 (uri (pypi-uri "carbon" version))
408 (sha256
409 (base32
410 "1wb91fipk1niciffq5xwqbh8g7rl7ghdam4m97cjbig12i5qr4cm"))))
411 (build-system python-build-system)
412 (arguments
413 `(#:phases
414 (modify-phases %standard-phases
415 ;; Don't install to /opt
416 (add-after 'unpack 'do-not-install-to-/opt
417 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
418 (propagated-inputs
419 (list python-cachetools python-txamqp python-urllib3 python-whisper))
420 (home-page "http://graphiteapp.org/")
421 (synopsis "Backend data caching and persistence daemon for Graphite")
422 (description "Carbon is a backend data caching and persistence daemon for
423 Graphite. Carbon is responsible for receiving metrics over the network,
424 caching them in memory for \"hot queries\" from the Graphite-Web application,
425 and persisting them to disk using the Whisper time-series library.")
426 (license license:asl2.0)))
427
428 (define-public graphite-web
429 (package
430 (name "graphite-web")
431 (version "1.1.7")
432 (source
433 (origin
434 (method url-fetch)
435 (uri (pypi-uri "graphite-web" version))
436 (sha256
437 (base32
438 "1l5a5rry9cakqxamvlx4xq63jifmncb6815bg9vy7fg1zyd3pjxk"))))
439 (build-system python-build-system)
440 (arguments
441 `(#:tests? #f ;XXX: not in PyPI release & requires database
442 #:phases
443 (modify-phases %standard-phases
444 (add-after 'unpack 'relax-requirements
445 (lambda _
446 (substitute* "setup.py"
447 ;; Allow newer versions of django-tagging.
448 (("django-tagging==")
449 "django-tagging>="))
450 #t))
451 ;; Don't install to /opt
452 (add-after 'unpack 'do-not-install-to-/opt
453 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
454 (propagated-inputs
455 (list python-cairocffi
456 python-pytz
457 python-whisper
458 python-django-2.2
459 python-django-tagging
460 python-scandir
461 python-urllib3
462 python-pyparsing
463 python-txamqp))
464 (home-page "https://graphiteapp.org/")
465 (synopsis "Scalable realtime graphing system")
466 (description "Graphite is a scalable real-time graphing system that does
467 two things: store numeric time-series data, and render graphs of this data on
468 demand.")
469 (license license:asl2.0)))
470
471 (define-public python-prometheus-client
472 (package
473 (name "python-prometheus-client")
474 (version "0.7.1")
475 (source
476 (origin
477 (method url-fetch)
478 (uri (pypi-uri "prometheus_client" version))
479 (sha256
480 (base32 "1ni2yv4ixwz32nz39ckia76lvggi7m19y5f702w5qczbnfi29kbi"))))
481 (build-system python-build-system)
482 (arguments
483 '(;; No included tests.
484 #:tests? #f))
485 (propagated-inputs
486 (list python-twisted))
487 (home-page
488 "https://github.com/prometheus/client_python")
489 (synopsis "Python client for the Prometheus monitoring system")
490 (description
491 "The @code{prometheus_client} package supports exposing metrics from
492 software written in Python, so that they can be scraped by a Prometheus
493 service.
494
495 Metrics can be exposed through a standalone web server, or through Twisted,
496 WSGI and the node exporter textfile collector.")
497 (license license:asl2.0)))
498
499 (define-public go-github-com-prometheus-node-exporter
500 (package
501 (name "go-github-com-prometheus-node-exporter")
502 (version "0.18.1")
503 (source (origin
504 (method git-fetch)
505 (uri (git-reference
506 (url "https://github.com/prometheus/node_exporter")
507 (commit (string-append "v" version))))
508 (file-name (git-file-name name version))
509 (sha256
510 (base32
511 "0s3sp1gj86p7npxl38hkgs6ymd3wjjmc5hydyg1b5wh0x3yvpx07"))))
512 (build-system go-build-system)
513 (arguments
514 '(#:import-path "github.com/prometheus/node_exporter"))
515 (synopsis "Prometheus exporter for hardware and OS metrics")
516 (description "Prometheus exporter for metrics exposed by *NIX kernels,
517 written in Go with pluggable metric collectors.")
518 (home-page "https://github.com/prometheus/node_exporter")
519 (license license:asl2.0)))
520
521 (define-public temper-exporter
522 (let ((commit "a87bbab19c05609d62d9e4c7941178700c1ef84d")
523 (revision "0"))
524 (package
525 (name "temper-exporter")
526 (version (git-version "0" revision commit))
527 (source (origin
528 (method git-fetch)
529 (uri (git-reference
530 (url "https://github.com/yrro/temper-exporter")
531 (commit commit)))
532 (file-name (git-file-name name version))
533 (sha256
534 (base32
535 "0jk3ydi8s14q5kyl9j3gm2zrnwlb1jwjqpg5vqrgkbm9jrldrabc"))))
536 (build-system python-build-system)
537 (arguments
538 '(#:tests? #f ; One test failure:
539 ; test/test_exporter.py:33:
540 ; AssertionError
541 #:phases
542 (modify-phases %standard-phases
543 (add-after 'unpack 'patch-setup.py
544 (lambda _
545 (substitute* "setup.py"
546 (("git_ref = .*\n") "git_ref = ''\n"))
547 #t))
548 (add-after 'install 'install-udev-rules
549 (lambda* (#:key outputs #:allow-other-keys)
550 (install-file "debian/prometheus-temper-exporter.udev"
551 (string-append (assoc-ref outputs "out")
552 "/lib/udev/rules.d"))
553 #t)))))
554 (inputs
555 (list python-prometheus-client python-pyudev))
556 (native-inputs
557 (list python-pytest python-pytest-mock python-pytest-runner))
558 (home-page "https://github.com/yrro/temper-exporter")
559 (synopsis "Prometheus exporter for PCSensor TEMPer sensor devices")
560 (description
561 "This package contains a Prometheus exporter for the TEMPer sensor
562 devices.")
563 (license license:expat))))
564
565 (define-public fswatch
566 (package
567 (name "fswatch")
568 (version "1.16.0")
569 (source (origin
570 (method git-fetch)
571 (uri (git-reference
572 (url "https://github.com/emcrisostomo/fswatch")
573 (commit version)))
574 (file-name (git-file-name name version))
575 (sha256
576 (base32
577 "1zsvc8arza2ypnnmv4m0qfpnldmy1zh10q6wss05ibmanslfj2ql"))))
578 (build-system gnu-build-system)
579 (native-inputs
580 (list autoconf automake gettext-minimal libtool))
581 (arguments
582 (list #:configure-flags
583 #~(list "--disable-static")))
584 (synopsis "File system monitor")
585 (description "This package provides a file system monitor.")
586 (home-page "https://github.com/emcrisostomo/fswatch")
587 (license license:gpl3+)))
588
589 (define-public collectd
590 (package
591 (name "collectd")
592 (version "5.12.0")
593 (source (origin
594 (method url-fetch)
595 (uri (string-append
596 "https://storage.googleapis.com/collectd-tarballs/collectd-"
597 version
598 ".tar.bz2"))
599 (sha256
600 (base32
601 "1mh97afgq6qgmpvpr84zngh58m0sl1b4wimqgvvk376188q09bjv"))
602 (patches (search-patches "collectd-5.11.0-noinstallvar.patch"))))
603 (build-system gnu-build-system)
604 (arguments
605 `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")
606 #:phases (modify-phases %standard-phases
607 (add-before 'configure 'autoreconf
608 (lambda _
609 ;; Required because of patched sources.
610 (invoke "autoreconf" "-vfi"))))))
611 (inputs
612 (list rrdtool curl libyajl))
613 (native-inputs
614 (list autoconf automake libtool pkg-config))
615 (home-page "https://collectd.org/")
616 (synopsis "Collect system and application performance metrics periodically")
617 (description
618 "collectd gathers metrics from various sources such as the operating system,
619 applications, log files and external devices, and stores this information or
620 makes it available over the network. Those statistics can be used to monitor
621 systems, find performance bottlenecks (i.e., performance analysis) and predict
622 future system load (i.e., capacity planning).")
623 ;; license:expat for the daemon in src/daemon/ and some plugins,
624 ;; license:gpl2 for other plugins
625 (license (list license:expat license:gpl2))))
626
627 (define-public hostscope
628 (package
629 (name "hostscope")
630 (version "8.0")
631 (source (origin
632 (method url-fetch)
633 (uri (string-append
634 "http://www.maier-komor.de/hostscope/hostscope-V"
635 version ".tgz"))
636 (sha256
637 (base32
638 "0jw6yij8va0f292g4xkf9lp9sxkzfgv67ajw49g3vq42q47ld7cv"))))
639 (build-system gnu-build-system)
640 (inputs (list ncurses))
641 (arguments '(#:tests? #f)) ;; No included tests.
642 (home-page "http://www.maier-komor.de/hostscope.html")
643 (properties `((release-monitoring-url . ,home-page)))
644 (synopsis
645 "System monitoring tool for multiple hosts")
646 (description
647 "HostScope displays key system metrics of Linux hosts, such as detailed
648 CPU load, speed and temperature, I/O rates of network interfaces, I/O rates of
649 disks, and user process summary information. All metrics are multicast on the
650 LAN, if wanted, and clients can switch between multiple hosts on the network.
651 Hostscope features a bridge to Influx DB. So Grafana can be used to visualize
652 the recorded data over time.")
653 (license license:gpl3+)))
654
655 (define-public fatrace
656 (package
657 (name "fatrace")
658 (version "0.16.3")
659 (source (origin
660 (method git-fetch)
661 (uri (git-reference
662 (url "https://github.com/martinpitt/fatrace")
663 (commit version)))
664 (file-name (git-file-name name version))
665 (sha256
666 (base32
667 "1bxz6v1z0icp716jnv3knjyqp8bv6xnkz8gqd8z3g2b6yxj5xff3"))))
668 (build-system gnu-build-system)
669 (arguments
670 `(#:phases
671 (modify-phases %standard-phases
672 (delete 'configure)
673 ;; tests need root to run as root,
674 ;; and there is no make target for them:
675 (delete 'check))
676 #:make-flags
677 (list (string-append "CC=" ,(cc-for-target))
678 (string-append "PREFIX=" %output))))
679 (synopsis "File access events monitor")
680 (description "This package provides a utility to report system wide file
681 access events from all running processes. Its main purpose is to find
682 processes which keep waking up the disk unnecessarily and thus prevent some
683 power saving.")
684 (home-page "https://github.com/martinpitt/fatrace")
685 (license license:gpl3+)))
686
687 (define-public pw
688 (package
689 (name "pw")
690 (version "2")
691 (source
692 (origin
693 (method git-fetch)
694 (uri (git-reference
695 (url "https://www.kylheku.com/git/pw")
696 (commit (string-append "pw-" version))))
697 (file-name (git-file-name name version))
698 (sha256
699 (base32 "1xn3qnzz48xan78cp83hfrcifrxx9lgnm14134qhyr5wvj7dk246"))))
700 (build-system gnu-build-system)
701 (arguments
702 (list #:tests? #f ; There are no tests
703 #:make-flags
704 #~(list (string-append "CC=" #$(cc-for-target))
705 (string-append "DESTDIR=" #$output))
706 #:phases
707 #~(modify-phases %standard-phases
708 (add-after 'unpack 'fix-makefile
709 (lambda _
710 (substitute* "Makefile"
711 (("/share/man/man1 \\\\") "/share/man/man1; \\"))))
712 (delete 'configure)
713 (add-before 'install 'make-install-dirs
714 (lambda _
715 (mkdir-p (string-append #$output "/bin"))
716 (mkdir-p (string-append #$output "/share/man/man1"))
717 (mkdir-p (string-append #$output "/share/man/man5")))))))
718 (home-page "https://www.kylheku.com/cgit/pw/")
719 (synopsis "Monitor recent lines of output from pipe")
720 (description
721 "@command{pw} is Pipe Watch, a utility that continuously reads lines of
722 text from a pipe or pipe-like source, passes them through a FIFO buffer, and
723 maintains a display based on the occasional sampling of the contents of the
724 FIFO buffer, with useful features such as triggering and filtering.
725
726 With @command{pw} you can:
727
728 @itemize
729 @item Interactively apply and remove filters on-the-fly, without interrupting
730 the source.
731
732 @item Make recurring patterns in the stream appear to ``freeze'' on the
733 screen, using triggers.
734
735 @item Prevent the overwhelming amount of output from a program from flooding
736 the terminal, while consuming all of that output so that the program isn't
737 blocked. @command{pw} can pause its display updates entirely.
738
739 @item Juggle multiple shell background jobs that produce output, yet execute
740 indefinitely without blocking. When @command{pw} runs as part of a shell
741 background job, it continues to consume input, process filters and take
742 snapshots, without displaying anything. When put into the foreground again,
743 display resumes.
744 @end itemize")
745 (license license:bsd-2)))
746
747 (define-public python-statsd
748 (package
749 (name "python-statsd")
750 (version "3.3.0")
751 (source (origin
752 (method url-fetch)
753 (uri (pypi-uri "statsd" version))
754 (sha256
755 (base32
756 "07yxnlalvcglgwa9pjs1clwrmwx7a4575jai7q05jz3g4i6dprp3"))))
757 (build-system python-build-system)
758 (native-inputs (list python-mock python-nose))
759 (home-page "https://github.com/jsocol/pystatsd")
760 (synopsis "Simple StatsD client")
761 (description "StatsD is a friendly front-end to Graphite. This package
762 provides a simple Python client for the StatsD daemon.")
763 (license license:expat)))
764
765 (define-public batsignal
766 (package
767 (name "batsignal")
768 (version "1.6.0")
769 (source (origin
770 (method git-fetch)
771 (uri (git-reference
772 (url "https://github.com/electrickite/batsignal")
773 (commit version)))
774 (file-name (git-file-name name version))
775 (sha256
776 (base32
777 "0b1j6mljnqgxwr3id3r9shzhsjk5r0qdh9cxkvy1dm4kzbyc4dxq"))))
778 (build-system gnu-build-system)
779 (arguments
780 (list #:make-flags
781 #~(list (string-append "PREFIX=" #$output)
782 (string-append "CC=" #$(cc-for-target)))
783 #:phases
784 #~(modify-phases %standard-phases
785 (add-after 'unpack 'fix-cross-compile
786 (lambda _
787 (substitute* "Makefile"
788 (("pkg-config")
789 #$(pkg-config-for-target)))))
790 (delete 'configure)
791 (replace 'check
792 (lambda* (#:key tests? #:allow-other-keys)
793 (when tests?
794 (invoke "./batsignal" "-v")))))))
795 (inputs (list libnotify))
796 (native-inputs (list pkg-config))
797 (home-page "https://github.com/electrickite/batsignal")
798 (synopsis "Power monitoring tool")
799 (description
800 "This package provides a daemon that monitors device power levels,
801 notifying the user and optionally running a command when it reaches
802 user-configured power thresholds. This can be used to force powering off a
803 laptop when the battery gets below critical levels, instead of damaging the
804 battery.")
805 (license license:isc)))
806