monitoring.scm 26 KB

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