Error on running check plugin: No such file or directory

Hello Icinga Community,
I am currently getting a strange error when trying to set up a monitoring plugin.
The plugin is located under the following path

/usr/lib64/nagios/plugins/systemd-units-failed

When I run the plugin via the CLI everything works fine

/usr/lib64/nagios/plugins/systemd-units-failed
Everything is ok.|'systemd-units-failed'=0;1;;0;

When I try to call the plugin via Icinga I get the error message

execvpe(/usr/lib64/nagios/plugins/systemd-units-failed) failed: No such file or directory

My command looks like this

object CheckCommand "cmd-check-systemd-units-failed" {
    import "plugin-check-command"
    command = [ "/usr/lib64/nagios/plugins/systemd-units-failed" ]
    timeout = 10s
    arguments += {
        "--always-ok" = {
            set_if = "$systemd_units_failed_always_ok$"
        }
        "--ignore" = {
            repeat_key = true
            value = "$systemd_units_failed_ignore$"
        }
    }
}

Maybe someone has an idea where I made a mistake or what is causing the error.

Best regards

Felix

  • Version used (icinga2 --version): r2.13.2-1
  • Operating System and version: Ubuntu 20.04.4 LTS

Sounds like a permission error if you ran this command as root. icinga executes it as nagios or icinga (depending on your distribution).

If I execute the script via the CLI as user nagios, it also works. I had checked the permissions.

sudo -u nagios /usr/lib64/nagios/plugins/systemd-units-failed
Everything is ok.|'systemd-units-failed'=0;1;;0;

Habe you double checked that the Script exists in the correct directory on the definetely host where it should be executed? Maybe add Screenshots of the directory and Web gui

Yes, I double-checked that. It is definitely the correct host as the check source and the scripts are in the correct directory and can be executed via the CLI.

thanks for the awesome information.