guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: Add Nagios.


From: Ludovic Courtès
Subject: 01/01: gnu: Add Nagios.
Date: Wed, 30 Nov 2016 22:31:09 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit d30e578a0011b05d1e7d8b3ba7ee38588eba301c
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 30 23:26:57 2016 +0100

    gnu: Add Nagios.
    
    * gnu/packages/monitoring.scm: New file.
    * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk                |    1 +
 gnu/packages/monitoring.scm |  122 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index d9ec24a..219d82a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -254,6 +254,7 @@ GNU_SYSTEM_MODULES =                                \
   %D%/packages/microcom.scm                    \
   %D%/packages/mit-krb5.scm                    \
   %D%/packages/moe.scm                         \
+  %D%/packages/monitoring.scm                  \
   %D%/packages/mono.scm                                \
   %D%/packages/moreutils.scm                   \
   %D%/packages/mpd.scm                         \
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
new file mode 100644
index 0000000..db2139b
--- /dev/null
+++ b/gnu/packages/monitoring.scm
@@ -0,0 +1,122 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Ludovic Courtès <address@hidden>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages monitoring)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system perl)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages mail)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages image))
+
+(define-public nagios
+  (package
+    (name "nagios")
+    (version "4.0.8")
+    ;; XXX: Newer versions such as 4.2.3 bundle a copy of AngularJS.
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://sourceforge/nagios/nagios-4.x/nagios-"
+                    version "/nagios-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0jyad39wa318613awlnpczrrakvjcipz8qp1mdsig1cp1hjqs9lb"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Ensure reproducibility.
+               '(substitute* (find-files "cgi" "\\.c$")
+                  (("__DATE__") "\"1970-01-01\"")
+                  (("__TIME__") "\"00:00:00\"")))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("zlib" ,zlib)
+       ("libpng-apng" ,libpng)
+       ("gd" ,gd)
+       ("perl" ,perl)
+       ("mailutils" ,mailutils)))
+    (arguments
+     '(#:configure-flags (list "--sysconfdir=/etc"
+
+                               ;; 'include/locations.h.in' defines file
+                               ;; locations, and many things go directly under
+                               ;; LOCALSTATEDIR, hence the extra '/nagios'.
+                               "--localstatedir=/var/nagios"
+
+                               (string-append
+                                "--with-mail="
+                                (assoc-ref %build-inputs "mailutils")
+                                "/bin/mail"))
+       #:make-flags '("all")
+       #:phases (modify-phases %standard-phases
+                  (add-before 'build 'do-not-chown-to-nagios
+                    (lambda _
+                      ;; Makefiles do 'install -o nagios -g nagios', which
+                      ;; doesn't work for us.
+                      (substitute* (find-files "." "^Makefile$")
+                        (("-o nagios -g nagios")
+                         ""))
+                      #t))
+                  (add-before 'build 'do-not-create-sysconfdir
+                    (lambda _
+                      ;; Don't try to create /var upon 'make install'.
+                      (substitute* "Makefile"
+                        (("\\$\\(INSTALL\\).*\\$\\(LOGDIR\\).*$" all)
+                         (string-append "# " all))
+                        (("\\$\\(INSTALL\\).*\\$\\(CHECKRESULTDIR\\).*$" all)
+                         (string-append "# " all))
+                        (("chmod g\\+s.*" all)
+                         (string-append "# " all)))
+                      #t))
+                  (add-before 'build 'set-html/php-directory
+                    (lambda _
+                      ;; Install HTML and PHP files under 'share/nagios/html'
+                      ;; instead of just 'share/'.
+                      (substitute* '("html/Makefile" "Makefile")
+                        (("HTMLDIR=.*$")
+                         "HTMLDIR = $(datarootdir)/nagios/html\n"))
+                      #t)))
+       #:tests? #f))                             ;no 'check' target or similar
+    (home-page "https://www.nagios.org/";)
+    (synopsis "Host, service, and network monitoring program")
+    (description
+     "Nagios is a host, service, and network monitoring program written in C.
+CGI programs are included to allow you to view the current status, history,
+etc. via a Web interface.  Features include:
+
address@hidden
address@hidden Monitoring of network services (via SMTP, POP3, HTTP, PING, etc).
address@hidden Monitoring of host resources (processor load, disk usage, etc.).
address@hidden A plugin interface to allow for user-developed service monitoring
+  methods.
address@hidden Ability to define network host hierarchy using \"parent\" hosts,
+  allowing detection of and distinction between hosts that are down
+  and those that are unreachable.
address@hidden Notifications when problems occur and get resolved (via email,
+  pager, or user-defined method).
address@hidden Ability to define event handlers for proactive problem 
resolution.
address@hidden Automatic log file rotation/archiving.
address@hidden Optional web interface for viewing current network status,
+  notification and problem history, log file, etc.
address@hidden itemize\n")
+    (license license:gpl2)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]