1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
4 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages monitoring)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build-system perl)
27 #:use-module (guix build-system python)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages admin)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages django)
34 #:use-module (gnu packages gd)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages mail)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages python-web)
40 #:use-module (gnu packages time))
46 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
50 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
51 version "/nagios-" version ".tar.gz"))
54 "1wa4m952sb23dqi5w759adimsp21bkhp598rpq9dnhz3v497h2y9"))
55 (modules '((guix build utils)))
57 ;; Ensure reproducibility.
58 '(substitute* (find-files "cgi" "\\.c$")
59 (("__DATE__") "\"1970-01-01\"")
60 (("__TIME__") "\"00:00:00\"")))))
61 (build-system gnu-build-system)
66 ("libpng-apng" ,libpng)
69 ("mailutils" ,mailutils)))
71 '(#:configure-flags (list "--sysconfdir=/etc"
73 ;; 'include/locations.h.in' defines file
74 ;; locations, and many things go directly under
75 ;; LOCALSTATEDIR, hence the extra '/nagios'.
76 "--localstatedir=/var/nagios"
80 (assoc-ref %build-inputs "mailutils")
83 #:phases (modify-phases %standard-phases
84 (add-before 'build 'do-not-chown-to-nagios
86 ;; Makefiles do 'install -o nagios -g nagios', which
87 ;; doesn't work for us.
88 (substitute* (find-files "." "^Makefile$")
89 (("-o nagios -g nagios")
92 (add-before 'build 'do-not-create-sysconfdir
94 ;; Don't try to create /var upon 'make install'.
95 (substitute* "Makefile"
96 (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
97 (string-append "# " all))
98 (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
99 (string-append "# " all))
100 (("chmod g\\+s.*" all)
101 (string-append "# " all)))
103 (add-before 'build 'set-html/php-directory
105 ;; Install HTML and PHP files under 'share/nagios/html'
106 ;; instead of just 'share/'.
107 (substitute* '("html/Makefile" "Makefile")
109 "HTMLDIR = $(datarootdir)/nagios/html\n"))
111 #:tests? #f)) ;no 'check' target or similar
112 (home-page "https://www.nagios.org/")
113 (synopsis "Host, service, and network monitoring program")
115 "Nagios is a host, service, and network monitoring program written in C.
116 CGI programs are included to allow you to view the current status, history,
117 etc. via a Web interface. Features include:
120 @item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
121 @item Monitoring of host resources (processor load, disk usage, etc.).
122 @item A plugin interface to allow for user-developed service monitoring
124 @item Ability to define network host hierarchy using \"parent\" hosts,
125 allowing detection of and distinction between hosts that are down
126 and those that are unreachable.
127 @item Notifications when problems occur and get resolved (via email,
128 pager, or user-defined method).
129 @item Ability to define event handlers for proactive problem resolution.
130 @item Automatic log file rotation/archiving.
131 @item Optional web interface for viewing current network status,
132 notification and problem history, log file, etc.
134 (license license:gpl2)))
136 (define-public darkstat
142 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
146 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
147 (build-system gnu-build-system)
148 (arguments '(#:tests? #f)) ; no tests
150 `(("libpcap" ,libpcap)
152 (home-page "https://unix4lyfe.org/darkstat/")
153 (synopsis "Network statistics gatherer")
155 "@command{darkstat} is a packet sniffer that runs as a background process,
156 gathers all sorts of statistics about network usage, and serves them over
160 @item Traffic graphs, reports per host, shows ports for each host.
161 @item Embedded web-server with deflate compression.
162 @item Asynchronous reverse DNS resolution using a child process.
163 @item Small. Portable. Single-threaded. Efficient.
166 (license license:gpl2)))
168 (define-public python-whisper
170 (name "python-whisper")
175 (uri (pypi-uri "whisper" version))
178 "1v1bi3fl1i6p4z4ki692bykrkw6907dn3mfq0151f70lvi3zpns3"))))
179 (build-system python-build-system)
180 (home-page "http://graphiteapp.org/")
181 (synopsis "Fixed size round-robin style database for Graphite")
182 (description "Whisper is one of three components within the Graphite
183 project. Whisper is a fixed-size database, similar in design and purpose to
184 RRD (round-robin-database). It provides fast, reliable storage of numeric
185 data over time. Whisper allows for higher resolution (seconds per point) of
186 recent data to degrade into lower resolutions for long-term retention of
188 (license license:asl2.0)))
190 (define-public python2-whisper
191 (package-with-python2 python-whisper))
193 (define-public python2-carbon
195 (name "python2-carbon")
200 (uri (pypi-uri "carbon" version))
203 "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn"))))
204 (build-system python-build-system)
206 `(#:python ,python-2 ; only supports Python 2
208 (modify-phases %standard-phases
209 ;; Don't install to /opt
210 (add-after 'unpack 'do-not-install-to-/opt
211 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
213 `(("python2-whisper" ,python2-whisper)
214 ("python2-configparser" ,python2-configparser)
215 ("python2-txamqp" ,python2-txamqp)))
216 (home-page "http://graphiteapp.org/")
217 (synopsis "Backend data caching and persistence daemon for Graphite")
218 (description "Carbon is a backend data caching and persistence daemon for
219 Graphite. Carbon is responsible for receiving metrics over the network,
220 caching them in memory for \"hot queries\" from the Graphite-Web application,
221 and persisting them to disk using the Whisper time-series library.")
222 (license license:asl2.0)))
224 (define-public python2-graphite-web
226 (name "python2-graphite-web")
231 (uri (pypi-uri "graphite-web" version))
234 "0q8bwlj75jqyzmazfsi5sa26xl58ssa8wdxm2l4j0jqyn8xpfnmc"))))
235 (build-system python-build-system)
237 `(#:python ,python-2 ; only supports Python 2
239 (modify-phases %standard-phases
240 (add-after 'unpack 'relax-requirements
242 (substitute* "setup.py"
243 (("0.4.3") ,(package-version python2-django-tagging))
244 (("<1.9.99") (string-append "<="
245 ,(package-version python2-django))))
247 ;; Don't install to /opt
248 (add-after 'unpack 'do-not-install-to-/opt
249 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
251 `(("python2-cairocffi" ,python2-cairocffi)
252 ("python2-pytz" ,python2-pytz)
253 ("python2-whisper" ,python2-whisper)
254 ("python2-django" ,python2-django)
255 ("python2-django-tagging" ,python2-django-tagging)
256 ("python2-scandir" ,python2-scandir)
257 ("python2-urllib3" ,python2-urllib3)
258 ("python2-pyparsing" ,python2-pyparsing)
259 ("python2-txamqp" ,python2-txamqp)))
260 (home-page "http://graphiteapp.org/")
261 (synopsis "Scalable realtime graphing system")
262 (description "Graphite is a scalable real-time graphing system that does
263 two things: store numeric time-series data, and render graphs of this data on
265 (license license:asl2.0)))
267 (define-public python-prometheus-client
269 (name "python-prometheus-client")
274 (uri (pypi-uri "prometheus_client" version))
277 "164qzzg8q8awqk0angcm87p2sjiibaj1wgjz0xk6j0klvqi5q2mz"))))
278 (build-system python-build-system)
280 '(;; No included tests.
283 "https://github.com/prometheus/client_python")
284 (synopsis "Python client for the Prometheus monitoring system")
286 "The @code{prometheus_client} package supports exposing metrics from
287 software written in Python, so that they can be scraped by a Prometheus
290 Metrics can be exposed through a standalone web server, or through Twisted,
291 WSGI and the node exporter textfile collector.")
292 (license license:asl2.0)))
294 (define-public python2-prometheus-client
295 (package-with-python2 python-prometheus-client))