Swatch


Swatch

Mail_em

Page_em

Ping-Swatch

Pong-Swatch

Silence-Swatch

Swatch.conf.solaris

Swatch.conf.new


Swatch

Swatch is a popular tool used for watching syslog and reacting to strings it sees. I used this Swatch.conf when I lived in a Solaris environment; I use this one currently, along with Mail_em and Page_em, Perl-based wrapper scripts called from swatch.conf. The wrapper scripts rely on the in-house Netops Toolkit.

In addition, I run Ping-Swatch from cron. This script sets a shared memory variable and then logs a particular string to syslog, which swatch.conf is configured to watch for. When swatch sees that string, the relevant config file snippet in swatch.conf invokes Pong-Swatch, which resets that shared memory variable. If Ping-Swatch does not see the shared memory variable change, it shrieks via alpha page.

When I want to quiet Swatch, while working on a particular device, for example, I use silence-swatch to edit swatch.conf and restart swatch.

I collect my tips around Swatch; the details are peculiar to my installation.


Prepared by:
Stuart Kendrick

Last modified: 02-November-2007