monitoring.scm 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  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 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. ;;;
  14. ;;; This file is part of GNU Guix.
  15. ;;;
  16. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  17. ;;; under the terms of the GNU General Public License as published by
  18. ;;; the Free Software Foundation; either version 3 of the License, or (at
  19. ;;; your option) any later version.
  20. ;;;
  21. ;;; GNU Guix is distributed in the hope that it will be useful, but
  22. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  23. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. ;;; GNU General Public License for more details.
  25. ;;;
  26. ;;; You should have received a copy of the GNU General Public License
  27. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  28. (define-module (gnu packages monitoring)
  29. #:use-module (guix packages)
  30. #:use-module (guix download)
  31. #:use-module (guix git-download)
  32. #:use-module ((guix licenses) #:prefix license:)
  33. #:use-module (guix build-system perl)
  34. #:use-module (guix build-system python)
  35. #:use-module (guix build-system gnu)
  36. #:use-module (guix build-system go)
  37. #:use-module (guix utils)
  38. #:use-module (gnu packages)
  39. #:use-module (gnu packages admin)
  40. #:use-module (gnu packages autotools)
  41. #:use-module (gnu packages base)
  42. #:use-module (gnu packages curl)
  43. #:use-module (gnu packages check)
  44. #:use-module (gnu packages compression)
  45. #:use-module (gnu packages databases)
  46. #:use-module (gnu packages django)
  47. #:use-module (gnu packages gd)
  48. #:use-module (gnu packages gettext)
  49. #:use-module (gnu packages image)
  50. #:use-module (gnu packages mail)
  51. #:use-module (gnu packages ncurses)
  52. #:use-module (gnu packages networking)
  53. #:use-module (gnu packages libevent)
  54. #:use-module (gnu packages pcre)
  55. #:use-module (gnu packages perl)
  56. #:use-module (gnu packages pkg-config)
  57. #:use-module (gnu packages python)
  58. #:use-module (gnu packages python-web)
  59. #:use-module (gnu packages python-xyz)
  60. #:use-module (gnu packages rrdtool)
  61. #:use-module (gnu packages time)
  62. #:use-module (gnu packages tls)
  63. #:use-module (gnu packages web))
  64. (define-public nagios
  65. (package
  66. (name "nagios")
  67. (version "4.4.6")
  68. ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
  69. (source (origin
  70. (method url-fetch)
  71. (uri (string-append
  72. "mirror://sourceforge/nagios/nagios-4.x/nagios-"
  73. version "/nagios-" version ".tar.gz"))
  74. (sha256
  75. (base32
  76. "1x5hb97zbvkm73q53ydp1gwj8nnznm72q9c4rm6ny7phr995l3db"))
  77. (modules '((guix build utils)))
  78. (snippet
  79. ;; Ensure reproducibility.
  80. '(begin
  81. (substitute* (find-files "cgi" "\\.c$")
  82. (("__DATE__") "\"1970-01-01\"")
  83. (("__TIME__") "\"00:00:00\""))
  84. #t))))
  85. (build-system gnu-build-system)
  86. (native-inputs
  87. `(("unzip" ,unzip)))
  88. (inputs
  89. `(("zlib" ,zlib)
  90. ("libpng-apng" ,libpng)
  91. ("gd" ,gd)
  92. ("perl" ,perl)
  93. ("mailutils" ,mailutils)))
  94. (arguments
  95. '(#:configure-flags (list "--sysconfdir=/etc"
  96. ;; 'include/locations.h.in' defines file
  97. ;; locations, and many things go directly under
  98. ;; LOCALSTATEDIR, hence the extra '/nagios'.
  99. "--localstatedir=/var/nagios"
  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. @itemize
  141. @item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
  142. @item Monitoring of host resources (processor load, disk usage, etc.).
  143. @item A plugin interface to allow for user-developed service monitoring
  144. methods.
  145. @item Ability to define network host hierarchy using \"parent\" hosts,
  146. allowing detection of and distinction between hosts that are down
  147. and those that are unreachable.
  148. @item Notifications when problems occur and get resolved (via email,
  149. pager, or user-defined method).
  150. @item Ability to define event handlers for proactive problem resolution.
  151. @item Automatic log file rotation/archiving.
  152. @item Optional web interface for viewing current network status,
  153. notification and problem history, log file, etc.
  154. @end itemize\n")
  155. (license license:gpl2)))
  156. (define-public zabbix-agentd
  157. (package
  158. (name "zabbix-agentd")
  159. (version "5.2.6")
  160. (source
  161. (origin
  162. (method url-fetch)
  163. (uri (string-append
  164. "https://cdn.zabbix.com/zabbix/sources/stable/"
  165. (version-major+minor version) "/zabbix-" version ".tar.gz"))
  166. (sha256
  167. (base32 "100n1rv7r4pqagxxifzpcza5bhrr2fklzx7gndxwiyq4597p1jvn"))))
  168. (build-system gnu-build-system)
  169. (arguments
  170. `(#:configure-flags
  171. (list "--enable-agent"
  172. "--enable-ipv6"
  173. (string-append "--with-iconv="
  174. (assoc-ref %build-inputs "libiconv"))
  175. (string-append "--with-libpcre="
  176. (assoc-ref %build-inputs "pcre")))))
  177. (inputs
  178. `(("libiconv" ,libiconv)
  179. ("pcre" ,pcre)))
  180. (home-page "https://www.zabbix.com/")
  181. (synopsis "Distributed monitoring solution (client-side agent)")
  182. (description "This package provides a distributed monitoring
  183. solution (client-side agent)")
  184. (license license:gpl2)))
  185. (define-public zabbix-server
  186. (package
  187. (inherit zabbix-agentd)
  188. (name "zabbix-server")
  189. (outputs '("out" "front-end" "schema"))
  190. (arguments
  191. (substitute-keyword-arguments
  192. `(#:phases
  193. (modify-phases %standard-phases
  194. (add-after 'install 'install-front-end
  195. (lambda* (#:key outputs #:allow-other-keys)
  196. (let* ((php (string-append (assoc-ref outputs "front-end")
  197. "/share/zabbix/php"))
  198. (front-end-conf (string-append php "/conf"))
  199. (etc (string-append php "/etc")))
  200. (mkdir-p php)
  201. (copy-recursively "ui" php)
  202. ;; Make front-end write config to ‘/etc/zabbix’ directory.
  203. (rename-file front-end-conf
  204. (string-append front-end-conf "-example"))
  205. (symlink "/etc/zabbix" front-end-conf))
  206. #t))
  207. (add-after 'install 'install-schema
  208. (lambda* (#:key outputs #:allow-other-keys)
  209. (let ((database-directory
  210. (string-append (assoc-ref outputs "schema")
  211. "/database")))
  212. (for-each delete-file
  213. (find-files "database" "Makefile\\.in|\\.am$"))
  214. (mkdir-p database-directory)
  215. (copy-recursively "database" database-directory))
  216. #t)))
  217. ,@(package-arguments zabbix-agentd))
  218. ((#:configure-flags flags)
  219. `(cons* "--enable-server"
  220. "--with-postgresql"
  221. (string-append "--with-libevent="
  222. (assoc-ref %build-inputs "libevent"))
  223. "--with-net-snmp"
  224. (string-append "--with-gnutls="
  225. (assoc-ref %build-inputs "gnutls"))
  226. "--with-libcurl"
  227. (string-append "--with-zlib="
  228. (assoc-ref %build-inputs "zlib"))
  229. ,flags))))
  230. (inputs
  231. `(("curl" ,curl)
  232. ("libevent" ,libevent)
  233. ("gnutls" ,gnutls)
  234. ("postgresql" ,postgresql)
  235. ("zlib" ,zlib)
  236. ("net-snmp" ,net-snmp)
  237. ("curl" ,curl)
  238. ,@(package-inputs zabbix-agentd)))
  239. (synopsis "Distributed monitoring solution (server-side)")
  240. (description "This package provides a distributed monitoring
  241. solution (server-side)")))
  242. (define-public zabbix-cli
  243. (package
  244. (name "zabbix-cli")
  245. (version "2.2.1")
  246. (source (origin
  247. (method git-fetch)
  248. (uri (git-reference
  249. (url "https://github.com/unioslo/zabbix-cli")
  250. (commit version)))
  251. (file-name (git-file-name name version))
  252. (sha256
  253. (base32
  254. "0wzmrn8p09ksqhhgawr179c4az7p2liqr0l4q2dra62bxliawyqz"))))
  255. (build-system python-build-system)
  256. (arguments
  257. '(#:phases (modify-phases %standard-phases
  258. (add-after 'unpack 'use-absolute-ncurses
  259. (lambda _
  260. (substitute* "bin/zabbix-cli"
  261. (("'clear'")
  262. (string-append "'" (which "clear") "'")))))
  263. (add-after 'unpack 'patch-setup.py
  264. (lambda _
  265. ;; Install data_files to $out/share instead of /usr/share.
  266. (substitute* "setup.py"
  267. (("/usr/") "")))))))
  268. (inputs
  269. `(("clear" ,ncurses)
  270. ("python-requests" ,python-requests)))
  271. (home-page "https://github.com/unioslo/zabbix-cli")
  272. (synopsis "Command-line interface to Zabbix")
  273. (description
  274. "@command{zabbix-cli} is a command-line client for the Zabbix
  275. monitoring system. It can configure and display various aspects of Zabbix
  276. through a text-based interface.")
  277. (license license:gpl3+)))
  278. (define-public python-pyzabbix
  279. (package
  280. (name "python-pyzabbix")
  281. (version "0.8.2")
  282. (home-page "https://github.com/lukecyca/pyzabbix")
  283. ;; No tests on PyPI, use the git checkout.
  284. (source
  285. (origin
  286. (method git-fetch)
  287. (uri (git-reference (url home-page) (commit version)))
  288. (file-name (git-file-name name version))
  289. (sha256
  290. (base32
  291. "15rrnpkv94wx6748hh4sd120v6x25rkbd6vlz6hfrhvjwxz5lgjl"))))
  292. (build-system python-build-system)
  293. (arguments
  294. '(#:phases (modify-phases %standard-phases
  295. (add-after 'unpack 'patch
  296. (lambda _
  297. ;; Permit newer versions of httpretty.
  298. (substitute* "setup.py"
  299. (("httpretty<0\\.8\\.7")
  300. "httpretty"))))
  301. (replace 'check
  302. (lambda* (#:key tests? #:allow-other-keys)
  303. (if tests?
  304. (invoke "python" "setup.py" "nosetests")
  305. (format #t "test suite not run~")))))))
  306. (native-inputs
  307. `(;; For tests.
  308. ("python-httpretty" ,python-httpretty)
  309. ("python-nose" ,python-nose)))
  310. (propagated-inputs
  311. `(("python-requests" ,python-requests)))
  312. (synopsis "Python interface to the Zabbix API")
  313. (description
  314. "@code{pyzabbix} is a Python module for working with the Zabbix API.")
  315. (license license:lgpl2.1+)))
  316. (define-public darkstat
  317. (package
  318. (name "darkstat")
  319. (version "3.0.719")
  320. (source (origin
  321. (method url-fetch)
  322. (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
  323. version ".tar.bz2"))
  324. (sha256
  325. (base32
  326. "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
  327. (build-system gnu-build-system)
  328. (arguments '(#:tests? #f)) ; no tests
  329. (inputs
  330. `(("libpcap" ,libpcap)
  331. ("zlib" ,zlib)))
  332. (home-page "https://unix4lyfe.org/darkstat/")
  333. (synopsis "Network statistics gatherer")
  334. (description
  335. "@command{darkstat} is a packet sniffer that runs as a background process,
  336. gathers all sorts of statistics about network usage, and serves them over
  337. HTTP. Features:
  338. @itemize
  339. @item Traffic graphs, reports per host, shows ports for each host.
  340. @item Embedded web-server with deflate compression.
  341. @item Asynchronous reverse DNS resolution using a child process.
  342. @item Small. Portable. Single-threaded. Efficient.
  343. @item Supports IPv6.
  344. @end itemize")
  345. (license license:gpl2)))
  346. (define-public python-whisper
  347. (package
  348. (name "python-whisper")
  349. (version "1.0.2")
  350. (source
  351. (origin
  352. (method url-fetch)
  353. (uri (pypi-uri "whisper" version))
  354. (sha256
  355. (base32
  356. "1v1bi3fl1i6p4z4ki692bykrkw6907dn3mfq0151f70lvi3zpns3"))))
  357. (build-system python-build-system)
  358. (home-page "http://graphiteapp.org/")
  359. (synopsis "Fixed size round-robin style database for Graphite")
  360. (description "Whisper is one of three components within the Graphite
  361. project. Whisper is a fixed-size database, similar in design and purpose to
  362. RRD (round-robin-database). It provides fast, reliable storage of numeric
  363. data over time. Whisper allows for higher resolution (seconds per point) of
  364. recent data to degrade into lower resolutions for long-term retention of
  365. historical data.")
  366. (license license:asl2.0)))
  367. (define-public python2-whisper
  368. (package-with-python2 python-whisper))
  369. (define-public python2-carbon
  370. (package
  371. (name "python2-carbon")
  372. (version "1.0.2")
  373. (source
  374. (origin
  375. (method url-fetch)
  376. (uri (pypi-uri "carbon" version))
  377. (sha256
  378. (base32
  379. "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn"))))
  380. (build-system python-build-system)
  381. (arguments
  382. `(#:python ,python-2 ; only supports Python 2
  383. #:phases
  384. (modify-phases %standard-phases
  385. ;; Don't install to /opt
  386. (add-after 'unpack 'do-not-install-to-/opt
  387. (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
  388. (propagated-inputs
  389. `(("python2-whisper" ,python2-whisper)
  390. ("python2-configparser" ,python2-configparser)
  391. ("python2-txamqp" ,python2-txamqp)))
  392. (home-page "http://graphiteapp.org/")
  393. (synopsis "Backend data caching and persistence daemon for Graphite")
  394. (description "Carbon is a backend data caching and persistence daemon for
  395. Graphite. Carbon is responsible for receiving metrics over the network,
  396. caching them in memory for \"hot queries\" from the Graphite-Web application,
  397. and persisting them to disk using the Whisper time-series library.")
  398. (license license:asl2.0)))
  399. (define-public graphite-web
  400. (package
  401. (name "graphite-web")
  402. (version "1.1.7")
  403. (source
  404. (origin
  405. (method url-fetch)
  406. (uri (pypi-uri "graphite-web" version))
  407. (sha256
  408. (base32
  409. "1l5a5rry9cakqxamvlx4xq63jifmncb6815bg9vy7fg1zyd3pjxk"))))
  410. (build-system python-build-system)
  411. (arguments
  412. `(#:tests? #f ;XXX: not in PyPI release & requires database
  413. #:phases
  414. (modify-phases %standard-phases
  415. (add-after 'unpack 'relax-requirements
  416. (lambda _
  417. (substitute* "setup.py"
  418. ;; Allow newer versions of django-tagging.
  419. (("django-tagging==")
  420. "django-tagging>="))
  421. #t))
  422. ;; Don't install to /opt
  423. (add-after 'unpack 'do-not-install-to-/opt
  424. (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
  425. (propagated-inputs
  426. `(("python-cairocffi" ,python-cairocffi)
  427. ("python-pytz" ,python-pytz)
  428. ("python-whisper" ,python-whisper)
  429. ("python-django" ,python-django-2.2)
  430. ("python-django-tagging" ,python-django-tagging)
  431. ("python-scandir" ,python-scandir)
  432. ("python-urllib3" ,python-urllib3)
  433. ("python-pyparsing" ,python-pyparsing)
  434. ("python-txamqp" ,python-txamqp)))
  435. (home-page "https://graphiteapp.org/")
  436. (synopsis "Scalable realtime graphing system")
  437. (description "Graphite is a scalable real-time graphing system that does
  438. two things: store numeric time-series data, and render graphs of this data on
  439. demand.")
  440. (license license:asl2.0)))
  441. (define-public python2-graphite-web
  442. (deprecated-package "python2-graphite-web" graphite-web))
  443. (define-public python-prometheus-client
  444. (package
  445. (name "python-prometheus-client")
  446. (version "0.7.1")
  447. (source
  448. (origin
  449. (method url-fetch)
  450. (uri (pypi-uri "prometheus_client" version))
  451. (sha256
  452. (base32 "1ni2yv4ixwz32nz39ckia76lvggi7m19y5f702w5qczbnfi29kbi"))))
  453. (build-system python-build-system)
  454. (arguments
  455. '(;; No included tests.
  456. #:tests? #f))
  457. (propagated-inputs
  458. `(("python-twisted" ,python-twisted)))
  459. (home-page
  460. "https://github.com/prometheus/client_python")
  461. (synopsis "Python client for the Prometheus monitoring system")
  462. (description
  463. "The @code{prometheus_client} package supports exposing metrics from
  464. software written in Python, so that they can be scraped by a Prometheus
  465. service.
  466. Metrics can be exposed through a standalone web server, or through Twisted,
  467. WSGI and the node exporter textfile collector.")
  468. (license license:asl2.0)))
  469. (define-public python2-prometheus-client
  470. (package-with-python2 python-prometheus-client))
  471. (define-public go-github-com-prometheus-node-exporter
  472. (package
  473. (name "go-github-com-prometheus-node-exporter")
  474. (version "0.18.1")
  475. (source (origin
  476. (method git-fetch)
  477. (uri (git-reference
  478. (url "https://github.com/prometheus/node_exporter")
  479. (commit (string-append "v" version))))
  480. (file-name (git-file-name name version))
  481. (sha256
  482. (base32
  483. "0s3sp1gj86p7npxl38hkgs6ymd3wjjmc5hydyg1b5wh0x3yvpx07"))))
  484. (build-system go-build-system)
  485. (arguments
  486. '(#:import-path "github.com/prometheus/node_exporter"))
  487. (synopsis "Prometheus exporter for hardware and OS metrics")
  488. (description "Prometheus exporter for metrics exposed by *NIX kernels,
  489. written in Go with pluggable metric collectors.")
  490. (home-page "https://github.com/prometheus/node_exporter")
  491. (license license:asl2.0)))
  492. (define-public temper-exporter
  493. (let ((commit "a87bbab19c05609d62d9e4c7941178700c1ef84d")
  494. (revision "0"))
  495. (package
  496. (name "temper-exporter")
  497. (version (git-version "0" revision commit))
  498. (source (origin
  499. (method git-fetch)
  500. (uri (git-reference
  501. (url "https://github.com/yrro/temper-exporter")
  502. (commit commit)))
  503. (file-name (git-file-name name version))
  504. (sha256
  505. (base32
  506. "0jk3ydi8s14q5kyl9j3gm2zrnwlb1jwjqpg5vqrgkbm9jrldrabc"))))
  507. (build-system python-build-system)
  508. (arguments
  509. '(#:tests? #f ; One test failure:
  510. ; test/test_exporter.py:33:
  511. ; AssertionError
  512. #:phases
  513. (modify-phases %standard-phases
  514. (add-after 'unpack 'patch-setup.py
  515. (lambda _
  516. (substitute* "setup.py"
  517. (("git_ref = .*\n") "git_ref = ''\n"))
  518. #t))
  519. (add-after 'install 'install-udev-rules
  520. (lambda* (#:key outputs #:allow-other-keys)
  521. (install-file "debian/prometheus-temper-exporter.udev"
  522. (string-append (assoc-ref outputs "out")
  523. "/lib/udev/rules.d"))
  524. #t)))))
  525. (inputs
  526. `(("python-prometheus-client" ,python-prometheus-client)
  527. ("python-pyudev" ,python-pyudev)))
  528. (native-inputs
  529. `(("python-pytest" ,python-pytest)
  530. ("python-pytest-mock" ,python-pytest-mock)
  531. ("python-pytest-runner" ,python-pytest-runner)))
  532. (home-page "https://github.com/yrro/temper-exporter")
  533. (synopsis "Prometheus exporter for PCSensor TEMPer sensor devices")
  534. (description
  535. "This package contains a Prometheus exporter for the TEMPer sensor
  536. devices.")
  537. (license license:expat))))
  538. (define-public fswatch
  539. (package
  540. (name "fswatch")
  541. (version "1.15.0")
  542. (source (origin
  543. (method git-fetch)
  544. (uri (git-reference
  545. (url "https://github.com/emcrisostomo/fswatch")
  546. (commit version)))
  547. (file-name (git-file-name name version))
  548. (sha256
  549. (base32
  550. "1yz65jsbgdx4cmy16x24wz5di352lvyi7fp6jm90bhgl1vpzxlsx"))))
  551. (build-system gnu-build-system)
  552. (native-inputs
  553. `(("autoconf" ,autoconf)
  554. ("automake" ,automake)
  555. ("gettext" ,gettext-minimal)
  556. ("libtool" ,libtool)))
  557. (synopsis "File system monitor")
  558. (description "This package provides a file system monitor.")
  559. (home-page "https://github.com/emcrisostomo/fswatch")
  560. (license license:gpl3+)))
  561. (define-public collectd
  562. (package
  563. (name "collectd")
  564. (version "5.12.0")
  565. (source (origin
  566. (method url-fetch)
  567. (uri (string-append
  568. "https://storage.googleapis.com/collectd-tarballs/collectd-"
  569. version
  570. ".tar.bz2"))
  571. (sha256
  572. (base32
  573. "1mh97afgq6qgmpvpr84zngh58m0sl1b4wimqgvvk376188q09bjv"))
  574. (patches (search-patches "collectd-5.11.0-noinstallvar.patch"))))
  575. (build-system gnu-build-system)
  576. (arguments
  577. `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc")
  578. #:phases (modify-phases %standard-phases
  579. (add-before 'configure 'autoreconf
  580. (lambda _
  581. ;; Required because of patched sources.
  582. (invoke "autoreconf" "-vfi"))))))
  583. (inputs
  584. `(("rrdtool" ,rrdtool)
  585. ("curl" ,curl)
  586. ("libyajl" ,libyajl)))
  587. (native-inputs
  588. `(("autoconf" ,autoconf)
  589. ("automake" ,automake)
  590. ("libtool" ,libtool)
  591. ("pkg-config" ,pkg-config)))
  592. (home-page "https://collectd.org/")
  593. (synopsis "Collect system and application performance metrics periodically")
  594. (description
  595. "collectd gathers metrics from various sources such as the operating system,
  596. applications, log files and external devices, and stores this information or
  597. makes it available over the network. Those statistics can be used to monitor
  598. systems, find performance bottlenecks (i.e., performance analysis) and predict
  599. future system load (i.e., capacity planning).")
  600. ;; license:expat for the daemon in src/daemon/ and some plugins,
  601. ;; license:gpl2 for other plugins
  602. (license (list license:expat license:gpl2))))
  603. (define-public hostscope
  604. (package
  605. (name "hostscope")
  606. (version "8.0")
  607. (source (origin
  608. (method url-fetch)
  609. (uri (string-append
  610. "http://www.maier-komor.de/hostscope/hostscope-V"
  611. version ".tgz"))
  612. (sha256
  613. (base32
  614. "0jw6yij8va0f292g4xkf9lp9sxkzfgv67ajw49g3vq42q47ld7cv"))))
  615. (build-system gnu-build-system)
  616. (inputs `(("ncurses" ,ncurses)))
  617. (arguments '(#:tests? #f)) ;; No included tests.
  618. (home-page "http://www.maier-komor.de/hostscope.html")
  619. (properties `((release-monitoring-url . ,home-page)))
  620. (synopsis
  621. "System monitoring tool for multiple hosts")
  622. (description
  623. "HostScope displays key system metrics of Linux hosts, such as detailed
  624. CPU load, speed and temperature, I/O rates of network interfaces, I/O rates of
  625. disks, and user process summary information. All metrics are multicast on the
  626. LAN, if wanted, and clients can switch between multiple hosts on the network.
  627. Hostscope features a bridge to Influx DB. So Grafana can be used to visualize
  628. the recorded data over time.")
  629. (license license:gpl3+)))
  630. (define-public fatrace
  631. (package
  632. (name "fatrace")
  633. (version "0.16.3")
  634. (source (origin
  635. (method git-fetch)
  636. (uri (git-reference
  637. (url "https://github.com/martinpitt/fatrace")
  638. (commit version)))
  639. (file-name (git-file-name name version))
  640. (sha256
  641. (base32
  642. "1bxz6v1z0icp716jnv3knjyqp8bv6xnkz8gqd8z3g2b6yxj5xff3"))))
  643. (build-system gnu-build-system)
  644. (arguments
  645. `(#:phases
  646. (modify-phases %standard-phases
  647. (delete 'configure)
  648. ;; tests need root to run as root,
  649. ;; and there is no make target for them:
  650. (delete 'check))
  651. #:make-flags
  652. (list (string-append "CC=" ,(cc-for-target))
  653. (string-append "PREFIX=" %output))))
  654. (synopsis "File access events monitor")
  655. (description "This package provides a utility to report system wide file
  656. access events from all running processes. Its main purpose is to find
  657. processes which keep waking up the disk unnecessarily and thus prevent some
  658. power saving.")
  659. (home-page "https://github.com/martinpitt/fatrace")
  660. (license license:gpl3+)))