Linux Server Service Checks with Python

Hi all,

I am trying to find out how to add some Service Checks for my MGMT-VM which is an Ubuntu Server. Some templates for Windows are not available for Linux as I have found out, for example the Windows-Traffic Check. From what I have heard and read so far is, that I would have to write a Check from scratch on my own.

Some say Python would be the best way to go. But I do not know how to start, where to start or even how I would fetch the needed data and let it be displayed in ICINGA itself.

Does anyone have a Tip or a quickstart guide for these items?

With kind regards,
MusicBoy

Have a look at the @linuxfabrik monitoring-plugins. Maybe you can find the right checks or even sets of checks with templates or at least some inspiration on how to write your own. There are even guidelines that should help improving the quality of your self written plugins.

Icinga 2 executes check commands on the monitored server. These check commands do the actual check, returning back the check state, some text, and potentially performance metrics.

To be able to execute the check commands, Icinga 2 requires a CheckCommand object which defines which command should be executed and its parameters. However, lots of predefined CheckCommands are already shipped with an Icinga 2 installation as part of the Icinga Template Library.

This is further described in the Monitoring Basics, Commands documentation section. Further details are available in the Service Monitoring section. Please take your time reading these sections, also containing examples in Python. In parallel, there are lots good examples out there, as for example @rivad’s suggestion or on https://exchange.icinga.com/.

1 Like