Problem with Plugins on new Icinga 2 server

I have a new VM running Ubuntu 24.04, Icinga 2 clean install okay with director. Install of linuxfabrik ok without errors.

Had a couple of issues with setting up the hosts, but that seems to be mostly resolved now, they’re in the system and talking to the server. And I have 3 services already setup which are automatically trying to run on each server, a simple ping, uptimerobot & disk usage. They’re all running but they’re getting a “file not found” error for each one.

Command /usr/lib64/nagios/plugins/uptimerobot --timeout 30 --url https://status.linuxfabrik.io failed to execute: 2, “The system cannot find the file specified.”<Terminated with exit code 127 (0x7F).>
Command /usr/lib64/nagios/plugins/ping --count 5 --hostname 127.0.0.1 --interval 0.200000 --timeout 5 failed to execute: 2, “The system cannot find the file specified.”<Terminated with exit code 127 (0x7F).>
Command C:\Program Files\icinga2\sbin\linuxfabrik\disk-usage.exe --critical 95%USED --warning 90%USED failed to execute: 2, “The system cannot find the file specified.”<Terminated with exit code 127 (0x7F).>

Is this because the host install on each failed at the end with an error regarding the linuxfabrik-monitoring-plugins.msi file not found or could not be opened ???

It was my understanding that the files should be getting downloaded from inside the installation script. (below)

[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11';
$ProgressPreference                         = 'SilentlyContinue';
[string]$ScriptFile                         = 'C:\Users\Public\IcingaForWindows.ps1';

Invoke-WebRequest `
    -UseBasicParsing `
    -Uri 'https://packages.icinga.com/IcingaForWindows/IcingaForWindows.ps1' `
    -OutFile $ScriptFile;

& $ScriptFile `
    -ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\' `
    -InstallCommand '{"IfW-DirectorSelfServiceKey":{"Values":["f024e252bcd908284d6dbfaa464ffcb8196a0718"]},"IfW-DirectorUrl":{"Values":["http://10.32.8.49/icingaweb2/director/"]}
}'; 

$pkg = "linuxfabrik-monitoring-plugins.msi"; # https://download.linuxfabrik.ch/monitoring-plugins/lfmp-2.1.1-1.signed-packaged.windows.x86_64.zip

Write-Host "[Notice]:" -ForegroundColor Green -NoNewline
Write-Host " Starting installation of $pkg"

$process = Start-Process msiexec.exe `
    -ArgumentList "/i `"$pkg`" /norestart /qn" `
    -Wait `
    -PassThru

$exitCode = $process.ExitCode

# Map common MSI exit codes
$messages = @{
    0    = "Success"
    1603 = "Fatal error during installation"
    3010 = "Success, reboot required"
    1618 = "Another installation is already in progress"
    1619 = "MSI file not found or could not be opened"
    1620 = "Invalid or corrupt MSI package"
}

if ($messages.ContainsKey($exitCode)) {
    switch ($exitCode) {
        0 {
            Write-Host "[Notice]:" -ForegroundColor Green -NoNewline
            Write-Host " MSI exited with code $exitCode ($($messages[$exitCode]))"
        }
        3010 {
            Write-Host "[Warning]:" -ForegroundColor White -NoNewline
            Write-Host " MSI exited with code $exitCode ($($messages[$exitCode]))"
        }
        default {
            Write-Host "[Error]:" -ForegroundColor Yellow -NoNewline
            Write-Host " MSI exited with code $exitCode ($($messages[$exitCode]))"
        }
    }
} else {
    Write-Host "[Warning]:" -ForegroundColor White -NoNewline
    Write-Host " MSI exited with unmapped code $exitCode"
}

No, the script doesn’t download the zip automatically.

I already answered why, in the other thread: Problem with new Icinga2 Server & Windows Setup - #13 by rivad

So it looks like most of the issues have been cleared. I’ve got 4 plugins working on 2 of the 3 host servers but I’m having issues with the original host. This is the one where I tried installing the agent normally first. I uninstalled that agent and I’ve run the script @rivad gave me twice, which ran successfully, no errors. But I’m still getting “jaz-fsvm is not connected to npbvmjazicinga” errors on each of the 4 checks.

How do I troubleshoot this on one host? Is there a script or program that will wipe/clear the host server of all things Icinga, so I can try it from scratch? The other 2 servers that were run with just the script are working fine. I’m about to add a few more hosts to see if it keeps working, but I need that original host working, it’s one of the most important I need to monitor.

How did you configure the host on the icinga server side? Maybe deleting it there, rerun the script and deploy the updated director configuration.

I’ve tried that, twice. The script runs without errors, but it still says “not connected” on the icinga server side. I even restarted the icinga server itself. No change.

I there a reason in the logs?

Sigh, I hate when I’m stupid.

I focused entirely on the host and forgot to delete it from the server side.

Let me see if that works this time…

That seems to have done it… I’m getting a bunch of “overdue” messages, even though I’ve clicked on “check now” for each of the 4 checks, but it’s not giving me the “not connected” error anymore.

Thank you for the assistance. I literally couldn’t have done this without you!

Don’t worry, I also had my problems in the beginning until I got the hang of the whole cluster thingy.

I even recruited the @linuxfabrik to get me started with the director on a HA setup - had a single master setup before and did the config by hand.

Ok, this is weird… it looked like it was going to be fine, but now all 4 are back in the “service problems” category with the “not connected” error again.

I don’t get it. They’re both using FQDN, same as the other 2 hosts that are working fine. The only difference with this one is that it’s the one I was using at first and had setup the full Icinga Powershell stuff on with the Icinga 2 agent. I uninstalled the agent in Control Panel, I don’t know any way to clean out the other stuff. Your script runs without errors except two places where it tries to install a file that already exists. The host can ping the server, can access the site, it’s not that. And when I deleted the host from the server, then reran the script on the host, it re-added the host to the host list on the server, so CLEARLY it’s “connected”. I don’t know why the service checks are giving that error.

Did you put it into the /etc/icinga2/zones.conf? If so clean it out and restart the icinga2 service.

On the server itself? I don’t think so, but let me check. I did a bunch of weird things when I was first trying to get this running…

Ok, it’s not in zones.conf. Any other location I should check? They’re clearly talking to each other.

I have 6 hosts setup now and only that one is the one giving errors. But again, it’s the one I didn’t initially setup with your script. Ugh…

If you execute icinga2 -V you get all paths.
But I would enable the debug log first and try to figure out, what’s wrong with with the connection, the scheduling or what ever.