Installation Issues - Have troubleshot DB authentication to no resolution

Greetings,

I have been ongoing troubleshooting this Icinga installation. I have the web GUI up but it is giving me a message that “icinga is currently not up and running”.

When I check in the CLI it shows that there is some type of DB access issue with credentials. Although when i check my credentials and even log into MariaDB, the credentials work.

I have verified that the DB is running and installed correctly. I have included my information and logs below. I am wondering if anyone can assist. This is my first time working with Icinga but I seem to be running in circles on the installation. Hoping someone with more experience can add some insight? Thanks in advance for any help!



Icinga Version and System Info:

[root@NETGRAPHICINGA /]# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.2-1)

Copyright (c) 2012-2023 Icinga GmbH
License GPLv2+: GNU GPL version 2 or late
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Rocky Linux
Platform version: 8.7 (Green Obsidian)
Kernel: Linux
Kernel version: 4.18.0-425.19.2.el8_7.x86_64
Architecture: x86_64

Build information:
Compiler: GNU 8.4.1
Build host: runner-hh8q3bz2-project-322-concurrent-0
OpenSSL version: OpenSSL 1.1.1k FIPS 25 Mar 2021

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
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
[root@NETGRAPHICINGA /]# icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite ido-myssql influxdb influxdb2 livestatus opentsdb perfdata statusdata
Enabled features: api checker command icingadb ido-mysql mainlog notification syslog
[root@NETGRAPHICINGA /]#



[root@NETGRAPHICINGA /]# icinga2 daemon -C
[2023-05-30 13:00:33 -0400] information/cli: Icinga application loader (version: 2.13.2-1)
[2023-05-30 13:00:33 -0400] information/cli: Loading configuration file(s).
[2023-05-30 13:00:33 -0400] information/ConfigItem: Committing config item(s).
[2023-05-30 13:00:33 -0400] information/ApiListener: My API identity: NETGRAPHICINGA.net.wcupa.edu
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 12 Services.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 SyslogLogger.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 NotificationComponent.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 CheckerComponent.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 User.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 UserGroup.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 3 ServiceGroups.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 3 TimePeriods.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 3 Zones.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 2 NotificationCommands.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 2 HostGroups.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 12 Notifications.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 Downtime.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 IcingaApplication.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 2 Hosts.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 Endpoint.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 IcingaDB.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 FileLogger.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 2 ApiUsers.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 244 CheckCommands.
[2023-05-30 13:00:33 -0400] information/ConfigItem: Instantiated 1 ApiListener.
[2023-05-30 13:00:33 -0400] information/ScriptGlobal: Dumping variables to file ‘/var/cache/icinga2/icinga2.vars’
[2023-05-30 13:00:33 -0400] information/cli: Finished validating the configuration file(s).
[root@NETGRAPHICINGA /]#



[root@NETGRAPHICINGA icinga2]# cat icinga2.conf
/**

  • Icinga 2 configuration file
    • this is where you define settings for the Icinga application including
  • which hosts/services to check.
  • For an overview of all available configuration options please refer
  • to the documentation that is distributed as part of Icinga 2.
    */

/**

  • The constants.conf defines global constants.
    */
    include “constants.conf”

object ApiUser “api-user” {
password = “api-password”
permissions = [ “*” ]
}

/**

  • The IdoMysqlConnection type implements MySQL support
  • for DB IDO.
    */

/**

  • The zones.conf defines zones for a cluster setup.
  • Not required for single instance setups.
    */
    include “zones.conf”

/**

  • The Icinga Template Library (ITL) provides a number of useful templates
  • and command definitions.
  • Common monitoring plugin command definitions are included separately.
    */
    include
    include
    include
    include

/**

  • This includes the Icinga 2 Windows plugins. These command definitions
  • are required on a master node when a client is used as command endpoint.
    */
    include

/**

  • This includes the NSClient++ check commands. These command definitions
  • are required on a master node when a client is used as command endpoint.
    */
    include

/**

  • The features-available directory contains a number of configuration
  • files for features which can be enabled and disabled using the
  • icinga2 feature enable / icinga2 feature disable CLI commands.
  • These commands work by creating and removing symbolic links in
  • the features-enabled directory.
    /
    include "features-enabled/
    .conf"

/**

  • Although in theory you could define all your objects in this file
  • the preferred way is to create separate directories and files in the conf.d
  • directory. Each of these files must have the file extension “.conf”.
    */
    include_recursive “conf.d”
    [root@NETGRAPHICINGA icinga2]#

(0) Reconnecting to MySQL IDO database ‘ido-mysql’



Log Messages:

[2023-05-30 12:54:57 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[2023-05-30 12:55:07 -0400] critical/IdoMysqlConnection: Connection to database ‘icinga’ with user ‘icinga’ on ‘localhost:3306’ failed: “Access denied for user ‘icinga’@‘localhost’ (using password: YES)”
Context:
(0) Reconnecting to MySQL IDO database ‘ido-mysql’

[2023-05-30 12:55:07 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[2023-05-30 12:55:17 -0400] critical/IdoMysqlConnection: Connection to database ‘icinga’ with user ‘icinga’ on ‘localhost:3306’ failed: “Access denied for user ‘icinga’@‘localhost’ (using password: YES)”
Context:
(0) Reconnecting to MySQL IDO database ‘ido-mysql’

[2023-05-30 12:55:17 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[2023-05-30 12:55:27 -0400] critical/IdoMysqlConnection: Connection to database ‘icinga’ with user ‘icinga’ on ‘localhost:3306’ failed: “Access denied for user ‘icinga’@‘localhost’ (using password: YES)”
Context:

    (0) Reconnecting to MySQL IDO database 'ido-mysql'

[2023-05-30 13:06:57 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[root@NETGRAPHICINGA icinga2]#

(0) Reconnecting to MySQL IDO database ‘ido-mysql’

[2023-05-30 13:06:47 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[2023-05-30 13:06:57 -0400] critical/IdoMysqlConnection: Connection to database ‘icinga’ with user ‘icinga’ on ‘localhost:3306’ failed: “Access denied for user ‘icinga’@‘localhost’ (using password: YES)”
Context:
(0) Reconnecting to MySQL IDO database ‘ido-mysql’

[2023-05-30 13:06:57 -0400] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!



[root@NETGRAPHICINGA icinga2]# sudo service mysql status
Redirecting to /bin/systemctl status mysql.service
‚óè mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2023-05-30 10:37:15 EDT; 2h 35min ago
Docs: man:mysqld(8)
systemd - MariaDB Knowledge Base
Process: 1448 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 1060 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 1015 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 1328 (mysqld)
Status: “Taking your SQL requests now…”
Tasks: 34 (limit: 24871)
Memory: 118.3M
CGroup: /system.slice/mariadb.service
└─1328 /usr/libexec/mysqld --basedir=/usr

May 30 10:37:14 NETGRAPHICINGA.net.wcupa.edu systemd[1]: Starting MariaDB 10.3 database server…
May 30 10:37:14 NETGRAPHICINGA.net.wcupa.edu mysql-prepare-db-dir[1060]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
May 30 10:37:14 NETGRAPHICINGA.net.wcupa.edu mysql-prepare-db-dir[1060]: If this is not the case, make sure the /var/lib/mysql is empty before running mysql-prepare-db-dir.
May 30 10:37:14 NETGRAPHICINGA.net.wcupa.edu mysqld[1328]: 2023-05-30 10:37:14 0 [Note] /usr/libexec/mysqld (mysqld 10.3.35-MariaDB) starting as process 1328 …
May 30 10:37:15 NETGRAPHICINGA.net.wcupa.edu systemd[1]: Started MariaDB 10.3 database server.



[root@NETGRAPHICINGA icinga2]# mysql -u icinga -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1605
Server version: 10.3.35-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> USE icinga
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [icinga]> show grants for icinga@localhost;
±--------------------------------------------------------------------------------------------------------------+
| Grants for icinga@localhost |
±--------------------------------------------------------------------------------------------------------------+

2 rows in set (0.000 sec)

------------------------------------------------------------------------------------------------------------MariaDB [icinga]> SHOW TABLES;
±---------------------------------------+
| Tables_in_icinga |
±---------------------------------------+
| icinga_acknowledgements |
| icinga_commands |
| icinga_commenthistory |
| icinga_comments |
| icinga_configfiles |
| icinga_configfilevariables |
| icinga_conninfo |
| icinga_contact_addresses |
| icinga_contact_notificationcommands |
| icinga_contactgroup_members |
| icinga_contactgroups |
| icinga_contactnotificationmethods |
| icinga_contactnotifications |
| icinga_contacts |
| icinga_contactstatus |
| icinga_customvariables |
| icinga_customvariablestatus |
| icinga_dbversion |
| icinga_downtimehistory |
| icinga_endpoints |
| icinga_endpointstatus |
| icinga_eventhandlers |
| icinga_externalcommands |
| icinga_flappinghistory |
| icinga_host_contactgroups |
| icinga_host_contacts |
| icinga_host_parenthosts |
| icinga_hostchecks |
| icinga_hostdependencies |
| icinga_hostescalation_contactgroups |
| icinga_hostescalation_contacts |
| icinga_hostescalations |
| icinga_hostgroup_members |
| icinga_hostgroups |
| icinga_hosts |
| icinga_hoststatus |
| icinga_instances |
| icinga_logentries |
| icinga_notifications |
| icinga_objects |
| icinga_processevents |
| icinga_programstatus |
| icinga_runtimevariables |
| icinga_scheduleddowntime |
| icinga_service_contactgroups |
| icinga_service_contacts |
| icinga_servicechecks |
| icinga_servicedependencies |
| icinga_serviceescalation_contactgroups |
| icinga_serviceescalation_contacts |
| icinga_serviceescalations |
| icinga_servicegroup_members |
| icinga_servicegroups |
| icinga_services |
| icinga_servicestatus |
| icinga_statehistory |
| icinga_systemcommands |
| icinga_timeperiod_timeranges |
| icinga_timeperiods |
| icinga_zones |
| icinga_zonestatus |
±---------------------------------------+
61 rows in set (0.001 sec)

Could you reformat you post for better readability?

But in the meanwhile just some things to consider:

  • Your icinga2 can’t connect to the mysql/mariadb database via the ido feature
    • check username/password/port/host in the ido config file
  • The ido feature is deprecated
    • IcingaDB is the new way to go

Best Regards

Thank you very much for the feedback. I hope the changes I made provide more readability. I did keep the command output the same.

I will look into the database items that you mentioned. Thanks!