Page 1 of 2

Need help on how to install and configure plugins

Posted: Wed Apr 03, 2019 8:59 am
by nib01
Ive installed and configured Nagios core plus pnp4nagios add-on, so far all the default plugins seems to be working only with the system host resources.
Found this page about plugins that can be used to monitor the VMFS of a virtual machine in my case /var/lib/jenkins type ext4 (rw).
https://exchange.nagios.org/index.php?o ... rd=proxmox

I cant find a template to use as reference when configuring above plugins in the command.cfg file?

Re: Need help on how to install and configure plugins

Posted: Thu Apr 04, 2019 1:46 pm
by cdienger
Are you working with a specific plugin? The first thing to do once you have a plugin is to make sure that you're able to run it and determine what parameters(if any) are needed to get the information you want. Using check_ping as an example:

Code: Select all

define command {
    command_name    check_ping
    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}
-H, -w, -c, and -p are all arguments that the check_ping plugin accepts. $USER1$, $HOSTADDRESS, $ARG1$, and $ARG2$ are marcos that are filled in when the command is run. It would be like running this from the commandline:

/usr/local/nagios/libexec/check_ping -H ip_address -w 80 -c 90 -p 5

The host or service definition would run it with something like:

Code: Select all

define host {
    host_name                test
    address                  1.2.3.4
    check_command            check_ping!80!90!!!!!!
    max_check_attempts       1
    check_interval           1
    retry_interval           1
    active_checks_enabled    1
    check_period             24x7
    contacts                 admin
    notification_period      24x7
    notifications_enabled    0
    register                 1
}

Re: Need help on how to install and configure plugins

Posted: Thu Apr 04, 2019 3:28 pm
by nib01
Yes, we have hundreds of ProxMox VMs running with different type of applications we want to monitor the VM's disk-mount (/var/lib/jenkins type ext4 (rw)) . I was told that I can use a plugin as below, but not really sure what are the parameters (command syntax to use) and configure which config file, locations, etc.

https://exchange.nagios.org/directory/P ... xc/details

Re: Need help on how to install and configure plugins

Posted: Fri Apr 05, 2019 10:36 am
by swolf
The plugin you linked doesn't appear to use the network in any way, so it will need to be run on each of these VMs. You will need to install an agent of some sort (we recommend NCPA if possible) on each of your VMs. Then, you will need to configure your plugin as a command within the agent. For NCPA, this just means putting the check_disk_on_lxc script into /usr/local/ncpa/plugins, and making sure it can be executed by the nagios user. Then, on your Nagios Core machine, you'll need to set up a check for your agent to actually run the plugin. For NCPA, you can follow the instructions here to get that set up.

Lastly, if you have hundreds of VMs you're trying to monitor, I would recommend making use of templates or possibly some 3rd-party deployment software (Ansible, Jenkins, etc.) to manage your Nagios Core configuration, though that's ultimately up to you.

Re: Need help on how to install and configure plugins

Posted: Mon Apr 08, 2019 6:26 pm
by nib01
Hi,
Do you have any step-by-step instructions or video tutorial on how to setup/install and configure steps below?
1)You will need to install an agent of some sort (we recommend NCPA if possible) on each of your VMs.
2)Then, you will need to configure your plugin as a command within the agent.
3)For NCPA, this just means putting the check_disk_on_lxc script into /usr/local/ncpa/plugins, and making sure it can be executed by the nagios user.
4)Then, on your Nagios Core machine, you'll need to set up a check for your agent to actually run the plugin.
5)For NCPA, you can follow the instructions here to get that set up.

Also, how can I install check_ncpa.py plugin in to nagios core -->/use/local/nagios/libexec

Re: Need help on how to install and configure plugins

Posted: Tue Apr 09, 2019 4:40 pm
by ssax
1) 2)

Please see here:

https://assets.nagios.com/downloads/ncp ... g-NCPA.pdf

And here:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

3) Put the plugin in /usr/local/ncpa/plugins, then if on Linux/Unix, run these commands:

Code: Select all

chown nagios.nagios /usr/local/ncpa/plugins/yourpluginname.sh
chmod +x /usr/local/ncpa/plugins/yourpluginname.sh
Then restart the NCPA services.

4) See here:

https://assets.nagios.com/downloads/nag ... ndows.html

5) See here to help with 4)

https://www.nagios.org/ncpa/help.php?#a ... the-plugin
Also, how can I install check_ncpa.py plugin in to nagios core -->/use/local/nagios/libexec
Do this:

Code: Select all

cd /tmp
wget https://assets.nagios.com/downloads/ncpa/check_ncpa.tar.gz
tar xvf check_ncpa.tar.gz
chown nagios:nagios check_ncpa.py
chmod 775 check_ncpa.py
mv check_ncpa.py /usr/local/nagios/libexec

Re: Need help on how to install and configure plugins

Posted: Fri Apr 12, 2019 12:15 pm
by nib01
As mentioned before Nagios core is what we currently have setup in our company. The link below is mainly for XI, and not sure if this guide would work with Nagios core?

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Need help on how to install and configure plugins

Posted: Fri Apr 12, 2019 2:32 pm
by npolovenko
@nib01, Sorry, you will not be able to use the wizard on the Nagios Core. Instead, you should use this tutorial to install the NCPA agent on a VM:
https://assets.nagios.com/downloads/ncp ... g-NCPA.pdf

And then set up checks in Nagios Core using this tutorial:
https://assets.nagios.com/downloads/nag ... ndows.html

Please set up monitoring for 1 VM first and let me know if all standard checks from the article are working. When they are, let me know and I will update you with further instructions to set up your custom plugin.

Re: Need help on how to install and configure plugins

Posted: Tue Apr 16, 2019 12:54 pm
by nib01
We do not have any Windows VM currently installed in our lab, instead I tried using a Linux VM to install NCPA agent on VM.

Apparently the url you've provided below for setting up checks in Nagios core is for Windows.
https://assets.nagios.com/downloads/nag ... ndows.html

Re: Need help on how to install and configure plugins

Posted: Tue Apr 16, 2019 2:59 pm
by npolovenko
@nib01, This article explains how to install NCPA agent on a Linux server and how to set up services on the Nagios Core server:
https://www.nagios.org/ncpa/getting-started.php#linux

----------------------------------------------------------------------------------------------------------------------------------------------------

Or you can install NRPE agent on a Linux server instead of the NCPA. Here's the instruction on how to install it:
https://support.nagios.com/kb/article.php?id=8

And this article explains how to set up service definitions on the Nagios Core server for NRPE:
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf

Let me know how it goes.