Uploaded image for project: 'openATTIC'
  1. openATTIC
  2. OP-1955

Update issues with Nagios 4.2.4 installed from EPEL on EL7

    XMLWordPrintable

    Details

      Description

      EPEL recently updated their version of Nagios from 4.0.8 to 4.2.4. This seems to be causing problems when running oaconfig install after an update or during the installation.

      Running oaconfig install after upgrading an EL7 system from openATTIC 2.0.10 to 2.0.18 and Nagios from 4.0.8 to 4.2.4, I get the following error:

      # oaconfig install
      Redirecting to /bin/systemctl status  postgresql.service
      Database openattic exists, owned by  openattic 
      psql: FATAL:  password authentication failed for user "openattic"
      ALTER ROLE
      Password of database user openattic and database.ini updated
      Redirecting to /bin/systemctl status  openattic-systemd.service
      Creating tables ...
      Creating table taskqueue_taskqueue
      Installing custom SQL ...
      Installing indexes ...
      Installed 70 object(s) from 2 fixture(s)
      Redirecting to /bin/systemctl restart  openattic-systemd.service
      Redirecting to /bin/systemctl restart  openattic-rpcd.service
      Redirecting to /bin/systemctl reload  httpd.service
      We have an admin already, not creating default user.
      4.2.4
      Restarting npcd (via systemctl):                           [  OK  ]
      Found lo
      Found enp0s3
      Adding  {'broadcast': '192.168.178.255', 'netmask': '255.255.255.0', 'addr': '192.168.178.25'}
      Adding  {'netmask': 'ffff:ffff:ffff:ffff::', 'addr': '2003:ce:5bc3:2100:a00:27ff:fee3:b6f0'}
      The authentication token for 'openattic' does already exist.
      Volume Group openattic already exists in the database
      Volume Group centos already exists in the database
      Logical Volume testvol already exists in the database
      Logical Volume root is tagged as sys, ignored.
      Logical Volume swap is tagged as sys, ignored.
      checking disk /dev/sda
      checking disk /dev/sdb
      checking disk /dev/sdc
      checking disk /dev/sdd
      Traceback (most recent call last):
        File "manage.py", line 26, in <module>
          execute_from_command_line(sys.argv)
        File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
          utility.execute()
        File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
          self.fetch_command(subcommand).run_from_argv(self.argv)
        File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
          self.execute(*args, **options.__dict__)
        File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
          output = self.handle(*args, **options)
        File "/usr/share/openattic/sysutils/management/commands/post_install.py", line 49, in handle
          sysutils.models.post_install.send(sender=sysutils.models)
        File "/usr/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 185, in send
          response = receiver(signal=self, sender=sender, **named)
        File "/usr/share/openattic/nagios/management/__init__.py", line 73, in create_nagios
          nagios.restart_service()
        File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
          **keywords)
        File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
          message, timeout)
      dbus.exceptions.DBusException: org.freedesktop.DBus.Python.SystemError: Traceback (most recent call last):
        File "/usr/lib64/python2.7/site-packages/dbus/service.py", line 707, in _message_cb
          retval = candidate_method(self, *args, **keywords)
        File "/usr/share/openattic/systemd/plugins.py", line 51, in loggedfunc
          return func(*args, **kwargs)
        File "/usr/share/openattic/systemd/plugins.py", line 99, in wrapper
          return meth(self, *args, **kwargs)
        File "/usr/share/openattic/nagios/systemapi.py", line 66, in restart_service
          invoke([nagios_settings.BINARY_NAME, "--verify-config", nagios_settings.NAGIOS_CFG_PATH])
        File "/usr/share/openattic/systemd/procutils.py", line 116, in invoke
          raise SystemError("%s failed: %s" % (cmdline, procerr))
      SystemError: "nagios" "--verify-config" "/etc/nagios/nagios.cfg" failed: 
      

      Running nagios --verify-config /etc/nagios/nagios.cfg returns the following:

      # nagios --verify-config /etc/nagios/nagios.cfg
      
      Nagios Core 4.2.4
      Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
      Copyright (c) 1999-2009 Ethan Galstad
      Last Modified: 12-07-2016
      License: GPL
      
      Website: 
      

      https://www.nagios.org

      Reading configuration data...
      Error in configuration file '/etc/nagios/nagios.cfg' - Line 454 (Check result path '/var/log/nagios/spool/checkresults' is not a valid directory)
         Error processing main config file!
      

      The update of Nagios from 4.0.8 to 4.2.4 in EPEL7 introduced changes to the configuration and directory layout that require updating nagios.conf after the RPM update (and also making changes to the openATTIC configuration:

      # diff -u /etc/nagios/nagios.cfg /etc/nagios/nagios.cfg.rpmnew
      --- /etc/nagios/nagios.cfg	2016-03-01 01:33:49.599000000 +0100
      +++ /etc/nagios/nagios.cfg.rpmnew	2017-02-08 00:36:27.000000000 +0100
      @@ -1,6 +1,6 @@
       ##############################################################################
       #
      -# NAGIOS.CFG - Sample Main Config File for Nagios 4.0.8
      +# NAGIOS.CFG - Sample Main Config File for Nagios 4.2.4
       #
       # Read the documentation for more information on this configuration
       # file.  I've provided some comments here, but things may not be so
      @@ -65,7 +65,7 @@
       # directly) in order to prevent inconsistencies that can occur
       # when the config files are modified after Nagios starts.
       
      -object_cache_file=/var/log/nagios/objects.cache
      +object_cache_file=/var/spool/nagios/objects.cache
       
       
       
      @@ -81,7 +81,7 @@
       # Read the documentation section on optimizing Nagios to find our more
       # about how this feature works.
       
      -precached_object_file=/var/log/nagios/objects.precache
      +precached_object_file=/var/spool/nagios/objects.precache
       
       
       
      @@ -104,7 +104,7 @@
       # The contents of the status file are deleted every time Nagios
       #  restarts.
       
      -status_file=/var/log/nagios/status.dat
      +status_file=/var/spool/nagios/status.dat
       
       
       
      @@ -160,7 +160,7 @@
       # QUERY HANDLER INTERFACE
       # This is the socket that is created for the Query Handler interface
       
      -query_socket=/var/spool/nagios/cmd/nagios.qh
      +#query_socket=/var/spool/nagios/cmd/nagios.qh
       
       
       
      @@ -178,7 +178,7 @@
       # is created, used, and deleted throughout the time that Nagios is
       # running.
       
      -temp_file=/var/log/nagios/nagios.tmp
      +temp_file=/var/spool/nagios/nagios.tmp
       
       
       
      @@ -451,7 +451,7 @@
       # Note: Make sure that only one instance of Nagios has access
       # to this directory!  
       
      -check_result_path=/var/log/nagios/spool/checkresults
      +check_result_path=/var/spool/nagios/checkresults
       
       
       
      @@ -618,7 +618,7 @@
       # This file is used only if the retain_state_information
       # variable is set to 1.
       
      -state_retention_file=/var/log/nagios/retention.dat
      +state_retention_file=/var/spool/nagios/retention.dat
       
       
       
      @@ -707,7 +707,7 @@
       # patches to Nagios.  Nagios is critical to you - make sure you keep it in
       # good shape.  Nagios will check once a day for new updates. Data collected
       # by Nagios Enterprises from the update check is processed in accordance 
      -# with our privacy policy - see 
      

      http://api.nagios.org

       for details.
      +# with our privacy policy - see 
      

      https://api.nagios.org

       for details.
       
       check_for_updates=1
       
      @@ -809,7 +809,7 @@
       # performance data.
       # Values: 1 = process performance data, 0 = do not process performance data
       
      -process_performance_data=1
      +process_performance_data=0
       
       
       
      @@ -831,8 +831,8 @@
       # Performance data is only written to these files if the
       # enable_performance_data option (above) is set to 1.
       
      -#host_perfdata_file=/var/log/nagios/host-perfdata
      -#service_perfdata_file=/var/log/nagios/service-perfdata
      +#host_perfdata_file=/var/spool/nagios/host-perfdata
      +#service_perfdata_file=/var/spool/nagios/service-perfdata
       
       
       
      @@ -1133,10 +1133,12 @@
       # host check commands.
       # The following macros are stripped of the characters you specify:
       #	$HOSTOUTPUT$
      +#	$LONGHOSTOUTPUT$
       #	$HOSTPERFDATA$
       #	$HOSTACKAUTHOR$
       #	$HOSTACKCOMMENT$
       #	$SERVICEOUTPUT$
      +#	$LONGSERVICEOUTPUT$
       #	$SERVICEPERFDATA$
       #	$SERVICEACKAUTHOR$
       #	$SERVICEACKCOMMENT$
      @@ -1287,7 +1289,7 @@
       # DEBUG FILE
       # This option determines where Nagios should write debugging information.
       
      -debug_file=/var/log/nagios/nagios.debug
      +debug_file=/var/spool/nagios/nagios.debug
       
       
       
      @@ -1316,6 +1318,16 @@
       
       
       
      +# DISABLE SERVICE CHECKS WHEN HOST DOWN
      +# This option will disable all service checks if the host is not in an UP state
      +#
      +# While desirable in some environments, enabling this value can distort report
      +# values as the expected quantity of checks will not have been performed
      +
      +#host_down_disable_service_checks=0
      +
      +
      +
       # EXPERIMENTAL load controlling options
       # To get current defaults based on your system issue a command to
       # the query handler. Please note that this is an experimental feature
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lgrimmer Grimmer, Lenz
              Reporter:
              lgrimmer Grimmer, Lenz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: