sensu-plugins / sensu-plugin

A framework for writing Sensu plugins & handlers with Ruby.
http://sensuapp.org
MIT License
126 stars 117 forks source link

Utils::config_files is incompatible with Sensu 2.0 #194

Closed barryorourke closed 5 years ago

barryorourke commented 5 years ago

Utils::config_files() assumes the existence of /etc/sensu/config.json and /etc/sensu/conf.d, these are not present by default when using Sensu 2.0.

jspaleta commented 5 years ago

Not sure this is actually an issue here. Can you give me a reproducible? I just spent a few minutes poking around trying to an unhandled exception and couldn't.

Util::config_files makes some fallback assumptions about where the config files live and will return /etc/sensu/config as a fallback location of last resort even if /etc/sensu doesn't exists and the envvar to override the paths to use isn't set. But that's fine.

Everything inside the scope of Utils uses Util::load_config()
which has a catchall rescue so a file is unreadable it effectively just gets skipped.

The default locations are still reasonable even if they don't exist by default, there are several handlers that look in the settings hash..populated by load_config.. for a particular top level key that holds their configuration.

barryorourke commented 5 years ago

TBH, I discovered this as part of my work on sensu-plugin-python where it was causing issues. I only had a quick look over the Ruby code and assumed that the issue would affect this as well. If you are happy that it won't be an issue please close the issue :)

annaplotkin commented 5 years ago

We believe this to be a non-issue. Closing but please feel free to re-open if it occurs.