MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

icinga2: How to install icinga2 plugins in Linux?

Installing Icinga2 plugins on a Linux system enables you to extend the monitoring capabilities of Icinga2 by adding checks for various services and metrics. Here's how you can install Icinga2 plugins step-by-step:

Step 1: Install Icinga2
Ensure that Icinga2 is already installed on your system. If not, you can install it using the commands mentioned in the previous answer for either Ubuntu/Debian or CentOS/RHEL systems.

Step 2: Install the Monitoring Plugins
Most Icinga2 installations use the Monitoring Plugins (formerly Nagios Plugins) package, which provides a standard set of checks. Install them as follows:

For Ubuntu/Debian:
sudo apt update
sudo apt install monitoring-plugins

For CentOS/RHEL:
sudo yum install epel-release
sudo yum install nagios-plugins-all

Step 3: Install Additional Plugins
You might need more specific plugins than those provided by the default Monitoring Plugins package. You can find additional plugins at the Icinga Exchange or other repositories like GitHub.

To install a plugin from a source other than the package manager:

Download the plugin script (usually a .sh or .pl file).
Make the script executable and place it in the plugins directory (typically /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins depending on your architecture).

For example:
sudo wget -O /usr/lib/nagios/plugins/check_example.sh https://example.com/plugins/check_example.sh
sudo chmod +x /usr/lib/nagios/plugins/check_example.sh

Step 4: Test the Plugin
Before using the plugin with Icinga2, test it directly from the command line to ensure it works as expected:


/usr/lib/nagios/plugins/check_example.sh -option1 -option2
Replace check_example.sh with your plugin and adjust the options according to the plugin’s requirements.

Step 5: Configure Icinga2 to Use the Plugin
Create a new command definition in Icinga2 for the plugin. This involves editing the configuration files found in /etc/icinga2/conf.d or wherever you manage your Icinga2 configurations.

Here’s an example command definition for a custom plugin:

object CheckCommand "check-example" {
    import "plugin-check-command"
    command = [ PluginDir + "/check_example.sh" ]
    arguments = {
        "-option1" = "$arg1$"
        "-option2" = "$arg2$"
    }
}
Step 6: Add the Check to a Host or Service
Now, apply the new command to a host or service object. For example, to monitor a service using your new plugin:

apply Service "example-service" {
    import "generic-service"
    check_command = "check-example"
    vars.arg1 = "value1"
    vars.arg2 = "value2"
    assign where host.name == "YourHost"
}
Step 7: Reload Icinga2
After adding the new configuration, reload Icinga2 to apply changes:

sudo systemctl reload icinga2
Step 8: Verify the Configuration

Finally, verify that the new plugin is working correctly through the Icinga Web 2 interface or by checking the Icinga2 logs for any errors.

This completes the installation and configuration of new Icinga2 plugins on your Linux system.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Linux Interview Questions and Answer – Part 11

It is common for source packages to be downloaded to which directory? /src /usr/src (Ans) /home /usr/bin Using lsof which character is used to filter by host…

Read More

Public Package Repositories by Programming Language

Public Package Repositories by Programming Language Public package repositories (also known as package registries, artifact repositories or dependency repositories) allow developers to publish, discover, download and manage…

Read More

How to install Ansible in Centos 7/RHEL 7?

On CentOS 7 or RHEL 7 you can install Ansible in two ways: with yum from the EPEL repository, which gives you Ansible 2.9, or with pip…

Read More

Major programming languages, the common package tool(s), and the central community package repository.

Most programming languages pair a command-line package tool with a public registry it downloads dependencies from. Examples are cargo with crates.io, pip with PyPI, Maven with Maven…

Read More

How to Install Nagios XI from Tarball and Set Up Client Monitoring Paths

This revised guide walks through a practical Nagios XI server installation using the tarball/fullinstall method from the original post, then shows how to validate access and plan client monitoring. It also adds a clear workflow diagram, command examples, and a comparison of common client check methods.

Read More

Install Subversion (SVN) on Linux: Package Install, Source Build, Apache Setup, and Authentication

Learn how to install Subversion on Linux, create a repository, and publish it through Apache with user authentication. This revised guide includes both package-based and legacy source-build paths with practical commands.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x