Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.03k stars 578 forks source link

icinga not running, probable schema issue problem #5813

Closed gzcwnk closed 6 years ago

gzcwnk commented 6 years ago

Attempted to install icinga

Expected Behavior

icinga2 should be running but it is not

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

  1. install attempt as per https://www.howtoforge.com/tutorial/how-to-install-icinga2-on-debian-9/

Context

make icinga2 work.

Your Environment

root@ininga-001:~# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.6.0-1)

Copyright (c) 2012-2016 Icinga Development Team (https://www.icinga.org/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: /usr
  Sysconf directory: /etc
  Run directory: /run
  Local state directory: /var
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Modified attributes path: /var/lib/icinga2/modified-attributes.conf
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /run/icinga2/icinga2.pid

System information:
  Platform: Debian GNU/Linux
  Platform version: 9 (stretch)
  Kernel: Linux
  Kernel version: 4.9.0-4-amd64
  Architecture: x86_64

Build information:
  Compiler: GNU 6.2.1
  Build host: amalia
root@ininga-001:~# 
root@ininga-001:~# icinga2 feature list
Disabled features: api command compatlog debuglog gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: checker ido-mysql mainlog notification
root@ininga-001:~# 
root@ininga-001:~# icinga2 daemon -C
information/cli: Icinga application loader (version: r2.6.0-1)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
information/ConfigItem: Instantiated 1 Zone.
information/ConfigItem: Instantiated 1 FileLogger.
information/ConfigItem: Instantiated 1 Endpoint.
information/ConfigItem: Instantiated 2 NotificationCommands.
information/ConfigItem: Instantiated 13 Notifications.
information/ConfigItem: Instantiated 201 CheckCommands.
information/ConfigItem: Instantiated 1 Downtime.
information/ConfigItem: Instantiated 1 Host.
information/ConfigItem: Instantiated 1 IcingaApplication.
information/ConfigItem: Instantiated 2 HostGroups.
information/ConfigItem: Instantiated 1 UserGroup.
information/ConfigItem: Instantiated 1 User.
information/ConfigItem: Instantiated 12 Services.
information/ConfigItem: Instantiated 3 TimePeriods.
information/ConfigItem: Instantiated 3 ServiceGroups.
information/ConfigItem: Instantiated 1 ScheduledDowntime.
information/ConfigItem: Instantiated 1 CheckerComponent.
information/ConfigItem: Instantiated 1 IdoMysqlConnection.
information/ConfigItem: Instantiated 1 NotificationComponent.
information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
information/cli: Finished validating the configuration file(s).
root@ininga-001:~# 
root@ininga-001:~# systemctl status icinga2 
\u25cf icinga2.service - Icinga host/service/network monitoring system
   Loaded: loaded (/lib/systemd/system/icinga2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-11-29 10:43:31 NZDT; 34s ago
  Process: 969 ExecStart=/usr/sbin/icinga2 daemon -e ${ICINGA2_ERROR_LOG} (code=exited, status=1/FAILURE)
  Process: 909 ExecStartPre=/usr/lib/icinga2/prepare-dirs /usr/lib/icinga2/icinga2 (code=exited, status=0/SUCCESS)
 Main PID: 969 (code=exited, status=1/FAILURE)

Nov 29 10:43:31 ininga-001 icinga2[969]: [2017-11-29 10:43:31 +1300] information/ConfigObject: Restored 249 objects. Loaded 0 new objects without state.
Nov 29 10:43:31 ininga-001 icinga2[969]: [2017-11-29 10:43:31 +1300] information/ConfigItem: Triggering Start signal for config items
Nov 29 10:43:31 ininga-001 icinga2[969]: [2017-11-29 10:43:31 +1300] information/ConfigItem: Activated all objects.
Nov 29 10:43:31 ininga-001 icinga2[969]: [2017-11-29 10:43:31 +1300] information/DbConnection: Resuming IDO connection: ido-mysql
Nov 29 10:43:31 ininga-001 icinga2[969]: [2017-11-29 10:43:31 +1300] critical/IdoMysqlConnection: Schema does not provide any valid version! Verify your schema installation.
Nov 29 10:43:31 ininga-001 icinga2[969]: Context:
Nov 29 10:43:31 ininga-001 icinga2[969]:         (0) Reconnecting to MySQL IDO database 'ido-mysql'
Nov 29 10:43:31 ininga-001 systemd[1]: icinga2.service: Main process exited, code=exited, status=1/FAILURE
Nov 29 10:43:31 ininga-001 systemd[1]: icinga2.service: Unit entered failed state.
Nov 29 10:43:31 ininga-001 systemd[1]: icinga2.service: Failed with result 'exit-code'.
root@ininga-001:~# 
gzcwnk commented 6 years ago

When I re-try setting up the database I get,

root@ininga-001:~# !115
mysql -u root icingadb -p < /usr/share/icinga2-ido-mysql/schema/mysql.sql
Enter password: 
ERROR 1060 (42S21) at line 1436: Duplicate column name 'endpoint_object_id'
root@ininga-001:~# 
gzcwnk commented 6 years ago

So around line 1436 I see,

CREATE TABLE IF NOT EXISTS icinga_zonestatus (
  zonestatus_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  instance_id bigint unsigned default 0,
  zone_object_id bigint(20) unsigned DEFAULT '0',
  status_update_time timestamp NULL DEFAULT NULL,
  parent_zone_object_id bigint(20) unsigned DEFAULT '0',
  PRIMARY KEY  (zonestatus_id)
) ENGINE=InnoDB COMMENT='Zone status';
line 1436-->  ALTER TABLE icinga_servicestatus ADD COLUMN endpoint_object_id bigint default NULL;
ALTER TABLE icinga_hoststatus ADD COLUMN endpoint_object_id bigint default NULL;
ALTER TABLE icinga_contactstatus ADD COLUMN endpoint_object_id bigint default NULL;
ALTER TABLE icinga_programstatus ADD COLUMN endpoint_object_id bigint default NULL;
dnsmichi commented 6 years ago

Not sure what you are doing here. Sounds like a problem with importing the database schema at first glance. Debian provides a popup configuration mechanism to do so, nothing you would need to do manually.

Please also use Markdown formatting as suggested by the issue template.

dnsmichi commented 6 years ago

Closing as no feedback was received.