Browsed by
Tag: regular expressions

Using swatch to throttle script log messages

Using swatch to throttle script log messages

At work we have a few scripts that we would like to monitor, and define a few messages that should trigger an SMS to be sent to the person on call. As most of these scripts log to syslog, and we have a our linux servers set up to forward syslog messages to a central log host, we going to monitor the central syslog for important messages originated by the scripts. In order to avoid message storms, however, we need…

Read More Read More

Simple script for testing regular expressions in Perl

Simple script for testing regular expressions in Perl

At work the other day I was creating regular expressions (regexps) in perl for use with swatch. Instead of testing the regexps by entering them into the swatch config file, restart swatch, and use the “logger” command to trigger swatch to take action, I thought I’d simplify it by creating a small script. Since swatch is written i perl, I created a tiny script in perl so that there wouldn’t be any regexps mismatch between how the script interprets regexps…

Read More Read More