Need help on how to install and configure plugins

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Need help on how to install and configure plugins

Postby nib01 » Wed Apr 03, 2019 8:59 am

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?
nib01
 
Posts: 31
Joined: Tue Oct 09, 2018 9:31 am

Re: Need help on how to install and configure plugins

Postby cdienger » Thu Apr 04, 2019 1:46 pm

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
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3328
Joined: Tue Feb 07, 2017 11:26 am

Re: Need help on how to install and configure plugins

Postby nib01 » Thu Apr 04, 2019 3:28 pm

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
nib01
 
Posts: 31
Joined: Tue Oct 09, 2018 9:31 am

Re: Need help on how to install and configure plugins

Postby swolf » Fri Apr 05, 2019 10:36 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
User avatar
swolf
Developer
 
Posts: 95
Joined: Tue Jun 06, 2017 9:48 am

Re: Need help on how to install and configure plugins

Postby nib01 » Mon Apr 08, 2019 6:26 pm

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
nib01
 
Posts: 31
Joined: Tue Oct 09, 2018 9:31 am

Re: Need help on how to install and configure plugins

Postby ssax » Tue Apr 09, 2019 4:40 pm

1) 2)

Please see here:

https://assets.nagios.com/downloads/ncpa/docs/Installing-NCPA.pdf

And here:

https://assets.nagios.com/downloads/nagiosxi/docs/Monitoring-Devices-Using-The-NCPA-Agent-And-Nagios-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/nagioscore/docs/nagioscore/4/en/monitoring-windows.html

5) See here to help with 4)

https://www.nagios.org/ncpa/help.php?#active-using-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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4108
Joined: Wed Feb 11, 2015 12:54 pm

Re: Need help on how to install and configure plugins

Postby nib01 » Fri Apr 12, 2019 12:15 pm

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
nib01
 
Posts: 31
Joined: Tue Oct 09, 2018 9:31 am

Re: Need help on how to install and configure plugins

Postby npolovenko » Fri Apr 12, 2019 2:32 pm

@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/ncpa/docs/Installing-NCPA.pdf

And then set up checks in Nagios Core using this tutorial:
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/monitoring-windows.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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Need help on how to install and configure plugins

Postby nib01 » Tue Apr 16, 2019 12:54 pm

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
nib01
 
Posts: 31
Joined: Tue Oct 09, 2018 9:31 am

Re: Need help on how to install and configure plugins

Postby npolovenko » Tue Apr 16, 2019 2:59 pm

@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/nagioscore/docs/nrpe/NRPE.pdf

Let me know how it goes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
 
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 13 guests