Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We have a couple dozen utility scripts that run on various machines to do things like application level backups, pruning out old data, cleaning up disk space, etc. They were written by multiple developers over time and there's not much common structure among them. Some log to a file, some log to syslog, some send email alerts, others fail silently, some email on success, others succeed silently, some scripts run every minute and spam us with alerts every minute when there are problems, etc. These have grown organically over several years and as we migrate to new hardware, I'd like to clean them up.

How do others handle these types of "one-off" scripts that are different for every application, but we still want some structure for log files, alerts, etc.

Is there a framework script that will help with this? The scripts themselves are a written in Perl, Python, and Bash, but a common invocation script could still be used to point to log files, send alerts on success/failure, etc. I've looked around for one but I'm not even search what to search for.

Or are alerts better handled through Nagios or other general monitoring system?

share|improve this question

1 Answer 1

Define common configuration possibilities (--options, environment variables) and adapt the scripts. It's useful for future scripts to also define script templates for those languages which have the parsing for this common stuff.

share|improve this answer
1  
+1 for script templates. the real key is education of those writing scripts. define policies, eg: All scripts will send email on failure. All scripts will log output to /var/log/scriptname.log. All scripts will rotate X iterations of logfiles. etc. –  Tim Kennedy May 17 '13 at 15:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.