Hi there, I am new to the Icinga monitoring and trying to set up to monitor AWS env from cloudwatch, I have zero knowledge of this. Can someone point me to the appropriate docs or guide, please?
I get the following error while performing any action from the icinga dashboard icinga2: Can’t connect to the Icinga 2 API: 0 cURL error 7: Failed to connect to localhost port 5665 after 0 ms: Connection refused (see libcurl - Error Codes)
in icingaweb2 the module responsible for monitoring is either “monitoring” or icingadb.
in one or both of these modules there is a configuration page for a transport layer.
there you have to fill out a icinga2 api user
I’m not sure I understand “icinga dashboard icinga2” but as @moreamazingnick mentioned, you need to setup the Icinga2 API and tell Icingaweb2 and possibly others the credentials for the error to go way.
Thanks for getting back. Unfortunately, we encountered another issue while setting up the Icinga web. while setting up with the DB resource we get this message: The database you've configured to use for Icinga Web 2 seems to be the one of Icinga. Please be aware that this database configuration is supposed to be used for Icinga Web 2's configuration and that it is highly recommended to not mix different schemas in the same database. If this is intentional, you can skip the validation and ignore this warning. If not, please provide a different database.
We have created an entirely new DB named icingaweb but still that message pops out. not sure if we have missed anything.
To add more we get the below message after finishing up the setup:
General configuration has been successfully written to: /etc/icingaweb2/config.ini
Authentication configuration has been successfully written to: /etc/icingaweb2/authentication.ini
Account "icinga2" has been successfully defined as initial administrator.
User Group Backend configuration has been successfully written to: /etc/icingaweb2/groups.ini
Unable to create user group "Administrators". An error occured:
ERROR: Zend_Db_Statement_Exception in /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php:225 with message: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "icingaweb_group" does not exist
LINE 1: SELECT COUNT(*) AS cnt FROM icingaweb_group AS g WHERE (g.na...
^, query was: SELECT COUNT(*) AS cnt FROM icingaweb_group AS g WHERE (g.name = 'Administrators')
Resource configuration has been successfully written to: /etc/icingaweb2/resources.ini
Monitoring backend configuration has been successfully written to: /etc/icingaweb2/modules/monitoring/backends.ini
Resource configuration has been successfully updated: /etc/icingaweb2/resources.ini
Command transport configuration has been successfully created: /etc/icingaweb2/modules/monitoring/commandtransports.ini
Monitoring security configuration has been successfully created: /etc/icingaweb2/modules/monitoring/config.ini
Module "monitoring" could not be enabled. An error occured:
ERROR: Icinga\Exception\SystemPermissionException in /usr/share/php/Icinga/Application/Modules/Manager.php:295 with message: Cannot enable module "monitoring". Check the permissions for the enabledModules directory: /etc/icingaweb2/enabledModules
What is your /etc/icingaweb2/resources.ini looking like? Mine looks like this:
[icinga_web2]
type = "db"
db = "mysql"
host = "host"
port = "3306"
dbname = "icinga_web2"
username = "icinga"
password = "PW"
charset = "utf8mb4"
[icinga_ido]
type = "db"
db = "mysql"
host = "host"
port = "3306"
dbname = "icinga_ido"
username = "icinga"
password = "PW"
use_ssl = "0"
The first one if for Icingaweb2 and the second one is the one Icinga uses.
If you fixed the config but the error still persists, maybe there are leftover tables in the icinga_ido DB.
Looks to me that something went wrong with the schema creation or when you added the icingaweb2 db to the same schema.
As you are still setting up and have no data to loose, I would just wipe the DB and rebuild the schema according to the step in the installation instruction.
Also, do you use the now IcingaDB or the IDO DB like I do?
Thank you Dominik, finally a refresh install with IDO DB marks a successful deployment of the application.
Now coming back to the first question, I would like to monitor the AWS ec2 instance without installing any agents on any of the hosts, is this possible by any chance?
Do you have a Icinga2 agent on your aws instances? If not, this approach can’t work!
I would try to use a check against the AWS API to get this data and put the service using the check into the template of the hosts that the Director creates from the icingaweb2 aws module import source.
alternatively you can try to use SNMP or automate the installation of the Icinga2 agent on your AWS hosts.