Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2.03k stars 578 forks source link

Make OS facts available in the icinga check #7751

Open dnsmichi opened 4 years ago

dnsmichi commented 4 years ago

Story

We have a powerful version detection for Linux, Unix and Windows (the latter needs a patch with #7743) but we do not expose them anywhere else than with icinga2 --version. With running satellites and agents, we could expose these small facts e.g. with the icinga check in the first iteration.

Following iterations may include inventory tasks, or thresholds.

Desired Solution

        os << "System information:\n"
                << "  Platform: " << Utility::GetPlatformName() << "\n"
                << "  Platform version: " << Utility::GetPlatformVersion() << "\n"
                << "  Kernel: " << Utility::GetPlatformKernel() << "\n"
                << "  Kernel version: " << Utility::GetPlatformKernelVersion() << "\n"
                << "  Architecture: " << Utility::GetPlatformArchitecture() << "\n";

Questions

Discussion on Twitter: https://twitter.com/dnsmichi/status/1217052451725041664

dnsmichi commented 4 years ago

The inventory ideas are tracked in the draft concept in #7814, out of scope for this issue.

Al2Klimov commented 2 weeks ago

I consider this is especially useful for, like, https://icinga.com/blog/2024/11/04/icinga2-security-pre-announcement/ where you want to monitor whether all nodes have been upgraded to vX.Y.Z. CC @yhabteab https://github.com/Icinga/icinga2/pull/7819#pullrequestreview-2420456253

julianbrost commented 2 weeks ago

@Al2Klimov You might want to have a look at the icinga_min_version input variable of the built-in icinga check command: https://icinga.com/docs/icinga-2/latest/doc/10-icinga-template-library/#icinga

Al2Klimov commented 2 weeks ago

There's no analogy for the OS version, though.

slalomsk8er commented 2 weeks ago

@julianbrost icinga_min_version doesn't work if a check against >= 2.14.3, 2.13.10, 2.12.11, and 2.11.12 is required after Tuesday 12th November 2024 between 13:00 and 15:00 UTC.

oxzi commented 2 weeks ago

@slalomsk8er: Could you please elaborate? I have just created a service check for the "icinga" check command in my test setup, setting vars.icinga_min_version = "2.14.3". As expected, the check went critical with the following message:

Icinga 2 has been running for 2 minutes and 28 seconds. Version: v2.14.0-334-ge894e45d6; Minimum version 2.14.3 is not installed.

If you want to check against all these patch versions, the "icinga" check command does not work. However, is having different Icinga 2 versions in a setup a realistic setup?

Al2Klimov commented 2 weeks ago

However, is having different Icinga 2 versions in a setup a realistic setup?

Oh, hi! You must be new here. 😊 /s

We even officially support that satellites may have one lower major version than masters and so on. In large setups, one does not simplyTM upgrade all stuff to Icinga vX. Just ask Eric for how old Icinga versions customers use according to recent tickets. πŸ™ˆ

But yes, "having different Icinga 2 versions in a setup" isn't a perfect setup.

slalomsk8er commented 2 weeks ago

@oxzi sadly yes I hope that I can get rid of some old versions, now that new packages for EOL OSs get released. I still think Icinga GmbH could ask for money for new packages of current releases on EOL OSs ;)

oxzi commented 2 weeks ago

Even if derailing this issue, maybe check if all packages are updated then? But yes, having a more specific "icinga" check would be good, e.g., allowing checks against a minor version or a range of versions.

Al2Klimov commented 2 weeks ago

@lippserd!!1 Give this man a medal. (Srsly. Even if you want a new PHP. Just the agent may be enough for some old-OS boxes.)

Icinga GmbH could ask for money for new packages of current releases on EOL OSs

Won't work for https://icinga.com/blog/2024/11/04/icinga2-security-pre-announcement/, though. πŸ˜