2008-11-27

Monit: lightweight monitoring solution

Monit is simple, lightweight, but useful and powerful enough monitoring solution for your servers.
Monit can monitor:
  • OS processes (presence, resources)
  • files, dirs and file system for changes (mtime, size and checksum changes)
  • network hosts (ping, tcp connections)
Monit can notify administrator via configurable e-mail messages. It also can automatically restart failed service.
Monit have embedded web-server which allows to view state on monitoring objects and disable or enable them.

Of course, enterprise-class monitoring systems have much more features, but sometimes they are too complex and unstable.
BTW, there is product named M/Monit. It can control multiple monit instances. Unfortunately, M/Monit is only available under commercial license.

2008-09-28

Rsync Windows <-> Linux

How to run rsync from windows? Simple!

1. Install cwRsync

Unfortunately, there is no native rsync for Windows. But there is rsync build for cygwin - cwRsync. You can download it from:
http://downloads.sourceforge.net/sereds/cwRsync_2.1.5_Installer.zip

2. Add $CYGWIN_INSTALL_PATH/bin/ to PATH environment:
Control Panel -> System -> Advanced -> Environment

3. Fix problem with non-ascii filenames

Here is the message describing a problem:



>I'm trying to use rsync (version 2.6.9) to back up some files. However, a few 
>of them contain Hebrew characters. While I can back them up, the filenames 
>come through scrambled (I don't have Hebrew characters anymore). I've tried 
>the -8 switch, but that didn't work. Any suggestions?
>
>Background:
>
>The files are created on Windows and saved on a samba share (v3.0.24). I can 
>copy them around in Windows just fine. Konqueror, on the machine the files 
>are physically on shows the file names properly. But when I copy them using 
>rsync, the file names get scrambled (Hebrew characters only; English 
>characters are fine).

I guess you're using cwrsync which uses the cygwin1.dll. The normal release
is not unicode aware and therefore has problems with non-ascii characters.
I also had this problem with German umlauts. There is a unicode-release
of the cygwin1.dll which you can copy over your existing cygwin1.dll.
In my case the problems went away. The characters still look strange when
looked at in Linux (different codepage, encoding...) but at least from the
samba share they're the same.

http://www.okisoft.co.jp/esc/utf8-cygwin/


So, replace cygwin.dll with version that could be downloaded from from http://www.okisoft.co.jp/esc/utf8-cygwin/

Done
Don't forget to add --iconv=. to rsync command-line options (--incov introduced in rsync 3.0).