A simple Nagios alternative made to look like unit tests.
This is probably a bad idea but I wanted to get something on paper (as it were) so I could get back to real work.
Configure PagerUnit so it can send email in /etc/pagerunit.cfg
or ~/.pagerunit.cfg
:
[mail]
address = recipient@example.com
[smtp]
password = password
port = 587
server = smtp.gmail.com
username = sender@gmail.com
Define some tests a la Nose:
def foo():
"""
Docstring for foo.
"""
assert False, 'Assertion for foo.'
Run them every 10 seconds:
pagerunit --loop example.py
Prerequisites:
- Python >= 2.6
git clone git://github.com/rcrowley/pagerunit.git
cd pagerunit && make && sudo make install
echo "deb http://packages.devstructure.com release main" | sudo tee /etc/apt/sources.list.d/devstructure.list
sudo wget -O /etc/apt/trusted.gpg.d/devstructure.gpg http://packages.devstructure.com/keyring.gpg
sudo apt-get update
sudo apt-get -y install pagerunit
Replace release
with "lenny
", "squeeze
", "lucid
", "maverick
", or "natty
" as your situation requires.
pip install pagerunit