Page 1 of 1

Can NCPA run remote .exe plugin ?

Posted: Wed Sep 18, 2019 6:13 am
by sajid4u2c
Hi ,

I am trying to use check_log3.exe for monitoring log pattern in windows server.

When running from windows machine, the script works fine and the results are showed:

Code: Select all

check_log3.exe -l Log_monitoring.txt  -p test -s seek_file.txt -w 1 -c 1
CRITICAL: Found 1 lines (limit=1/1): test|lines=1
But when running from NagiosXI using NCPA agent, it does not return any value or output:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 10.224.114.137 -t 'mytoken' -P 5693 -M 'plugins/check_log3.exe'  -a " -l Log_monitoring.txt  -p "test" -s seek_file.txt -w 1 -c 1" -v 

Empty  output

In first place, can NCPA run .exe file? because I do not see any code written for .exe files under plugins directory in ncpa.cfg
Also in NCPA documentation it is mentioned only for .ps1 , .bat , .vbs plugins.

Please help in this case or suggest any .ps1, .bat , or .vbs plugin for monitoring log files

Re: Can NCPA run remote .exe plugin ?

Posted: Wed Sep 18, 2019 11:20 am
by mbellerue
Yes, NCPA will run .exe files. I think the issue you're running into may be because you're using double quotes to encapsulate the additional arguments, and your additional arguments involve double quotes. Try it like this,

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 10.224.114.137 -t 'mytoken' -P 5693 -M 'plugins/check_log3.exe'  -a ' -l Log_monitoring.txt  -p "test" -s seek_file.txt -w 1 -c 1' -v 

Re: Can NCPA run remote .exe plugin ?

Posted: Thu Sep 19, 2019 9:41 am
by sajid4u2c
Thanks :) . It was indeed problem with the quotes.
Below command is working as expected. Just removed the double quotes from the search string.

/usr/local/nagios/libexec/check_ncpa.py -H 10.224.114.137 -t 'mytoken' -P 5693 -M 'plugins/check_log3.exe' -a " -l Log_monitoring.txt -p test -s seek_file.txt -w 1 -c 1" -v

Also, sometimes this check is returning time-out error. May be because of huge log entries in the log file .
Will it be better if I define the -t 120 in the arguments like below :

/usr/local/nagios/libexec/check_ncpa.py -H 10.224.114.137 -t 'mytoken' -P 5693 -M 'plugins/check_log3.exe' -a " -l Log_monitoring.txt -p test -s seek_file.txt -w 1 -c 1 -t 120 "

or we need to do any modification in ncpa.cfg in destination servers under plugin_timeout ?

Re: Can NCPA run remote .exe plugin ?

Posted: Thu Sep 19, 2019 11:20 am
by mbellerue
If you want to increase the timemout beyond 60, you will have to change the timeout setting in ncpa.cfg. The default is 60 seconds. If your plugin has a timeout of its own, you can also change the timeout there, or just let NCPA kill the command when it hits the time limit.

Edit:
Just to clarify on that second part. Your command can be set to timeout at 120 seconds with its own timeout setting, but by default NCPA will just kill the command after 60 seconds.

Re: Can NCPA run remote .exe plugin ?

Posted: Mon Sep 23, 2019 8:07 am
by sajid4u2c
Thanks a lot :) increased time_out in ncpa.cfg

Before we close this thread, could you please let me know how to install NCPA on bulk servers either linux/windows
Like 50 servers at one go.

Regards,

Re: Can NCPA run remote .exe plugin ?

Posted: Mon Sep 23, 2019 9:15 am
by lmiltchev
For Windows, you could use the NCPA silent installer + some kind of scripting solution.

https://www.nagios.org/ncpa/getting-sta ... nt-install

For Linux, you could mass install the agent via Ansible.

Re: Can NCPA run remote .exe plugin ?

Posted: Tue Sep 24, 2019 7:12 am
by sajid4u2c
Thank you :)
Please close the thread.