gnu: nagios: Update to 4.3.4.
[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 compression)
32 #:use-module (gnu packages django)
33 #:use-module (gnu packages gd)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages mail)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages python-web)
39 #:use-module (gnu packages time))
40
41 (define-public nagios
42 (package
43 (name "nagios")
44 (version "4.3.4")
45 ;; XXX: Nagios 4.2.x and later bundle a copy of AngularJS.
46 (source (origin
47 (method url-fetch)
48 (uri (string-append
49 "mirror://sourceforge/nagios/nagios-4.x/nagios-"
50 version "/nagios-" version ".tar.gz"))
51 (sha256
52 (base32
53 "1wa4m952sb23dqi5w759adimsp21bkhp598rpq9dnhz3v497h2y9"))
54 (modules '((guix build utils)))
55 (snippet
56 ;; Ensure reproducibility.
57 '(substitute* (find-files "cgi" "\\.c$")
58 (("__DATE__") "\"1970-01-01\"")
59 (("__TIME__") "\"00:00:00\"")))))
60 (build-system gnu-build-system)
61 (native-inputs
62 `(("unzip" ,unzip)))
63 (inputs
64 `(("zlib" ,zlib)
65 ("libpng-apng" ,libpng)
66 ("gd" ,gd)
67 ("perl" ,perl)
68 ("mailutils" ,mailutils)))
69 (arguments
70 '(#:configure-flags (list "--sysconfdir=/etc"
71
72 ;; 'include/locations.h.in' defines file
73 ;; locations, and many things go directly under
74 ;; LOCALSTATEDIR, hence the extra '/nagios'.
75 "--localstatedir=/var/nagios"
76
77 (string-append
78 "--with-mail="
79 (assoc-ref %build-inputs "mailutils")
80 "/bin/mail"))
81 #:make-flags '("all")
82 #:phases (modify-phases %standard-phases
83 (add-before 'build 'do-not-chown-to-nagios
84 (lambda _
85 ;; Makefiles do 'install -o nagios -g nagios', which
86 ;; doesn't work for us.
87 (substitute* (find-files "." "^Makefile$")
88 (("-o nagios -g nagios")
89 ""))
90 #t))
91 (add-before 'build 'do-not-create-sysconfdir
92 (lambda _
93 ;; Don't try to create /var upon 'make install'.
94 (substitute* "Makefile"
95 (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
96 (string-append "# " all))
97 (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
98 (string-append "# " all))
99 (("chmod g\\+s.*" all)
100 (string-append "# " all)))
101 #t))
102 (add-before 'build 'set-html/php-directory
103 (lambda _
104 ;; Install HTML and PHP files under 'share/nagios/html'
105 ;; instead of just 'share/'.
106 (substitute* '("html/Makefile" "Makefile")
107 (("HTMLDIR=.*$")
108 "HTMLDIR = $(datarootdir)/nagios/html\n"))
109 #t)))
110 #:tests? #f)) ;no 'check' target or similar
111 (home-page "https://www.nagios.org/")
112 (synopsis "Host, service, and network monitoring program")
113 (description
114 "Nagios is a host, service, and network monitoring program written in C.
115 CGI programs are included to allow you to view the current status, history,
116 etc. via a Web interface. Features include:
117
118 @itemize
119 @item Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
120 @item Monitoring of host resources (processor load, disk usage, etc.).
121 @item A plugin interface to allow for user-developed service monitoring
122 methods.
123 @item Ability to define network host hierarchy using \"parent\" hosts,
124 allowing detection of and distinction between hosts that are down
125 and those that are unreachable.
126 @item Notifications when problems occur and get resolved (via email,
127 pager, or user-defined method).
128 @item Ability to define event handlers for proactive problem resolution.
129 @item Automatic log file rotation/archiving.
130 @item Optional web interface for viewing current network status,
131 notification and problem history, log file, etc.
132 @end itemize\n")
133 (license license:gpl2)))
134
135 (define-public darkstat
136 (package
137 (name "darkstat")
138 (version "3.0.719")
139 (source (origin
140 (method url-fetch)
141 (uri (string-append "https://unix4lyfe.org/darkstat/darkstat-"
142 version ".tar.bz2"))
143 (sha256
144 (base32
145 "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"))))
146 (build-system gnu-build-system)
147 (arguments '(#:tests? #f)) ; no tests
148 (inputs
149 `(("libpcap" ,libpcap)
150 ("zlib" ,zlib)))
151 (home-page "https://unix4lyfe.org/darkstat/")
152 (synopsis "Network statistics gatherer")
153 (description
154 "@command{darkstat} is a packet sniffer that runs as a background process,
155 gathers all sorts of statistics about network usage, and serves them over
156 HTTP. Features:
157
158 @itemize
159 @item Traffic graphs, reports per host, shows ports for each host.
160 @item Embedded web-server with deflate compression.
161 @item Asynchronous reverse DNS resolution using a child process.
162 @item Small. Portable. Single-threaded. Efficient.
163 @item Supports IPv6.
164 @end itemize")
165 (license license:gpl2)))
166
167 (define-public python-whisper
168 (package
169 (name "python-whisper")
170 (version "1.0.2")
171 (source
172 (origin
173 (method url-fetch)
174 (uri (pypi-uri "whisper" version))
175 (sha256
176 (base32
177 "1v1bi3fl1i6p4z4ki692bykrkw6907dn3mfq0151f70lvi3zpns3"))))
178 (build-system python-build-system)
179 (home-page "http://graphiteapp.org/")
180 (synopsis "Fixed size round-robin style database for Graphite")
181 (description "Whisper is one of three components within the Graphite
182 project. Whisper is a fixed-size database, similar in design and purpose to
183 RRD (round-robin-database). It provides fast, reliable storage of numeric
184 data over time. Whisper allows for higher resolution (seconds per point) of
185 recent data to degrade into lower resolutions for long-term retention of
186 historical data.")
187 (license license:asl2.0)))
188
189 (define-public python2-whisper
190 (package-with-python2 python-whisper))
191
192 (define-public python2-carbon
193 (package
194 (name "python2-carbon")
195 (version "1.0.2")
196 (source
197 (origin
198 (method url-fetch)
199 (uri (pypi-uri "carbon" version))
200 (sha256
201 (base32
202 "142smpmgbnjinvfb6s4ijazish4vfgzyd8zcmdkh55y051fkixkn"))))
203 (build-system python-build-system)
204 (arguments
205 `(#:python ,python-2 ; only supports Python 2
206 #:phases
207 (modify-phases %standard-phases
208 ;; Don't install to /opt
209 (add-after 'unpack 'do-not-install-to-/opt
210 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
211 (propagated-inputs
212 `(("python2-whisper" ,python2-whisper)
213 ("python2-configparser" ,python2-configparser)
214 ("python2-txamqp" ,python2-txamqp)))
215 (home-page "http://graphiteapp.org/")
216 (synopsis "Backend data caching and persistence daemon for Graphite")
217 (description "Carbon is a backend data caching and persistence daemon for
218 Graphite. Carbon is responsible for receiving metrics over the network,
219 caching them in memory for \"hot queries\" from the Graphite-Web application,
220 and persisting them to disk using the Whisper time-series library.")
221 (license license:asl2.0)))
222
223 (define-public python2-graphite-web
224 (package
225 (name "python2-graphite-web")
226 (version "1.0.2")
227 (source
228 (origin
229 (method url-fetch)
230 (uri (pypi-uri "graphite-web" version))
231 (sha256
232 (base32
233 "0q8bwlj75jqyzmazfsi5sa26xl58ssa8wdxm2l4j0jqyn8xpfnmc"))))
234 (build-system python-build-system)
235 (arguments
236 `(#:python ,python-2 ; only supports Python 2
237 #:phases
238 (modify-phases %standard-phases
239 (add-after 'unpack 'relax-requirements
240 (lambda _
241 (substitute* "setup.py"
242 (("0.4.3") ,(package-version python2-django-tagging))
243 (("<1.9.99") (string-append "<="
244 ,(package-version python2-django))))
245 #t))
246 ;; Don't install to /opt
247 (add-after 'unpack 'do-not-install-to-/opt
248 (lambda _ (setenv "GRAPHITE_NO_PREFIX" "1") #t)))))
249 (propagated-inputs
250 `(("python2-cairocffi" ,python2-cairocffi)
251 ("python2-pytz" ,python2-pytz)
252 ("python2-whisper" ,python2-whisper)
253 ("python2-django" ,python2-django)
254 ("python2-django-tagging" ,python2-django-tagging)
255 ("python2-scandir" ,python2-scandir)
256 ("python2-urllib3" ,python2-urllib3)
257 ("python2-pyparsing" ,python2-pyparsing)
258 ("python2-txamqp" ,python2-txamqp)))
259 (home-page "http://graphiteapp.org/")
260 (synopsis "Scalable realtime graphing system")
261 (description "Graphite is a scalable real-time graphing system that does
262 two things: store numeric time-series data, and render graphs of this data on
263 demand.")
264 (license license:asl2.0)))