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

Nagios module creates invalid config, where "localhost" is not found

    XMLWordPrintable

    Details

      Description

      Saw this when creating a trusty Vagrant VM:

      ==> default: Traceback (most recent call last):
      ==> default:   File "manage.py", line 26, in <module>
      ==> default:     
      ==> default: execute_from_command_line(sys.argv)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
      ==> default:     
      ==> default: utility.execute()
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
      ==> default:     
      ==> default: self.fetch_command(subcommand).run_from_argv(self.argv)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
      ==> default:     
      ==> default: self.execute(*args, **options.__dict__)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
      ==> default:     
      ==> default: output = self.handle(*args, **options)
      ==> default:   File "/home/vagrant/openattic/backend/rpcd/management/commands/makedefaultadmin.py", line 27, in handle
      ==> default:     
      ==> default: admin.save()
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
      ==> default:     
      ==> default: force_update=force_update, update_fields=update_fields)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 569, in save_base
      ==> default:     
      ==> default: update_fields=update_fields)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 185, in send
      ==> default:     
      ==> default: response = receiver(signal=self, sender=sender, **named)
      ==> default:   File "/home/vagrant/openattic/backend/nagios/models.py", line 177, in update_conf_for_user
      ==> default:     
      ==> default: nagios.restart_service()
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
      ==> default:     
      ==> default: **keywords)
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
      ==> default:     
      ==> default: message, timeout)
      ==> default: dbus.exceptions
      ==> default: .
      ==> default: DBusException
      ==> default: : 
      ==> default: org.freedesktop.DBus.Python.SystemError: Traceback (most recent call last):
      ==> default:   File "/home/vagrant/env/local/lib/python2.7/site-packages/dbus/service.py", line 707, in _message_cb
      ==> default:     retval = candidate_method(self, *args, **keywords)
      ==> default:   File "/home/vagrant/openattic/backend/systemd/plugins.py", line 51, in loggedfunc
      ==> default:     return func(*args, **kwargs)
      ==> default:   File "/home/vagrant/openattic/backend/systemd/plugins.py", line 99, in wrapper
      ==> default:     return meth(self, *args, **kwargs)
      ==> default:   File "/home/vagrant/openattic/backend/nagios/systemapi.py", line 66, in restart_service
      ==> default:     invoke([nagios_settings.BINARY_NAME, "--verify-config", nagios_settings.NAGIOS_CFG_PATH])
      ==> default:   File "/home/vagrant/openattic/backend/systemd/procutils.py", line 116, in invoke
      ==> default:     raise SystemError("%s failed: %s" % (cmdline, procerr if procerr else procout))
      ==> default: SystemError: "nagios3" "--verify-config" "/etc/nagios3/nagios.cfg" failed: 
      ==> default: Nagios Core 3.5.1
      ==> default: Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
      ==> default: Copyright (c) 1999-2009 Ethan Galstad
      ==> default: Last Modified: 08-30-2013
      ==> default: License: GPL
      ==> default: 
      ==> default: Website: http://www.nagios.org
      ==> default: Reading configuration data...
      ==> default:    Read main config file okay...
      ==> default: Processing object config file '/etc/nagios3/commands.cfg'...
      ==> default: Processing object config directory '/etc/nagios-plugins/config'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/load.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/games.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/http.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/news.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/openattic.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/real.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/users.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
      ==> default: Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
      ==> default: Processing object config directory '/etc/nagios3/conf.d'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/openattic_contacts.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/services_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/generic-host_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/extinfo_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/openattic.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/generic-service_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/openattic_static.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/timeperiods_nagios2.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/pnp4nagios.cfg'...
      ==> default: Processing object config file '/etc/nagios3/conf.d/contacts_nagios2.cfg'...
      ==> default: Error: Could not find any host matching 'localhost' (config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 25)
      ==> default: Error: Could not expand members specified in hostgroup (config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 25)
      ==> default:    Error processing object config files!
      ==> default: 
      ==> default: 
      ==> default: ***> One or more problems was encountered while processing the config files...
      ==> default: 
      ==> default:      Check your configuration file(s) to ensure that they contain valid
      ==> default:      directives and data defintions.  If you are upgrading from a previous
      ==> default:      version of Nagios, you should be aware that some variables/definitions
      ==> default:      may have been removed or modified in this version.  Make sure to read
      ==> default:      the HTML documentation regarding the config files, as well as the
      ==> default:      'Whats New' section to find out what has changed.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              swagner Sebastian Wagner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: