Page 1 of 1

Run a local shell script by using NCPA

Posted: Thu May 04, 2023 2:21 pm
by titien104
Hi Team,

I have a shell script as below:
/opt/TEST_CDC/cdc-processor-audit/bin/audit-processor.sh 0 2500

This script will start up this JVM:

/opt/java/java8/latest/bin/java -Duser.timezone=Pacific/Honolulu -Xms256m -Xmx512m -cp config:./lib/* -Dlog4j.configuration=file:config/log4j.xml -Dcom.med.common.globals=config/audit-processor-globals.xml -DspringConfig=springConfig/processorContext.xml -Dcom.med.rpt.eventprocessor.commons.GenericSpringInvoker.bean=pipelinedEventCopier com.med.rpt.eventprocessor.commons.GenericSpringInvoker copy 0 2500

How do I use NCPA agent to monitor and start up the script if the jvm is stopped any any reason?
Thanks,

Re: Run a local shell script by using NCPA

Posted: Thu May 04, 2023 9:44 pm
by kg2857
You might want to look into running plugins via ncpa.

Re: Run a local shell script by using NCPA

Posted: Fri May 05, 2023 9:42 am
by titien104
Thanks kg2857,

I am not an expert with NagiosXI. Can you or someone provide more detail instruction? Thanks

Re: Run a local shell script by using NCPA

Posted: Fri May 05, 2023 10:38 am
by deby23456
Hello,

Here is some information describing plugins.

https://answerhub.nagios.com/support/s/ ... s-f9e78907

If you want to test it out and get some deeper knowledge about the use of it. I'd start with this KB below.

https://answerhub.nagios.com/support/s/ ... s-7fb3d9a8

If you want to reboot a service if it goes down though. That may need an "event_handler." Check out this article as well.

https://answerhub.nagios.com/support/s/ ... s-dd07d938

Re: Run a local shell script by using NCPA

Posted: Wed May 17, 2023 8:27 am
by maxvilliams
Make sure NCPA is installed and configured on your system. NCPA is a monitoring agent that allows you to execute commands remotely, including running shell scripts. Locate the "Plugins" section in the NCPA interface. This is where you can execute various commands and scripts. In the NCPA interface, navigate to the "Plugins" section and find the option to execute a command or script.