Page 1 of 1

NagiosXi - Commands & Plugins

Posted: Fri Aug 21, 2020 9:27 am
by Bala.Mutyam
Hi,

Is it possible to run NagiosXi built-in commands/plugins on remote hosts with NCPA agents? I'm trying but giving below error.

Service Definition:

Code: Select all

define service {
    host_name                host
    service_description      Process Count
    check_command            check_procs!550!1000
    max_check_attempts       2
    check_interval           5
    retry_interval           1
    check_period             24x7
    notification_interval    15
    notification_period      24x7
    notifications_enabled    1
    contact_groups           Linux-Alerts
    register                 1
}
Error Message:

Code: Select all

check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid] [-j jid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-X process_to_exclude] [-k] [-t timeout] [-v]
Command definition:

Code: Select all

define command {
    command_name    check_procs
    command_line    $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
}

Re: NagiosXi - Commands & Plugins

Posted: Mon Aug 24, 2020 10:09 am
by jbrunkow
Yes, you should be able to run the same plugins from NCPA (on Linux) that you do from XI. However, the same plugins may not be present in NCPA that are in XI. If you find that you need to install them, you will need to compile them as well.

I should probably mention that you can also pull this data using the API in NCPA. Please have a look at the document linked below as I think this may be a better solution for you.
API processes

I think your output indicates that the plugin exists on the system, but the usage is probably not correct. What is in the three arguments in the command definition of XI? Did you input all of those values when you ran the plugin from the NCPA machine? What is the exact command you submitted?

You can usually use the -h option to see all of the options for a given plugin. Maybe there's a required argument that we're missing.

Code: Select all

check_procs -h
If you have more questions, please take a look at the knowledgebase article linked below.
Nagios XI - Using Scripts / Plugins With NCPA

Re: NagiosXi - Commands & Plugins

Posted: Thu Aug 27, 2020 3:05 am
by Bala.Mutyam
@jbrunkow: Hi, thanks for the update. I'm trying run the checks without installing plugins and it seems to be not possible without it.

Re: NagiosXi - Commands & Plugins

Posted: Thu Aug 27, 2020 4:28 pm
by jbrunkow
Yes, the plugin will have to be present on the machine trying to run the check.

Have you tried using the API? I believe you can query for the same information from NCPA this way without needing to install the plugin on each one.
API processes