projects/guix·blob javascript-team · refs

1545 lines · 59.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <[email protected]>
3;;; Copyright © 2015 Siniša Biđin <[email protected]>
4;;; Copyright © 2016 Efraim Flashner <[email protected]>
5;;; Copyright © 2016, 2021, 2021 Ludovic Courtès <[email protected]>
6;;; Copyright © 2016, 2021 Stefan Reichör <[email protected]>
7;;; Copyright © 2017, 2018, 2019, 2020 Ricardo Wurmus <[email protected]>
8;;; Copyright © 2018 Sou Bunnbu <[email protected]>
9;;; Copyright © 2018-2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018 Gábor Boskovits <[email protected]>
11;;; Copyright © 2018, 2019, 2020 Oleg Pykhalov <[email protected]>
12;;; Copyright © 2019 Pierre Neidhardt <[email protected]>
13;;; Copyright © 2019, 2023 Vasile Dumitrascu <[email protected]>
14;;; Copyright © 2020 Alex ter Weele <[email protected]>
15;;; Copyright © 2020 Lars-Dominik Braun <[email protected]>
16;;; Copyright © 2021, 2022 Marius Bakke <[email protected]>
17;;; Copyright © 2021, 2023 Raphaël Mélotte <[email protected]>
18;;; Copyright © 2022 Greg Hogan <[email protected]>
19;;; Copyright © 2022 Paul A. Patience <[email protected]>
20;;; Copyright © 2022 Hartmut Goebel <[email protected]>
21;;; Copyright © 2022 ( <[email protected]>
22;;; Copyright © 2022 Mathieu Laparie <[email protected]>
23;;; Copyright © 2024 Ada Stevenson <[email protected]>
24;;; Copyright © 2025 Nicolas Graves <[email protected]>
25;;; Copyright © 2025 Giacomo Leidi <[email protected]>
26;;; Copyright © 2025 Christian Birk Sørensen <[email protected]>
27;;; Copyright © 2026 Alex Korzh <[email protected]>
28;;; Copyright © 2026 Artyom V. Poptsov <[email protected]>
29;;;
30;;; This file is part of GNU Guix.
31;;;
32;;; GNU Guix is free software; you can redistribute it and/or modify it
33;;; under the terms of the GNU General Public License as published by
34;;; the Free Software Foundation; either version 3 of the License, or (at
35;;; your option) any later version.
36;;;
37;;; GNU Guix is distributed in the hope that it will be useful, but
38;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40;;; GNU General Public License for more details.
41;;;
42;;; You should have received a copy of the GNU General Public License
43;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45(define-module (gnu packages monitoring)
46 #:use-module (guix gexp)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix build-system cargo)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system pyproject)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system go)
56 #:use-module (guix utils)
57 #:use-module (gnu packages)
58 #:use-module (gnu packages admin)
59 #:use-module (gnu packages autotools)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages curl)
63 #:use-module (gnu packages check)
64 #:use-module (gnu packages compression)
65 #:use-module (gnu packages crypto)
66 #:use-module (gnu packages databases)
67 #:use-module (gnu packages django)
68 #:use-module (gnu packages compiler-tools)
69 #:use-module (gnu packages freedesktop) ; libatasmart
70 #:use-module (gnu packages fontutils)
71 #:use-module (gnu packages gd)
72 #:use-module (gnu packages gettext)
73 #:use-module (gnu packages gnome) ;libnotify
74 #:use-module (gnu packages golang)
75 #:use-module (gnu packages golang-build)
76 #:use-module (gnu packages golang-check)
77 #:use-module (gnu packages golang-web)
78 #:use-module (gnu packages golang-xyz)
79 #:use-module (gnu packages gtk)
80 #:use-module (gnu packages image)
81 #:use-module (gnu packages lua)
82 #:use-module (gnu packages mail)
83 #:use-module (gnu packages ncurses)
84 #:use-module (gnu packages networking)
85 #:use-module (gnu packages libevent)
86 #:use-module (gnu packages linux) ; eudev, lm-sensors
87 #:use-module (gnu packages pcre)
88 #:use-module (gnu packages perl)
89 #:use-module (gnu packages pkg-config)
90 #:use-module (gnu packages prometheus)
91 #:use-module (gnu packages protobuf)
92 #:use-module (gnu packages pulseaudio)
93 #:use-module (gnu packages python)
94 #:use-module (gnu packages python-build)
95 #:use-module (gnu packages python-science)
96 #:use-module (gnu packages python-web)
97 #:use-module (gnu packages python-xyz)
98 #:use-module (gnu packages qt)
99 #:use-module (gnu packages rrdtool)
100 #:use-module (gnu packages sphinx)
101 #:use-module (gnu packages sqlite)
102 #:use-module (gnu packages time)
103 #:use-module (gnu packages tls)
104 #:use-module (gnu packages web)
105 #:use-module (gnu packages web)
106 #:use-module (gnu packages xml)
107 #:use-module (gnu packages xorg))
108
109(define aw-source
110 (let ((name "activitywatch")
111 (version "0.13.2"))
112 (origin
113 (method git-fetch)
114 (uri (git-reference
115 (url "https://github.com/ActivityWatch/activitywatch")
116 (commit (string-append "v" version))
117 (recursive? #t)))
118 (file-name (git-file-name name version))
119 (sha256
120 (base32 "0yaa7g35rz9dmgxvahvkfhjpkvmi50rd6bjd9ckxvk7mfs1q0xb7"))
121 (modules '((guix build utils)))
122 (snippet
123 #~(begin
124 ;; Relax platformdirs requirement.
125 (for-each delete-file (find-files "." "poetry\\.lock"))
126 (substitute* "aw-core/pyproject.toml"
127 (("^platformdirs = .*")
128 "platformdirs = \"*\"\n")))))))
129
130(define-public aw-core
131 (package
132 (name "aw-core")
133 (version "0.5.17")
134 (source aw-source)
135 (build-system pyproject-build-system)
136 (arguments
137 (list
138 #:modules
139 '((guix build pyproject-build-system)
140 (guix build utils)
141 (ice-9 ftw)
142 (srfi srfi-1)
143 (srfi srfi-26))
144 #:phases
145 #~(modify-phases %standard-phases
146 (add-after 'unpack 'chdir
147 (lambda* (#:key name #:allow-other-keys)
148 ;; All subprojects are in directories that match their name
149 ;; Here name still contains the version suffixed.
150 (and=> (find (cute string-prefix? <> name) (scandir "."))
151 chdir)))
152 (add-before 'check 'pre-check
153 (lambda _
154 (setenv "HOME" (getcwd)))))))
155 (native-inputs (list python-poetry-core python-pytest))
156 (propagated-inputs
157 (list python-click
158 python-deprecation
159 python-iso8601
160 python-jsonschema
161 python-peewee
162 python-platformdirs
163 python-rfc3339-validator
164 python-strict-rfc3339
165 python-timeslot
166 python-tomlkit))
167 (home-page "https://activitywatch.net/")
168 (synopsis "Core library for ActivityWatch")
169 (description
170 "This package provides the core library for @code{ActivityWatch}.")
171 (license license:mpl2.0)))
172
173(define-public aw-client
174 (package/inherit aw-core
175 (name "aw-client")
176 (version "0.5.15")
177 (arguments
178 (substitute-keyword-arguments arguments
179 ((#:test-flags test-flags #~(list))
180 #~(list
181 ;; Most likely requires the server to run.
182 "--deselect=tests/test_client.py::test_full"
183 ;; Tries to read from stdin.
184 "--deselect=tests/test_failqueue.py::test_failqueue"))))
185 (propagated-inputs
186 (list aw-core
187 python-click
188 python-persist-queue
189 python-requests
190 python-tabulate
191 python-typing-extensions))
192 (synopsis "Client library for ActivityWatch")
193 (description
194 "This package provides the client library for @code{ActivityWatch}.")))
195
196(define-public aw-notify
197 (package/inherit aw-core
198 (name "aw-notify")
199 (version "0.0.0") ;unreleased.
200 (arguments
201 (substitute-keyword-arguments arguments
202 ((#:tests? tests? #t)
203 #f))) ;No tests.
204 (synopsis "Notify library for ActivityWatch")
205 (description
206 "This package provides the notify library for @code{ActivityWatch}.")))
207
208(define-public aw-qt
209 (package/inherit aw-core
210 (name "aw-qt")
211 (version "0.1.0")
212 (arguments
213 (substitute-keyword-arguments arguments
214 ((#:phases phases #~%standard-phases)
215 #~(modify-phases #$phases
216 ;; (delete 'sanity-check)
217 (add-before 'check 'start-xserver
218 (lambda* (#:key inputs #:allow-other-keys)
219 (let* ((Xvfb (search-input-file inputs "/bin/Xvfb"))
220 (display ":1")
221 (command (string-join (list Xvfb display "&") " ")))
222 (setenv "DISPLAY" display)
223 (zero? (system command)))))))
224 ((#:test-backend _ #f)
225 #~'custom)
226 ((#:test-flags _ #~(list))
227 #~(list "tests/integration_tests.py"))))
228 (native-inputs
229 (list python-poetry-core xorg-server-for-tests))
230 (propagated-inputs
231 (list aw-core python-click python-pyqt-6))
232 (synopsis "Trayicon for ActivityWatch")
233 (description
234 "This package provides a tray icon for @code{ActivityWatch}.")))
235
236(define-public aw-server-rust
237 (let ((commit "d40d712cff2c1d5621b86e401e32076d2beef737")
238 (revision "1"))
239 (package
240 (name "aw-server-rust")
241 (version "0.13.1")
242 (source
243 (origin
244 (method git-fetch)
245 (uri (git-reference
246 (url "https://github.com/ActivityWatch/aw-server-rust")
247 (commit commit)))
248 (file-name (git-file-name name version))
249 (sha256
250 (base32 "1v4693xv99nq0kvclihgxiydnfxpyx748n1siyayw2ifkw9sw64m"))))
251 (build-system cargo-build-system)
252 (arguments
253 (list
254 #:install-source? #f
255 #:cargo-test-flags
256 '(list "--release" "--"
257 ;; Permission errors
258 "--skip=test::test_full"
259 "--skip=datastore_tests::test_datastore_reload"
260 "--skip=dirs::test_get_dirs")
261 #:phases
262 #~(modify-phases %standard-phases
263 (add-after 'unpack 'disable-vendored-features
264 (lambda _
265 (substitute* (find-files "." "Cargo\\.toml")
266 ((", features = \\[\"vendored\"\\]") ""))))
267 (replace 'install
268 (lambda _
269 (let ((bin (string-append #$output "/bin")))
270 (install-file "target/release/aw-server" bin)
271 (install-file "target/release/aw-sync" bin)))))))
272 (native-inputs (list pkg-config))
273 (inputs (cons* openssl sqlite (cargo-inputs 'aw-server-rust)))
274 (home-page "https://activitywatch.net/")
275 (synopsis "Store and retrieve quantified self data")
276 (description
277 "This package provides the ActivityWatch server, for secure storage and
278retrieval of all your quantified self data.")
279 (license license:mpl2.0))))
280
281(define-public aw-watcher-afk
282 (package/inherit aw-core
283 (name "aw-watcher-afk")
284 (version "0.2.0")
285 (arguments
286 (substitute-keyword-arguments arguments
287 ((#:tests? tests? #t)
288 #f) ;Most likely requires the server to run.
289 ((#:test-backend _ #f)
290 #~'custom)
291 ((#:test-flags _ #~(list))
292 #~(list "tests/test_continuous_events.py"))))
293 (propagated-inputs
294 (list aw-client python-pynput python-xlib))
295 (synopsis "AFK watcher for ActivityWatch")
296 (description
297 "This package provides a @acronym{AFK, away from keyboard} watcher for
298@code{ActivityWatch}.")))
299
300(define-public aw-watcher-input
301 (package/inherit aw-core
302 (name "aw-watcher-input")
303 (version "0.1.0")
304 (arguments
305 (substitute-keyword-arguments arguments
306 ((#:tests? tests? #t)
307 #f))) ;No tests.
308 (propagated-inputs
309 (list aw-client aw-watcher-afk))
310 (synopsis "Input watcher for ActivityWatch")
311 (description
312 "This package provide an input watcher for @code{ActivityWatch}.")))
313
314(define-public aw-watcher-window
315 (package/inherit aw-core
316 (name "aw-watcher-window")
317 (version "0.2.0")
318 (arguments
319 (substitute-keyword-arguments arguments
320 ((#:tests? tests? #t)
321 #f))) ;No tests.
322 (propagated-inputs
323 (list aw-client python-xlib))
324 (synopsis "X11 Window watcher for ActivityWatch")
325 (description
326 "This package provides a X11 window watcher for @code{ActivityWatch}.")))
327
328(define-public aw-watcher-window-wayland
329 (let ((commit "aea9aca029bd33d373bf53946a16dc05ef81e0b3")
330 (revision "0"))
331 (package
332 (name "aw-watcher-window-wayland")
333 (version (git-version "0.1.0" revision commit))
334 (source
335 (origin
336 (method git-fetch)
337 (uri
338 (git-reference
339 (url "https://github.com/ActivityWatch/aw-watcher-window-wayland")
340 (commit commit)))
341 (file-name (git-file-name name version))
342 (sha256
343 (base32 "0viir38q1vr5q2w3kfrz42m1lx9fxvxwq7l939m9sycqzmawi3fy"))))
344 (build-system cargo-build-system)
345 (arguments
346 (list
347 #:install-source? #f
348 #:phases
349 #~(modify-phases %standard-phases
350 (add-after 'unpack 'patch-aw-requirements
351 (lambda _
352 (substitute* "Cargo.toml"
353 (("^aw-client-rust = .*")
354 "aw-client-rust = \"*\"\n")))))))
355 (native-inputs (list pkg-config))
356 (inputs (cons* openssl (cargo-inputs 'aw-watcher-window-wayland)))
357 (home-page "https://activitywatch.net/")
358 (synopsis "Wayland window watcher for ActivityWatch")
359 (description
360 "This package provides a wayland window watcher for
361@code{ActivityWatch}.")
362 (license license:mpl2.0))))
363
364(define-public conky
365 (package
366 (name "conky")
367 (home-page "https://github.com/brndnmtthws/conky")
368 (version "1.19.8")
369 (source
370 (origin
371 (method git-fetch)
372 (uri (git-reference
373 (url home-page)
374 (commit (string-append "v" version))))
375 (file-name (git-file-name name version))
376 (sha256
377 (base32 "1g712cw2nzd2qvgdmyvazyda0znyqzg6yckg98ss203fggwp93vj"))))
378 (build-system cmake-build-system)
379 (arguments
380 (list
381 #:configure-flags
382 #~(list "-DRELEASE=true"
383 "-DBUILD_PULSEAUDIO=ON"
384 "-DBUILD_WLAN=ON"
385 "-DBUILD_TESTS=ON")
386 #:phases
387 #~(modify-phases %standard-phases
388 (add-after 'unpack 'add-freetype-to-search-path
389 (lambda* (#:key inputs #:allow-other-keys)
390 (substitute* "cmake/ConkyPlatformChecks.cmake"
391 (("set\\(INCLUDE_SEARCH_PATH")
392 (string-append
393 "set(INCLUDE_SEARCH_PATH "
394 (assoc-ref inputs "freetype") "/include/freetype2 ")))))
395 (replace 'install
396 (lambda _
397 (install-file "src/conky" (string-append #$output "/bin")))))))
398 (inputs
399 (list freetype
400 imlib2
401 libx11
402 libxdamage
403 libxext
404 libxft
405 libxi
406 libxinerama
407 pulseaudio
408 lua
409 ncurses
410 curl
411 wireless-tools))
412 (native-inputs
413 (list pkg-config))
414 (synopsis "Lightweight system monitor for X")
415 (description
416 "Conky is a lightweight system monitor for X that displays operating
417system statistics (CPU, disk, and memory usage, etc.) and more on the
418desktop.")
419 (license license:gpl3+)))
420
421(define-public gkrellm
422 (package
423 (name "gkrellm")
424 (version "2.5.1")
425 (source
426 (origin
427 (method url-fetch)
428 (uri (string-append "https://gkrellm.srcbox.net/releases/gkrellm-"
429 version ".tar.bz2"))
430 (sha256
431 (base32 "0qvy2xmwmfy5f0g09yn9lr262shnx82ba04r5il2wj4qscg3r7h8"))))
432 (build-system gnu-build-system)
433 (inputs (list gtk+-2 libsm))
434 (native-inputs (list gettext-minimal pkg-config))
435 (arguments
436 (list
437 #:tests? #f ;there is no check target
438 #:phases
439 #~(modify-phases %standard-phases
440 (delete 'configure)) ;no configure script
441 #:make-flags
442 #~(list (string-append "INSTALLROOT=" #$output)
443 (string-append "CC=" #$(cc-for-target)))))
444 (home-page "https://gkrellm.srcbox.net/")
445 (synopsis "System monitors")
446 (description
447 "GKrellM is a single process stack of system monitors which supports
448applying themes to match its appearance to your window manager, Gtk, or any
449other theme.")
450 (license license:gpl3+)))
451
452(define-public glances
453 (package
454 (name "glances")
455 (version "4.5.8")
456 (source
457 (origin
458 (method git-fetch)
459 (uri (git-reference
460 (url "https://github.com/nicolargo/glances")
461 (commit (string-append "v" version))))
462 (file-name (git-file-name name version))
463 (sha256
464 (base32 "0nif1y83s9kkyj84iw66xjppyg0hmwisp08wz9pm9hxxrkj641f0"))))
465 (build-system pyproject-build-system)
466 (arguments
467 (list
468 #:test-backend #~'custom
469 #:test-flags #~(list "tests/test_core.py")
470 #:phases
471 #~(modify-phases %standard-phases
472 (add-after 'unpack 'disable-update-checks
473 (lambda _
474 ;; Glances phones PyPI for weekly update checks by default.
475 ;; Disable these. The user can re-enable them if desired.
476 (substitute* "glances/outdated.py"
477 (("^(.*)self\\.load_config\\(config\\)\n" line indentation)
478 (string-append indentation
479 "self.args.disable_check_update = True\n" line))))))))
480 (native-inputs
481 (list python-pytest
482 python-setuptools))
483 (propagated-inputs
484 (list python-defusedxml
485 python-jinja2
486 python-packaging
487 python-psutil
488 python-shtab))
489 (home-page "https://github.com/nicolargo/glances")
490 (synopsis "Cross-platform curses-based monitoring tool")
491 (description
492 "Glances is a curses-based monitoring tool for a wide variety of
493platforms. Glances uses the PsUtil library to get information from your
494system. It monitors CPU, load, memory, network bandwidth, disk I/O, disk use,
495and more.")
496 (license license:lgpl3+)))
497
498(define-public monit
499 (package
500 (name "monit")
501 (version "6.0.0")
502 (supported-systems
503 (filter (lambda (system)
504 (string-suffix? "-linux" system)) ;because of PAM
505 %supported-systems))
506 (source
507 (origin
508 (method git-fetch)
509 (uri (git-reference
510 (url "https://bitbucket.org/tildeslash/monit.git")
511 (commit (string-append "release-"
512 (string-join (string-split version #\.)
513 "-")))))
514 (file-name (git-file-name name version))
515 (sha256
516 (base32 "1lpai4lf4w6cz3g10ysspmnp7v3f9x8ilfwig4cxdgc514ybd79f"))))
517 (build-system gnu-build-system)
518 (arguments
519 (list
520 #:configure-flags
521 #~(list (string-append "--with-ssl-dir="
522 #$(this-package-input "openssl")))
523 #:phases
524 #~(modify-phases %standard-phases
525 (add-after 'unpack 'patch-tests
526 (lambda* (#:key inputs #:allow-other-keys)
527 (substitute* "libmonit/test/CommandTest.c"
528 (("/bin/sh")
529 (search-input-file inputs "bin/sh"))
530 (("/bin/ls")
531 (search-input-file inputs "bin/ls")))))
532 (add-before 'bootstrap 'patch-libmonit-bootstrap
533 (lambda _
534 (patch-shebang "libmonit/bootstrap")))
535 (replace 'check
536 (lambda* (#:key tests? #:allow-other-keys)
537 (when tests?
538 ;; TimeTest assumes local time is one hour ahead of UTC.
539 (setenv "TZ" "CET-1")
540 (with-directory-excursion "libmonit/test"
541 (invoke "./test.sh"))))))))
542 (native-inputs (list autoconf automake bison flex libtool perl))
543 (inputs (list libxcrypt linux-pam openssl zlib))
544 (home-page "https://mmonit.com/monit/")
545 (synopsis "Proactive monitoring")
546 (description
547 "Monit is a utility for managing and monitoring, processes, programs,
548files, directories and filesystems on a UNIX system.")
549 (license license:agpl3)))
550
551(define-public nagios
552 (package
553 (name "nagios")
554 (version "4.4.6")
555 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
556 (source (origin
557 (method url-fetch)
558 (uri (string-append
559 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
560 version "/nagios-" version ".tar.gz"))
561 (sha256
562 (base32
563 "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db"))
564 (modules '((guix build utils)))
565 (snippet
566 ;; Ensure reproducibility.
567 '(begin
568 (substitute* (find-files "cgi" "\\.c$")
569 (("__DATE__") "\"1970-01-01\"")
570 (("__TIME__") "\"00:00:00\""))
571 #t))))
572 (build-system gnu-build-system)
573 (native-inputs
574 (list unzip))
575 (inputs
576 `(("zlib" ,zlib)
577 ("libpng-apng" ,libpng)
578 ("gd" ,gd)
579 ("perl" ,perl)
580 ("mailutils" ,mailutils)))
581 (arguments
582 '(#:configure-flags (list "--sysconfdir=/etc"
583
584 ;; 'include/locations.h.in' defines file
585 ;; locations, and many things go directly under
586 ;; LOCALSTATEDIR, hence the extra '/nagios'.
587 "--localstatedir=/var/nagios"
588
589 (string-append
590 "--with-mail="
591 (assoc-ref %build-inputs "mailutils")
592 "/bin/mail"))
593 #:make-flags '("all")
594 #:phases (modify-phases %standard-phases
595 (add-before 'build 'do-not-chown-to-nagios
596 (lambda _
597 ;; Makefiles do 'install -o nagios -g nagios', which
598 ;; doesn't work for us.
599 (substitute* (find-files "." "^Makefile$")
600 (("-o nagios -g nagios")
601 ""))
602 #t))
603 (add-before 'build 'do-not-create-sysconfdir
604 (lambda _
605 ;; Don't try to create /var upon 'make install'.
606 (substitute* "Makefile"
607 (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
608 (string-append "# " all))
609 (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
610 (string-append "# " all))
611 (("chmod g\\+s.*" all)
612 (string-append "# " all)))
613 #t))
614 (add-before 'build 'set-html/php-directory
615 (lambda _
616 ;; Install HTML and PHP files under 'share/nagios/html'
617 ;; instead of just 'share/'.
618 (substitute* '("html/Makefile" "Makefile")
619 (("HTMLDIR=.*$")
620 "HTMLDIR = $(datarootdir)/nagios/html\n"))
621 #t)))
622 #:tests? #f)) ;no 'check' target or similar
623 (home-page "https://www.nagios.org/")
624 (synopsis "Host, service, and network monitoring program")
625 (description
626 "Nagios is a host, service, and network monitoring program written in C.
627CGI programs are included to allow you to view the current status, history,
628etc. via a Web interface. Features include:
629
630@itemize
631@item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
632@item Monitoring of host resources (processor load, disk usage, etc.).
633@item A plugin interface to allow for user-developed service monitoring
634 methods.
635@item Ability to define network host hierarchy using \"parent\" hosts,
636 allowing detection of and distinction between hosts that are down
637 and those that are unreachable.
638@item Notifications when problems occur and get resolved (via email,
639 pager, or user-defined method).
640@item Ability to define event handlers for proactive problem resolution.
641@item Automatic log file rotation/archiving.
642@item Optional web interface for viewing current network status,
643 notification and problem history, log file, etc.
644@end itemize\n")
645 (license license:gpl2)))
646
647(define-public zabbix-agentd
648 ;; Zabbix distributes source from 2 repositories:
649 ;; - Stable: <https://cdn.zabbix.com/zabbix/sources/stable/>.
650 ;; - Old Stable: <https://cdn.zabbix.com/zabbix/sources/oldstable/>.
651 ;;
652 ;; Official Git repository is <https://git.zabbix.com/scm/zbx/zabbix.git>.
653 (package
654 (name "zabbix-agentd")
655 (version "7.2.15")
656 (source
657 (origin
658 (method url-fetch)
659 (uri (string-append
660 "https://cdn.zabbix.com/zabbix/sources/oldstable/"
661 (version-major+minor version) "/zabbix-" version ".tar.gz"))
662 (sha256
663 (base32 "0p78f02lslpfsqrr38rs30dq6fylyzph2q3fbwc6l9f6p5ik00dp"))
664 (modules '((guix build utils)))
665 (snippet
666 '(substitute* '("src/zabbix_proxy/proxy.c"
667 "src/zabbix_server/server.c")
668 ;; 'fping' must be setuid, so look for it in the usual location.
669 (("/usr/sbin/fping6?")
670 "/run/privileged/bin/fping")))))
671 (build-system gnu-build-system)
672 (arguments
673 (list #:configure-flags
674 #~(list "--enable-agent"
675 "--enable-ipv6"
676 "--with-libpcre2"
677 "--with-gnutls"
678 (string-append "--with-gnutls="
679 (assoc-ref %build-inputs "gnutls")))))
680 (native-inputs
681 (list pkg-config))
682 (inputs
683 (list gnutls pcre2))
684 (home-page "https://www.zabbix.com/")
685 (synopsis "Distributed monitoring solution (client-side agent)")
686 (description "This package provides a distributed monitoring
687solution (client-side agent)")
688 (license license:agpl3)
689 (properties
690 '((release-monitoring-url . "https://www.zabbix.com/download_sources")
691 (upstream-name . "zabbix")))))
692
693(define-public zabbix-agent2
694 (package/inherit zabbix-agentd
695 (name "zabbix-agent2")
696 (source
697 (origin
698 (inherit (package-source zabbix-agentd))
699 (patches (search-patches "zabbix-agent2-test-timezone-fix.patch"))))
700 (arguments
701 (list #:configure-flags
702 #~(list "--disable-agent"
703 "--enable-agent2"
704 "--enable-ipv6"
705 "--with-libpcre2"
706 ;; agent2 only supports OpenSSL.
707 (string-append "--with-openssl="
708 (dirname (dirname
709 (search-input-file
710 %build-inputs "lib/libssl.so")))))
711 #:make-flags
712 #~'("BUILD_TIME=00:00:01" "BUILD_DATE=Jan 1 1970")
713 #:phases
714 #~(modify-phases %standard-phases
715 (add-before 'build 'set-HOME
716 (lambda _
717 (setenv "HOME" "/tmp"))))))
718 (native-inputs
719 (list go pkg-config))
720 (inputs
721 (list openssl pcre2 zlib))))
722
723(define-public zabbix-server
724 (package
725 (inherit zabbix-agentd)
726 (name "zabbix-server")
727 (outputs '("out" "front-end" "schema"))
728 (arguments
729 (substitute-keyword-arguments arguments
730 ((#:phases phases '%standard-phases)
731 #~(modify-phases #$phases
732 (add-after 'install 'install-front-end
733 (lambda* (#:key outputs #:allow-other-keys)
734 (let* ((php (string-append (assoc-ref outputs "front-end")
735 "/share/zabbix/php"))
736 (front-end-conf (string-append php "/conf"))
737 (etc (string-append php "/etc")))
738 (mkdir-p php)
739 (copy-recursively "ui" php)
740 ;; Make front-end read config from ‘/etc/zabbix’ directory.
741 (rename-file front-end-conf
742 (string-append front-end-conf "-example"))
743 (symlink "/etc/zabbix" front-end-conf))))
744 (add-after 'install 'install-schema
745 (lambda* (#:key outputs #:allow-other-keys)
746 (let ((database-directory
747 (string-append (assoc-ref outputs "schema")
748 "/database")))
749 (for-each delete-file
750 (find-files "database" "Makefile\\.in|\\.am$"))
751 (mkdir-p database-directory)
752 (copy-recursively "database" database-directory))))))
753 ((#:configure-flags flags ''())
754 #~(append (list "--enable-server"
755 "--with-postgresql"
756 (string-append "--with-libevent="
757 (assoc-ref %build-inputs "libevent"))
758 "--with-net-snmp"
759 "--with-libcurl"
760 (string-append "--with-zlib="
761 (assoc-ref %build-inputs "zlib")))
762 (delete "--enable-agent" #$flags)))))
763 (inputs
764 (modify-inputs inputs
765 (prepend curl
766 libevent
767 net-snmp
768 postgresql
769 zlib)))
770 (synopsis "Distributed monitoring solution (server-side)")
771 (description "This package provides a distributed monitoring
772solution (server-side)")))
773
774(define-public zabbix-cli
775 (package
776 (name "zabbix-cli")
777 (version "2.3.1")
778 (source (origin
779 (method git-fetch)
780 (uri (git-reference
781 (url "https://github.com/unioslo/zabbix-cli")
782 (commit version)))
783 (file-name (git-file-name name version))
784 (sha256
785 (base32
786 "1al3gwbnh0wbal5gq2apq27kh61q8dz355k4w8kx073b4y4nz1wb"))))
787 (build-system pyproject-build-system)
788 (arguments
789 (list #:phases
790 #~(modify-phases %standard-phases
791 (add-after 'unpack 'use-absolute-ncurses
792 (lambda* (#:key inputs #:allow-other-keys)
793 (let ((clear (search-input-file inputs "bin/clear")))
794 (substitute* "bin/zabbix-cli"
795 (("'clear'")
796 (string-append "'" clear "'"))))))
797 (add-after 'unpack 'patch-setup.py
798 (lambda _
799 ;; Install data_files to $out/share instead of /usr/share.
800 (substitute* "setup.py"
801 (("/usr/") ""))))
802 (add-after 'build 'build-docs
803 (lambda _
804 (invoke "make" "-C" "docs" "manual")
805 (invoke "make" "-C" "docs" "singlehtml")))
806 (add-after 'install 'install-docs
807 (lambda _
808 (install-file "docs/_build/man/zabbix-cli.1"
809 (string-append #$output "/share/man/man1"))
810 (copy-recursively "docs/_build/singlehtml"
811 (string-append #$output "/share/doc/"
812 #$name "/html")))))))
813 (native-inputs
814 (list python-pytest
815 python-setuptools
816 python-sphinx
817 python-wheel))
818 (inputs
819 (list ncurses python-requests))
820 (home-page "https://github.com/unioslo/zabbix-cli")
821 (synopsis "Command-line interface to Zabbix")
822 (description
823 "@command{zabbix-cli} is a command-line client for the Zabbix
824monitoring system. It can configure and display various aspects of Zabbix
825through a text-based interface.")
826 (license license:gpl3+)))
827
828(define-public darkstat
829 (package
830 (name "darkstat")
831 (version "3.0.719")
832 (source (origin
833 (method url-fetch)
834 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
835 version ".tar.bz2"))
836 (sha256
837 (base32
838 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
839 (build-system gnu-build-system)
840 (arguments '(#:tests? #f)) ; no tests
841 (inputs
842 (list libpcap zlib))
843 (home-page "https://unix4lyfe.org/darkstat/")
844 (synopsis "Network statistics gatherer")
845 (description
846 "@command{darkstat} is a packet sniffer that runs as a background process,
847gathers all sorts of statistics about network usage, and serves them over
848HTTP. Features:
849
850@itemize
851@item Traffic graphs, reports per host, shows ports for each host.
852@item Embedded web-server with deflate compression.
853@item Asynchronous reverse DNS resolution using a child process.
854@item Small. Portable. Single-threaded. Efficient.
855@item Supports IPv6.
856@end itemize")
857 (license license:gpl2)))
858
859(define-public dgop
860 (package
861 (name "dgop")
862 (version "0.1.11")
863 (source
864 (origin
865 (method git-fetch)
866 (uri (git-reference
867 (url "https://github.com/AvengeMedia/dgop")
868 (commit (string-append "v" version))))
869 (sha256
870 (base32 "1iy9ndvrp7l1hr5ya2xf80j8ywcg8098z8wj2r47wdsqpagx2722"))
871 (file-name (git-file-name name version))))
872 (build-system go-build-system)
873 (arguments
874 (list
875 #:install-source? #f
876 #:import-path "github.com/AvengeMedia/dgop/cmd/cli"
877 #:unpack-path "github.com/AvengeMedia/dgop"
878 #:test-subdirs
879 #~(list "../../...") ;test the whole library
880 #:phases
881 #~(modify-phases %standard-phases
882 (add-after 'install 'rename-cli
883 (lambda* (#:key output #:allow-other-keys)
884 (let* ((bin (string-append #$output "/bin")))
885 (rename-file (string-append bin "/cli")
886 (string-append bin "/dgop"))))))))
887 (native-inputs
888 (list go-github-com-caarlos0-env-v11
889 go-github-com-charmbracelet-bubbles
890 go-github-com-charmbracelet-lipgloss
891 go-github-com-charmbracelet-log
892 go-github-com-danielgtaylor-huma-v2
893 go-github-com-fsnotify-fsnotify
894 go-github-com-go-chi-chi-v5
895 go-github-com-gorilla-schema
896 go-github-com-shirou-gopsutil-v4
897 go-github-com-spf13-cobra
898 go-github-com-stretchr-testify))
899 (home-page "https://github.com/AvengeMedia/dgop")
900 (synopsis "Stateless system monitoring CLI + REST API")
901 (description
902 "dgop is a system monitoring tool. It supports cursor-based sampling of
903CPU/memory/disk/network, plus an optional REST API server. It supports
904cursor-based sampling for building real-time monitoring tools like
905@command{htop}. Instead of relying on instantaneous snapshots, it may track
906system state changes over time for more accurate CPU usage calculations and
907network/disk rates.")
908 (license license:expat)))
909
910(define-public python-whisper
911 (package
912 (name "python-whisper")
913 (version "1.1.10")
914 (source
915 (origin
916 (method git-fetch)
917 (uri (git-reference
918 (url "https://github.com/graphite-project/whisper")
919 (commit version)))
920 (file-name (git-file-name name version))
921 (sha256
922 (base32
923 "182phj3z3mxpbla6m2f0pahyvqfn0jdblprvk6xwx39nc939nw0a"))))
924 (build-system pyproject-build-system)
925 (arguments
926 (list
927 #:phases
928 #~(modify-phases %standard-phases
929 (add-after 'unpack 'remove-python-six-dependency
930 (lambda _
931 (substitute* (find-files "." "\\.py$")
932 (("'six'") "") ; dependency in setup.py
933 (("six\\.moves") "io")
934 (("from six import assertRegex") "")
935 (("assertRegex") ""))))))) ; effectively disable test
936 (native-inputs (list python-pytest python-setuptools))
937 (home-page "https://graphiteapp.org/")
938 (synopsis "Fixed size round-robin style database for Graphite")
939 (description "Whisper is one of three components within the Graphite
940project. Whisper is a fixed-size database, similar in design and purpose to
941RRD (round-robin-database). It provides fast, reliable storage of numeric
942data over time. Whisper allows for higher resolution (seconds per point) of
943recent data to degrade into lower resolutions for long-term retention of
944historical data.")
945 (license license:asl2.0)))
946
947(define-public python-carbon
948 ;; 1.1.10 (2022-05-22), the latest changes provide support for Python 3.12+;
949 ;; move back to git tag when released.
950 (let ((commit "697bc3b0060ab245225dc5b90a0f4966b4ec7eef")
951 (revision "0"))
952 (package
953 (name "python-carbon")
954 (version (git-version "1.1.10" revision commit))
955 (source
956 (origin
957 (method git-fetch)
958 (uri (git-reference
959 (url "https://github.com/graphite-project/carbon")
960 (commit commit)))
961 (file-name (git-file-name name version))
962 (sha256
963 (base32 "1i5ydnzv53b1pigrqqi9nhivxjmlnswg9pd7vznvg34d7281gx19"))))
964 (build-system pyproject-build-system)
965 (arguments
966 (list
967 #:test-flags
968 #~(list
969 ;; XXX: cannot import name 'WhisperDatabase' from 'carbon.database'
970 "--ignore=lib/carbon/tests/test_database.py"
971 "--ignore=lib/carbon/tests/test_storage.py"
972 "-k" (string-join
973 (list "not testBasic" ; requires murmurhash3.
974 ;; XXX: python-mock incompatibility.
975 "test_decode_pickle"
976 "test_invalid_pickle"
977 "test_invalid_types")
978 " and not "))
979 #:phases
980 #~(modify-phases %standard-phases
981 ;; Don't install to /opt
982 (add-after 'unpack 'do-not-install-to-/opt
983 (lambda _
984 (setenv "GRAPHITE_NO_PREFIX" "1"))))))
985 (native-inputs
986 (list python-mock python-protobuf python-pytest python-setuptools))
987 (propagated-inputs
988 (list python-cachetools python-twisted python-txamqp python-urllib3))
989 (home-page "https://graphiteapp.org/")
990 (synopsis "Backend data caching and persistence daemon for Graphite")
991 (description
992 "Carbon is a backend data caching and persistence daemon for Graphite.
993Carbon is responsible for receiving metrics over the network, caching them in
994memory for \"hot queries\" from the Graphite-Web application, and persisting
995them to disk using the Whisper time-series library.")
996 (license license:asl2.0))))
997
998(define-public python-prometheus-client
999 (package
1000 (name "python-prometheus-client")
1001 (version "0.22.1")
1002 (source
1003 (origin
1004 (method url-fetch)
1005 (uri (pypi-uri "prometheus_client" version))
1006 (sha256
1007 (base32 "0a0ds9svcfcc8bspikyfz9w46k8a9qsmk9dwc3mj3kw3wwqi63qr"))))
1008 (build-system pyproject-build-system)
1009 (arguments
1010 (list
1011 #:test-flags
1012 #~(list "-k" (string-join
1013 ;; FileNotFoundError: [Errno 2] No such file or directory
1014 (list "not test_push_with_tls_auth_handler"
1015 ;; AssertionError: 17.21 != None
1016 "test_namespace"
1017 ;; AssertionError: 17.21 != None
1018 "test_working"
1019 ;; AssertionError: 0.0 != None
1020 "test_working_584")
1021 " and not "))))
1022 (native-inputs
1023 (list python-pytest
1024 python-setuptools))
1025 (home-page "https://github.com/prometheus/client_python")
1026 (synopsis "Python client for the Prometheus monitoring system")
1027 (description
1028 "The @code{prometheus_client} package supports exposing metrics from
1029software written in Python, so that they can be scraped by a Prometheus
1030service.
1031
1032Metrics can be exposed through a standalone web server, or through Twisted,
1033WSGI and the node exporter textfile collector.")
1034 (license license:asl2.0)))
1035
1036(define-public prometheus-node-exporter
1037 (package
1038 (name "prometheus-node-exporter")
1039 (version "1.10.2")
1040 (source
1041 (origin
1042 (method git-fetch)
1043 (uri (git-reference
1044 (url "https://github.com/prometheus/node_exporter")
1045 (commit (string-append "v" version))))
1046 (file-name (git-file-name name version))
1047 (sha256
1048 (base32 "10dqb97bv7v2xc31qjr7g8k7v0r1wq75xk846zbjgglw35nrpb2i"))))
1049 (build-system go-build-system)
1050 (arguments
1051 (list
1052 #:install-source? #f
1053 #:build-flags
1054 #~(list (string-append
1055 "-ldflags="
1056 "-X github.com/prometheus/common/version.Version=" #$version
1057 " -X github.com/prometheus/common/version.Revision=0"
1058 " -X github.com/prometheus/common/version.Branch=master"
1059 " -X github.com/prometheus/common/version.BuildUser=guix"
1060 " -X github.com/prometheus/common/version.BuildDate=n/a"))
1061 #:embed-files #~(list "landing_page.css" "landing_page.html")
1062 #:import-path "github.com/prometheus/node_exporter"
1063 #:phases
1064 #~(modify-phases %standard-phases
1065 (add-before 'check 'pre-check
1066 (lambda* (#:key tests? import-path #:allow-other-keys)
1067 (with-directory-excursion (string-append "src/" import-path)
1068 (invoke "./ttar" "-C" "collector/fixtures"
1069 "-x" "-f" "collector/fixtures/sys.ttar")
1070 (invoke "./ttar" "-C" "collector/fixtures"
1071 "-x" "-f" "collector/fixtures/udev.ttar"))))
1072 (add-after 'check 'post-check
1073 (lambda* (#:key tests? import-path #:allow-other-keys)
1074 (with-directory-excursion (string-append "src/" import-path)
1075 (for-each delete-file-recursively
1076 (list "collector/fixtures/sys"
1077 "collector/fixtures/sys.ttar"
1078 "collector/fixtures/udev"
1079 "collector/fixtures/udev.ttar"))))))))
1080 (propagated-inputs
1081 (list go-github-com-alecthomas-kingpin-v2
1082 go-github-com-beevik-ntp
1083 go-github-com-coreos-go-systemd-v22
1084 go-github-com-dennwc-btrfs
1085 go-github-com-ema-qdisc
1086 go-github-com-go-kit-log
1087 go-github-com-godbus-dbus-v5
1088 go-github-com-hashicorp-go-envparse
1089 go-github-com-hodgesds-perf-utils
1090 go-github-com-josharian-native
1091 go-github-com-jsimonetti-rtnetlink
1092 go-github-com-mattn-go-xmlrpc
1093 go-github-com-mdlayher-ethtool
1094 go-github-com-mdlayher-netlink
1095 go-github-com-mdlayher-wifi
1096 go-github-com-jsimonetti-rtnetlink-v2
1097 go-github-com-opencontainers-selinux
1098 go-github-com-prometheus-client-golang
1099 go-github-com-prometheus-client-model
1100 go-github-com-prometheus-common
1101 go-github-com-prometheus-community-go-runit
1102 go-github-com-prometheus-exporter-toolkit
1103 go-github-com-prometheus-procfs
1104 go-github-com-safchain-ethtool
1105 go-golang-org-x-exp
1106 go-golang-org-x-sys
1107 go-howett-net-plist))
1108 (home-page "https://github.com/prometheus/node_exporter")
1109 (synopsis "Prometheus exporter for hardware and OS metrics")
1110 (description
1111 "Prometheus exporter for metrics exposed by *NIX kernels,
1112written in Go with pluggable metric collectors.")
1113 (license license:asl2.0)))
1114
1115(define-public prometheus-postfix-exporter
1116 (package
1117 (name "prometheus-postfix-exporter")
1118 (version "0.20.0")
1119 (source
1120 (origin
1121 (method git-fetch)
1122 (uri (git-reference
1123 ;; It's a fork, original project is unmaintained since 2020, see
1124 ;; <https://github.com/kumina/postfix_exporter/issues/122>.
1125 (url "https://github.com/Hsn723/postfix_exporter")
1126 (commit (string-append "v" version))))
1127 (file-name (git-file-name name version))
1128 (sha256
1129 (base32 "09p76wxkl07ad4mrbbf863zmjk506lssjqplqacxqhcbfjb3lvxm"))))
1130 (build-system go-build-system)
1131 (arguments
1132 (list
1133 #:install-source? #f
1134 #:import-path "github.com/hsn723/postfix_exporter"
1135 #:build-flags #~(list "-tags" "nosystemd,nodocker")
1136 #:embed-files #~(list "landing_page.css" "landing_page.html")
1137 #:test-flags #~(list "-tags" "nosystemd,nodocker")))
1138 (native-inputs
1139 (list go-github-com-alecthomas-kingpin-v2
1140 go-github-com-coreos-go-systemd-v22
1141 go-github-com-docker-docker
1142 go-github-com-nxadm-tail
1143 go-github-com-prometheus-client-golang
1144 go-github-com-prometheus-client-model
1145 go-github-com-prometheus-common
1146 go-github-com-prometheus-exporter-toolkit
1147 go-github-com-stretchr-testify
1148 go-gopkg-in-tomb-v1
1149 go-k8s-io-api
1150 go-k8s-io-apimachinery
1151 go-k8s-io-client-go
1152 go-k8s-io-utils))
1153 (home-page "https://github.com/hsn723/postfix_exporter")
1154 (synopsis "Prometheus Postfix exporter")
1155 (description
1156 "Prometheus metrics exporter for @url{http://www.postfix.org/, the
1157Postfix mail server}. This exporter provides histogram metrics for the size
1158and age of messages stored in the mail queue. It extracts these metrics from
1159Postfix by connecting to a UNIX socket under @code{/var/spool}. It also
1160counts events by parsing Postfix's log entries, using regular expression
1161matching. The log entries are retrieved from the systemd journal, the Docker
1162logs, or from a log file. This package is built from a maintained fork of
1163original @url{https://github.com/kumina/postfix_exporter} project.")
1164 (license license:asl2.0)))
1165
1166(define-public prometheus-postgres-exporter
1167 (package
1168 (name "prometheus-postgres-exporter")
1169 (version "0.19.1")
1170 (source
1171 (origin
1172 (method git-fetch)
1173 (uri (git-reference
1174 (url "https://github.com/prometheus-community/postgres_exporter")
1175 (commit (string-append "v" version))))
1176 (file-name (git-file-name name version))
1177 (sha256
1178 (base32 "10vjg5y5ycf921hn4sb8a0a5aibk09rwsp51ksix0cglhqnia5b7"))))
1179 (build-system go-build-system)
1180 (arguments
1181 (list
1182 #:install-source? #f
1183 #:import-path "github.com/prometheus-community/postgres_exporter/cmd/postgres_exporter"
1184 #:unpack-path "github.com/prometheus-community/postgres_exporter"
1185 #:build-flags
1186 #~(list (string-append
1187 "-ldflags="
1188 "-X github.com/prometheus/common/version.Version=" #$version
1189 " -X github.com/prometheus/common/version.Revision=0"
1190 " -X github.com/prometheus/common/version.Branch=master"
1191 " -X github.com/prometheus/common/version.BuildUser=guix"
1192 " -X github.com/prometheus/common/version.BuildDate=n/a"))
1193 #:embed-files #~(list "landing_page.css" "landing_page.html")
1194 ;; Step away from cmd/postgres_exporte to test the whole project.
1195 #:test-subdirs #~(list "../../...")))
1196 (native-inputs
1197 (list go-github-com-alecthomas-kingpin-v2
1198 go-github-com-blang-semver-v4
1199 go-github-com-data-dog-go-sqlmock
1200 go-github-com-lib-pq
1201 go-github-com-prometheus-client-golang
1202 go-github-com-prometheus-client-model
1203 go-github-com-prometheus-common
1204 go-github-com-prometheus-exporter-toolkit
1205 go-github-com-smartystreets-goconvey
1206 go-gopkg-in-check-v1
1207 go-gopkg-in-yaml-v2
1208 go-gopkg-in-yaml-v3))
1209 (home-page "https://github.com/prometheus-community/postgres_exporter")
1210 (synopsis "PostgreSQL Server Exporter")
1211 (description "This package provides a Prometheus exporter for
1212@code{PostgreSQL} server metrics.")
1213 (license license:asl2.0)))
1214
1215(define-public temper-exporter
1216 ;; XXX: No release or updates since 2020, consider to remove when starts
1217 ;; failing, it might be abandoned project.
1218 (let ((commit "a87bbab19c05609d62d9e4c7941178700c1ef84d")
1219 (revision "0"))
1220 (package
1221 (name "temper-exporter")
1222 (version (git-version "0" revision commit))
1223 (source (origin
1224 (method git-fetch)
1225 (uri (git-reference
1226 (url "https://github.com/yrro/temper-exporter")
1227 (commit commit)))
1228 (file-name (git-file-name name version))
1229 (sha256
1230 (base32
1231 "0jk3ydi8s14q5kyl9j3gm2zrnwlb1jwjqpg5vqrgkbm9jrldrabc"))))
1232 (build-system pyproject-build-system)
1233 (arguments
1234 (list
1235 ;; XXX: pretty-printing AssertionError
1236 #:test-flags #~(list "-k" "not test_collection")
1237 #:phases
1238 #~(modify-phases %standard-phases
1239 (add-after 'unpack 'patch-setup.py
1240 (lambda _
1241 (substitute* "setup.py"
1242 (("git_ref = .*\n")
1243 "git_ref = ''\n"))))
1244 (add-after 'install 'install-udev-rules
1245 (lambda _
1246 (install-file "debian/prometheus-temper-exporter.udev"
1247 (string-append #$output
1248 "/lib/udev/rules.d")))))))
1249 (inputs (list python-prometheus-client python-pyudev))
1250 (native-inputs (list python-pytest python-pytest-mock python-setuptools))
1251 (home-page "https://github.com/yrro/temper-exporter")
1252 (synopsis "Prometheus exporter for PCSensor TEMPer sensor devices")
1253 (description
1254 "This package contains a Prometheus exporter for the TEMPer sensor
1255devices.")
1256 (license license:expat))))
1257
1258(define-public fswatch
1259 (package
1260 (name "fswatch")
1261 (version "1.22.0")
1262 (source (origin
1263 (method git-fetch)
1264 (uri (git-reference
1265 (url "https://github.com/emcrisostomo/fswatch")
1266 (commit version)))
1267 (file-name (git-file-name name version))
1268 (sha256
1269 (base32
1270 "0sxq5b5jd2skyclai854k9ksaa0c4476zqckvcwns8kdpzq4mxlc"))))
1271 (build-system gnu-build-system)
1272 (native-inputs
1273 (list autoconf automake gettext-minimal libtool))
1274 (arguments
1275 (list #:configure-flags
1276 #~(list "--disable-static")))
1277 (synopsis "File system monitor")
1278 (description "This package provides a file system monitor.")
1279 (home-page "https://github.com/emcrisostomo/fswatch")
1280 (license license:gpl3+)))
1281
1282(define-public collectd
1283 (package
1284 (name "collectd")
1285 (version "5.12.0")
1286 (source (origin
1287 (method url-fetch)
1288 (uri (string-append
1289 "https://storage.googleapis.com/collectd-tarballs/collectd-"
1290 version
1291 ".tar.bz2"))
1292 (sha256
1293 (base32
1294 "1mh97afgq6qgmpvpr84zngh58m0sl1b4wimqgvvk376188q09bjv"))
1295 (patches (search-patches "collectd-5.11.0-noinstallvar.patch"
1296 "collectd-5.11.0-python-3.11.patch"))))
1297 (build-system gnu-build-system)
1298 (arguments
1299 `(#:configure-flags
1300 (list
1301 "--enable-python"
1302 "--enable-sensors"
1303 "--enable-smart"
1304 "--localstatedir=/var"
1305 "--sysconfdir=/etc"
1306 "CFLAGS=-Wno-error=deprecated-declarations")
1307 #:phases (modify-phases %standard-phases
1308 (add-before 'configure 'autoreconf
1309 (lambda _
1310 ;; Required because of patched sources.
1311 (invoke "autoreconf" "-vfi"))))))
1312 (inputs
1313 (list
1314 curl
1315 rrdtool
1316 yajl
1317 zlib))
1318 (native-inputs
1319 (list
1320 autoconf
1321 automake
1322 eudev
1323 libatasmart
1324 libtool
1325 `(,lm-sensors "lib")
1326 pkg-config
1327 python-3))
1328 (home-page "https://collectd.org/")
1329 (synopsis "Collect system and application performance metrics periodically")
1330 (description
1331 "collectd gathers metrics from various sources such as the operating system,
1332applications, log files and external devices, and stores this information or
1333makes it available over the network. Those statistics can be used to monitor
1334systems, find performance bottlenecks (i.e., performance analysis) and predict
1335future system load (i.e., capacity planning).")
1336 ;; license:expat for the daemon in src/daemon/ and some plugins,
1337 ;; license:gpl2 for other plugins
1338 (license (list license:expat license:gpl2))))
1339
1340(define-public hostscope
1341 (package
1342 (name "hostscope")
1343 (version "8.0")
1344 (source (origin
1345 (method url-fetch)
1346 (uri (string-append
1347 "http://www.maier-komor.de/hostscope/hostscope-V"
1348 version ".tgz"))
1349 (sha256
1350 (base32
1351 "0jw6yij8va0f292g4xkf9lp9sxkzfgv67ajw49g3vq42q47ld7cv"))))
1352 (build-system gnu-build-system)
1353 (inputs (list ncurses))
1354 (arguments '(#:tests? #f)) ;; No included tests.
1355 (home-page "https://www.maier-komor.de/hostscope.html")
1356 (properties `((release-monitoring-url . ,home-page)))
1357 (synopsis
1358 "System monitoring tool for multiple hosts")
1359 (description
1360 "HostScope displays key system metrics of Linux hosts, such as detailed
1361CPU load, speed and temperature, I/O rates of network interfaces, I/O rates of
1362disks, and user process summary information. All metrics are multicast on the
1363LAN, if wanted, and clients can switch between multiple hosts on the network.
1364Hostscope features a bridge to Influx DB. So Grafana can be used to visualize
1365the recorded data over time.")
1366 (license license:gpl3+)))
1367
1368(define-public fatrace
1369 (package
1370 (name "fatrace")
1371 (version "0.19.1")
1372 (source
1373 (origin
1374 (method git-fetch)
1375 (uri (git-reference
1376 (url "https://github.com/martinpitt/fatrace")
1377 (commit version)))
1378 (file-name (git-file-name name version))
1379 (sha256
1380 (base32
1381 "0lmr6bv6d2f1gnrsy34gaiamw6615m3y7gw21fkiv47hn0xydhlx"))))
1382 (build-system gnu-build-system)
1383 (arguments
1384 (list
1385 #:tests? #f ; Tests need superuser, and there are
1386 ; no makefile directive to run them
1387 #:phases
1388 #~(modify-phases %standard-phases
1389 (delete 'configure))
1390 #:make-flags
1391 #~(list (string-append "CC=" #$(cc-for-target))
1392 (string-append "PREFIX=" #$output))))
1393 (synopsis "File access events monitor")
1394 (description "This package provides a utility to report system wide file
1395access events from all running processes. Its main purpose is to find
1396processes which keep waking up the disk unnecessarily and thus prevent some
1397power saving.")
1398 (home-page "https://github.com/martinpitt/fatrace")
1399 (license license:gpl3+)))
1400
1401(define-public pw
1402 (package
1403 (name "pw")
1404 (version "2")
1405 (source
1406 (origin
1407 (method git-fetch)
1408 (uri (git-reference
1409 (url "https://www.kylheku.com/git/pw")
1410 (commit (string-append "pw-" version))))
1411 (file-name (git-file-name name version))
1412 (sha256
1413 (base32 "1xn3qnzz48xan78cp83hfrcifrxx9lgnm14134qhyr5wvj7dk246"))))
1414 (build-system gnu-build-system)
1415 (arguments
1416 (list #:tests? #f ; There are no tests
1417 #:make-flags
1418 #~(list (string-append "CC=" #$(cc-for-target))
1419 (string-append "DESTDIR=" #$output))
1420 #:phases
1421 #~(modify-phases %standard-phases
1422 (add-after 'unpack 'fix-makefile
1423 (lambda _
1424 (substitute* "Makefile"
1425 (("/share/man/man1 \\\\") "/share/man/man1; \\"))))
1426 (delete 'configure)
1427 (add-before 'install 'make-install-dirs
1428 (lambda _
1429 (mkdir-p (string-append #$output "/bin"))
1430 (mkdir-p (string-append #$output "/share/man/man1"))
1431 (mkdir-p (string-append #$output "/share/man/man5")))))))
1432 (home-page "https://www.kylheku.com/cgit/pw/")
1433 (synopsis "Monitor recent lines of output from pipe")
1434 (description
1435 "@command{pw} is Pipe Watch, a utility that continuously reads lines of
1436text from a pipe or pipe-like source, passes them through a FIFO buffer, and
1437maintains a display based on the occasional sampling of the contents of the
1438FIFO buffer, with useful features such as triggering and filtering.
1439
1440With @command{pw} you can:
1441
1442@itemize
1443@item Interactively apply and remove filters on-the-fly, without interrupting
1444the source.
1445
1446@item Make recurring patterns in the stream appear to ``freeze'' on the
1447screen, using triggers.
1448
1449@item Prevent the overwhelming amount of output from a program from flooding
1450the terminal, while consuming all of that output so that the program isn't
1451blocked. @command{pw} can pause its display updates entirely.
1452
1453@item Juggle multiple shell background jobs that produce output, yet execute
1454indefinitely without blocking. When @command{pw} runs as part of a shell
1455background job, it continues to consume input, process filters and take
1456snapshots, without displaying anything. When put into the foreground again,
1457display resumes.
1458@end itemize")
1459 (license license:bsd-2)))
1460
1461(define-public python-statsd
1462 (package
1463 (name "python-statsd")
1464 (version "4.0.1")
1465 (source
1466 (origin
1467 (method url-fetch)
1468 (uri (pypi-uri "statsd" version))
1469 (sha256
1470 (base32 "0a6ilx68lxbynfm1slpaa87qs6mhrjm12bfjngvdma7y3fl3sxlr"))))
1471 (build-system pyproject-build-system)
1472 (arguments
1473 (list
1474 #:test-flags #~(list "statsd/tests.py")))
1475 (native-inputs
1476 (list python-pytest
1477 python-setuptools
1478 python-wheel))
1479 (home-page "https://github.com/jsocol/pystatsd")
1480 (synopsis "Simple StatsD client")
1481 (description "StatsD is a friendly front-end to Graphite. This package
1482provides a simple Python client for the StatsD daemon.")
1483 (license license:expat)))
1484
1485(define-public batsignal
1486 (package
1487 (name "batsignal")
1488 (version "1.8.0")
1489 (source (origin
1490 (method git-fetch)
1491 (uri (git-reference
1492 (url "https://github.com/electrickite/batsignal")
1493 (commit version)))
1494 (file-name (git-file-name name version))
1495 (sha256
1496 (base32
1497 "0l6j873l1l0al95zl9ihxzrmy9r11pfm269gydlx8pps4gdisy6a"))))
1498 (build-system gnu-build-system)
1499 (arguments
1500 (list #:make-flags
1501 #~(list (string-append "PREFIX=" #$output)
1502 (string-append "CC=" #$(cc-for-target)))
1503 #:phases
1504 #~(modify-phases %standard-phases
1505 (add-after 'unpack 'fix-cross-compile
1506 (lambda _
1507 (substitute* "Makefile"
1508 (("pkg-config")
1509 #$(pkg-config-for-target)))))
1510 (delete 'configure)
1511 (replace 'check
1512 (lambda* (#:key tests? #:allow-other-keys)
1513 (when tests?
1514 (invoke "./batsignal" "-v")))))))
1515 (inputs (list libnotify))
1516 (native-inputs (list pkg-config))
1517 (home-page "https://github.com/electrickite/batsignal")
1518 (synopsis "Power monitoring tool")
1519 (description
1520 "This package provides a daemon that monitors device power levels,
1521notifying the user and optionally running a command when it reaches
1522user-configured power thresholds. This can be used to force powering off a
1523laptop when the battery gets below critical levels, instead of damaging the
1524battery.")
1525 (license license:isc)))
1526
1527(define-public battop
1528 (package
1529 (name "battop")
1530 (version "0.2.4")
1531 (source
1532 (origin
1533 (method url-fetch)
1534 (uri (crate-uri "battop" version))
1535 (file-name (string-append name "-" version ".tar.gz"))
1536 (sha256
1537 (base32 "1f5d3y9f179aljp94bl3al45g6n2bfnhw5mdmffm2rr6hraa31kn"))))
1538 (build-system cargo-build-system)
1539 (inputs (cargo-inputs 'battop))
1540 (home-page "https://github.com/svartalf/rust-battop")
1541 (synopsis "Interactive battery viewer")
1542 (description "@command{battop} is an interactive viewer, similar to
1543@command{top}, @command{htop} and other *top utilities, but showing the
1544(potentially multiple) batteries installed in a notebook.")
1545 (license (list license:asl2.0 license:expat))))