Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set Redis socket path in icingadb::redis_host #42

Open
trauta opened this issue Sep 24, 2024 · 4 comments
Open

Unable to set Redis socket path in icingadb::redis_host #42

trauta opened this issue Sep 24, 2024 · 4 comments

Comments

@trauta
Copy link

trauta commented Sep 24, 2024

Hi,

I want the IcingaDB daemon to connect to the redis instance via UNIX socket, however when setting the path via the icingadb::redis_host parameter I get the following error which indicates that the parameter only accepts a valid host or IP address.

Is there any way to use a socket based connection?

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Class[Icingadb]: parameter 'redis_host' expects a Stdlib::Host = Variant[Stdlib::Fqdn = Pattern[/\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/], Stdlib::Compat::Ip_address = Variant[Stdlib::Compat::Ipv4 = Pattern[/^((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?$/], Stdlib::Compat::Ipv6 = Pattern[/\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/]]] value, got String
@lbetz
Copy link
Contributor

lbetz commented Sep 25, 2024

I'm not sure... can you use an UNIX socket in the IcingaDB feature of Icinga 2?
https://icinga.com/docs/icinga-2/latest/doc/09-object-types/#icingadb

@trauta
Copy link
Author

trauta commented Sep 27, 2024

Yes you can, it is documented here: https://icinga.com/docs/icinga-db/latest/doc/03-Configuration/#redis-configuration

~# grep -A 1 'redis:' /etc/icingadb/config.yml 
redis:
  host: /run/icingadb-redis/icingadb-redis-server.sock

~# journalctl -e -u icingadb | tail -n 2
Sep 27 09:21:05  icingadb[339628]: Connecting to Redis at '/run/icingadb-redis/icingadb-redis-server.sock'
Sep 27 09:21:05  icingadb[339628]: Starting history sync

@lbetz
Copy link
Contributor

lbetz commented Sep 30, 2024

I've looked at it and I'm not going to implement it.

The reason for this is that authorization problems occur when interacting with puppet-icinga2 and puppet-icingaweb2. Access to sockets would then have to be regulated via group memberships, which are very difficult to implement in Puppet.

@lbetz
Copy link
Contributor

lbetz commented Sep 30, 2024

Yes you can, it is documented here: https://icinga.com/docs/icinga-db/latest/doc/03-Configuration/#redis-configuration

~# grep -A 1 'redis:' /etc/icingadb/config.yml 
redis:
  host: /run/icingadb-redis/icingadb-redis-server.sock

~# journalctl -e -u icingadb | tail -n 2
Sep 27 09:21:05  icingadb[339628]: Connecting to Redis at '/run/icingadb-redis/icingadb-redis-server.sock'
Sep 27 09:21:05  icingadb[339628]: Starting history sync

Ireferred to the icinga 2 documentary here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants