gnu: perl-file-pushd: Update to 1.016.
[jackhill/guix/guix.git] / gnu / packages / monitoring.scm
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>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
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))
41
42 (define-public nagios
43 (package
44 (name "nagios")
45 (version "4.3.4")
46 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
47 (source (origin
48 (method url-fetch)
49 (uri (string-append
50 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
51 version "/nagios-" version ".tar.gz"))
52 (sha256
53 (base32
54 "1wa4m952sb23dqi5w759adimsp21bkhp598rpq9dnhz3v497h2y9"))
55 (modules '((guix build utils)))
56 (snippet
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)
62 (native-inputs
63 `(("unzip" ,unzip)))
64 (inputs
65 `(("zlib" ,zlib)
66 ("libpng-apng" ,libpng)
67 ("gd" ,gd)
68 ("perl" ,perl)
69 ("mailutils" ,mailutils)))
70 (arguments
71 '(#:configure-flags (list "--sysconfdir=/etc"
72
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"
77
78 (string-append
79 "--with-mail="
80 (assoc-ref %build-inputs "mailutils")
81 "/bin/mail"))
82 #:make-flags '("all")
83 #:phases (modify-phases %standard-phases
84 (add-before 'build 'do-not-chown-to-nagios
85 (lambda _
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")
90 ""))
91 #t))
92 (add-before 'build 'do-not-create-sysconfdir
93 (lambda _
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)))
102 #t))
103 (add-before 'build 'set-html/php-directory
104 (lambda _
105 ;; Install HTML and PHP files under 'share/nagios/html'
106 ;; instead of just 'share/'.
107 (substitute* '("html/Makefile" "Makefile")
108 (("HTMLDIR=.*$")
109 "HTMLDIR = $(datarootdir)/nagios/html\n"))
110 #t)))
111 #:tests? #f)) ;no 'check' target or similar
112 (home-page "https://www.nagios.org/")
113 (synopsis "Host, service, and network monitoring program")
114 (description
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:
118
119 @itemize
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
123 methods.
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.
133 @end itemize\n")
134 (license license:gpl2)))
135
136 (define-public darkstat
137 (package
138 (name "darkstat")
139 (version "3.0.719")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
143 version ".tar.bz2"))
144 (sha256
145 (base32
146 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
147 (build-system gnu-build-system)
148 (arguments '(#:tests? #f)) ; no tests
149 (inputs
150 `(("libpcap" ,libpcap)
151 ("zlib" ,zlib)))
152 (home-page "https://unix4lyfe.org/darkstat/")
153 (synopsis "Network statistics gatherer")
154 (description
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
157 HTTP. Features:
158
159 @itemize
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.
164 @item Supports IPv6.
165 @end itemize")
166 (license license:gpl2)))
167
168 (define-public python-whisper
169 (package
170 (name "python-whisper")
171 (version "1.0.2")
172 (source
173 (origin
174 (method url-fetch)
175 (uri (pypi-uri "whisper" version))
176 (sha256
177 (base32
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
187 historical data.")
188 (license license:asl2.0)))
189
190 (define-public python2-whisper
191 (package-with-python2 python-whisper))
192
193 (define-public python2-carbon
194 (package
195 (name "python2-carbon")
196 (version "1.0.2")
197 (source
198 (origin
199 (method url-fetch)
200 (uri (pypi-uri "carbon" version))
201 (sha256
202 (base32
203 "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn"))))
204 (build-system python-build-system)
205 (arguments
206 `(#:python ,python-2 ; only supports Python 2
207 #:phases
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)))))
212 (propagated-inputs
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)))
223
224 (define-public python2-graphite-web
225 (package
226 (name "python2-graphite-web")
227 (version "1.0.2")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (pypi-uri "graphite-web" version))
232 (sha256
233 (base32
234 "0q8bwlj75jqyzmazfsi5sa26xl58ssa8wdxm2l4j0jqyn8xpfnmc"))))
235 (build-system python-build-system)
236 (arguments
237 `(#:python ,python-2 ; only supports Python 2
238 #:phases
239 (modify-phases %standard-phases
240 (add-after 'unpack 'relax-requirements
241 (lambda _
242 (substitute* "setup.py"
243 (("0.4.3") ,(package-version python2-django-tagging))
244 (("<1.9.99") (string-append "<="
245 ,(package-version python2-django))))
246 #t))
247 ;; Don't install to /opt
248 (add-after 'unpack 'do-not-install-to-/opt
249 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
250 (propagated-inputs
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
264 demand.")
265 (license license:asl2.0)))
266
267 (define-public python-prometheus-client
268 (package
269 (name "python-prometheus-client")
270 (version "0.1.1")
271 (source
272 (origin
273 (method url-fetch)
274 (uri (pypi-uri "prometheus_client" version))
275 (sha256
276 (base32
277 "164qzzg8q8awqk0angcm87p2sjiibaj1wgjz0xk6j0klvqi5q2mz"))))
278 (build-system python-build-system)
279 (arguments
280 '(;; No included tests.
281 #:tests? #f))
282 (home-page
283 "https://github.com/prometheus/client_python")
284 (synopsis "Python client for the Prometheus monitoring system")
285 (description
286 "The @code{prometheus_client} package supports exposing metrics from
287 software written in Python, so that they can be scraped by a Prometheus
288 service.
289
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)))
293
294 (define-public python2-prometheus-client
295 (package-with-python2 python-prometheus-client))