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