error while defining arguments for ncpa in NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sajid4u2c
Posts: 46
Joined: Thu Mar 15, 2018 10:55 am

error while defining arguments for ncpa in NagiosXI

Post by sajid4u2c »

Hi All,

I have installed NCPA agent in linux sever and I am trying to use check_logfile plugin for searching the particular pattern in log file

check_logifle plugin I have copied from : https://labs.consol.de/nagios/check_log ... l#download and placed in the plugin folder of ncpa in Linux server

In the destination server the below command is giving the exact output I am looking for:

Code: Select all

./check_logfiles.sh  --logfile=/tmp/test/test1.txt --criticalpattern='hello world'

Code: Select all

output : no eror found ….etc.,
While configuring in NagiosXI, I have used the below command

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <host> -P 5693 -t 'token' -M /plugin/check_logfiles.sh  -a " --logfile=/tmp/test/test1.txt --criticalpattern='hello world' "
But it is giving me the error:

Code: Select all

     "returncode": 3,
    "stdout": "Option logfile requires an argument 
Please help in defining the exact command in NagiosXI to call the script and execute .

Below is the entry in ncpa.cfg for .sh files:

Code: Select all

[code][plugin directives]
plugin_path = plugins/
.sh = /bin/sh $plugin_name $plugin_args
[/code]
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: error while defining arguments for ncpa in NagiosXI

Post by mbellerue »

The first thing that jumps out at me from the Consol Labs page is that it specifically warns about running the plugin as an unprivileged user. When you tested the plugin on the server you want to monitor, did you run the plugin as the nagios user, using su - to switch to the nagios user?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
sajid4u2c
Posts: 46
Joined: Thu Mar 15, 2018 10:55 am

Re: error while defining arguments for ncpa in NagiosXI

Post by sajid4u2c »

Thanks. Those file permissions were checked and all were normal with Nagios user configured.

Seems problem was in passing the arguments.

The below command is now working and I am able to run . Thanks. Thread can be closed.


-t 'mytoken' -P 5693 -M 'plugins/check_logfiles.sh' -a " --logfile='/tmp/test.log' --criticalpattern="annotation event""
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: error while defining arguments for ncpa in NagiosXI

Post by scottwilkerson »

sajid4u2c wrote:Thanks. Those file permissions were checked and all were normal with Nagios user configured.

Seems problem was in passing the arguments.

The below command is now working and I am able to run . Thanks. Thread can be closed.


-t 'mytoken' -P 5693 -M 'plugins/check_logfiles.sh' -a " --logfile='/tmp/test.log' --criticalpattern="annotation event""
Great!

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked