Can NCPA run remote .exe plugin ?

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

Can NCPA run remote .exe plugin ?

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Can NCPA run remote .exe plugin ?

Post 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 
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: Can NCPA run remote .exe plugin ?

Post 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 ?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Can NCPA run remote .exe plugin ?

Post 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.
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: Can NCPA run remote .exe plugin ?

Post 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,
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Can NCPA run remote .exe plugin ?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sajid4u2c
Posts: 46
Joined: Thu Mar 15, 2018 10:55 am

Re: Can NCPA run remote .exe plugin ?

Post by sajid4u2c »

Thank you :)
Please close the thread.
Locked