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

CheckCommand broken because plugin is not in PluginDir or PluginContribDir #10154

Open
phibos opened this issue Sep 12, 2024 · 0 comments
Open
Labels
area/itl Template Library CheckCommands

Comments

@phibos
Copy link

phibos commented Sep 12, 2024

Describe the bug

By default PluginDir and PluginContribDir are set to /usr/lib/nagios/plugins.

set(ICINGA2_PLUGINDIR "/usr/lib/nagios/plugins" CACHE STRING "Path for the check plugins")

As long as I install my plugins manually into the plugin directory everything works fine. But if I use the packaged plugins shipped with the distributions I get into trouble because Debian and Ubuntu seem to change the location of some plugins.

btrfs check command

The btrfs check command is defined as:

object CheckCommand "btrfs" {
	import "plugin-check-command"
	command = [ "sudo", PluginContribDir + "/check_btrfs" ]

Source:

command = [ "sudo", PluginContribDir + "/check_btrfs" ]

Debian

/usr/lib/nagios-btrfs/plugins/check_btrfs

rabbitmq

Currently not in the ITL

On Ubuntu the path changes.

Ubunut 20.04, 22.04, 24.04: /usr/lib/nagios/plugins-rabbitmq/
Ubuntu 24.10: /usr/bin

Source: https://packages.ubuntu.com/noble/nagios-plugins-rabbitmq

Debian 11: /usr/lib/nagios/plugins-rabbitmq
Debian 12: /usr/bin/

To Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include configuration, logs, etc. to reproduce, if relevant.

Install icinga on the system and use the check command

Expected behavior

Find the right location of the check_command binary

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version): latest
  • Operating System and version: Linux (Debian, Ubuntu, ...)

Additional context

The to check plugins are only examples there might be more. Do you have any advice/idea how to fix this issue? Should we introduce additional constants for every check command in the constants.conf? https://github.com/Icinga/icinga2/blob/8beb0b74ab9f8402abf4a05b9b768d312304e3f0/etc/icinga2/constants.conf.cmake like in the example below.

const PluginContribDir = "/usr/lib/nagios/plugins/"
const PluginBtrfsDir = "/usr/lib/nagios-btrfs/plugins/"

Or is this something the user has to deal with. In this case I think it would be better to not ship the predefined check commands in the ITL and create an additional repository for additional check command examples.

@Al2Klimov Al2Klimov added the area/itl Template Library CheckCommands label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands
Projects
None yet
Development

No branches or pull requests

2 participants