Remote command execution uses partially wrong path after crash

Hi there!
This one is a bit complicated.
I inherited an Icinga2 installation, which is not 100% installed after the book. And I’m rather new to Icinga, too.
Short time ago, we had a crash, which made us recover several client systems.
Now I have the strange situation, that some of the monitor scripts do work as before and some use another (wrong) path and fail. On the same client system.
Usually our monitor scripts reside in /usr/local/lib/nagios/plugins, to keep out from possible other installations.
Now, the failing ones ask for scripts in /usr/lib//nagios/plugins - which is empty or does not exist at all.

Can you please help me and tell me, how to fix this?

I know how to roll out our scripts (new ones), but these seem to be more the ‘stock’ ones, like ‘check_tcp’ (is one of them). - I have the impression, that they have to be installed differently. - Is it possible, that they must reside in /usr/lib/nagios/plugins ?

We do not use zones and it worked before… and AFAIK, no changes on the master server were made.

Best regards,
Herbert

These plugins does not come from icinga resp. are not installed by icinga but from your linux distribution. E.g. Debian/Ubuntu provides monitoring-plugins packages and other distributions does the same but may use different package names.

2 Likes

For example on Ubuntu, the default-path for the plugins is
/usr/lib/nagios/plugins

See
/etc/icinga2/constants.conf
where the constants PluginDir and PluginContribDir are defined, e.g.:

const PluginDir = "/usr/lib/nagios/plugins"
const PluginContribDir = "/usr/lib/nagios/plugins"

These constants are commonly used in the CheckCommand definitions, e.g.:

object CheckCommand "disk" {
        command = [ PluginDir 

You can define additional plugin-paths. See here:
plugindir custom path

The defined constant (for the path) can then be used in your CheckCommand Definition (instead of PluginDir in the example above).

1 Like

Thank you all for your support!
I solved it on my own. - I found out, that we really make use of the scripts in /usr/lib/nagios/plugins and this directory was missing on the failing systems. - So I restored that and now everything works again.

Thank you all again!

Best regards,
Herbert