What's the best way to run "IF" scripts e.g a process that runs in the background scheduled every 30 minutes\1hour that checks various processes are running and if they're not, restarts them?
Does anyone have a template of such a script?
When this runs I need it to not effect the load on the server, 'cos in peak times our sys admins panic too much as it is!
Sorry I should have been more specific. The scripts that need to be, for better words "monitored" are perl scripts, run as;
perl script1.pl &
etc.
This scripts are required to be running 24/7 as they generate data as and when needed. At the moment if one dies, netsaint aka Nagios mails out and we have to manually restart them
maybe you want to write a new netsaint plugin script as per your requirement? Or maybe invoke this new script whenever your existing monitoring check throws an alert?
A plug-in to nagios would indeed be an option however I have not had much exposure to this system,the closest I have come is adding new processes into the config for monitoring. I have not actually set it up.
As far as I am aware there is a config within Nagios for each server, so the plug-in would require to be added to the relevant servers config? Is there any nagios\netsaint guys in here that could advise?
Nagios is pretty cool. Its even cooler with Fruity. I am currently removing Nagios and replacing it with OpenView.
Since Nagios is Open Source you can find lots of books and documentation. I would find a monitoring config that does something like what you need and modify it. That would be the easiest way for you to make your own pluggin.