Run a script at Core Startup

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Run a script at Core Startup

Post by grenley »

Hi.
I have a script I want to run at Core startup.
It is a socket listener that I want started with Core and run the whole time Core is active.
Where is the best place to put the script execution?
Thanks, Rick
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Run a script at Core Startup

Post by scottwilkerson »

About the best I can suggest would be to modify the init script (orsystemd service file) to load your script and kill it when nagios stops.

There is no mechanism in Core directly to start and stop scripts like this.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Re: Run a script at Core Startup

Post by grenley »

Thanks for the reply.
That would be fine but I see no orsystemd file
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Run a script at Core Startup

Post by scottwilkerson »

Depending on the OS you are running it usually is in /etc/init.d/nagios or /usr/lib/systemd/system/nagios.service
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
grenley
Posts: 96
Joined: Tue May 13, 2014 6:06 pm

Re: Run a script at Core Startup

Post by grenley »

Hi.
I meant to get back to you a while ago.
This worked great.
Thanks for your help!
Rick
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Run a script at Core Startup

Post by scottwilkerson »

grenley wrote:Hi.
I meant to get back to you a while ago.
This worked great.
Thanks for your help!
Rick
No problem.

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Run a script at Core Startup

Post by cdienger »

Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked