Easy nginx monitoring with sparrow

Hi, this is very simple and short example, but quite expository.

install sparrow

sudo apt-get install curl

sudo apt-get install git

sudo cpanm Sparrow

installs nginx sparrow plugin

mkdir ~/sparrow && echo swat-nginx https://github.com/melezhik/swat-nginx.git >> ~/sparrow/sparrow.list

sparrow plg install swat-nginx

setup monitored host

sparrow project foo create sparrow project foo add_plg swat-nginx sparrow project foo add_site localhost

and finally ... run test suite

sparrow project foo check_site localhost swat-nginx

     # sparrow environment initialzed at /home/vagrant/sparrow
    /home/vagrant/.swat/.cache/20277/prove/00.GET.t ..
    ok 1 - GET succeeded
    # response saved to /home/vagrant/.swat/.cache/20277/prove/jgxseRgqg2
    ok 2 - output match '200 OK'
    ok 3 - output match /Server: nginx\/(\S+)/
    ok 4 - valid nginx version: 1.6.2
    All tests successful.
    Files=1, Tests=4,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.05 cusr  0.00 csys =   0.08 CPU)
    Result: PASS


Visit https://github.com/melezhik/sparrow to know more.

sparrow - tiny web monitoring tool

Tiny but quick sparrow

Let me introduce you a sparrow - a tiny web monitoring / test tool . Tiny as project is in very alpha stage, but I hope it will grow and get mature and get used by others.

Sparrow is a console client to setup tests/monitoring infrastructure and run swat tests suites. Swat - is web test application automation framework. Sparrow provides some glue to run sparrow plugins - shareable swat tests suites.

Here is the list of some sparrow plugins created by me - https://github.com/melezhik/sparrow-hub

Swat was initially designed to radically increase and simplify web tests development. Another idea behind swat philosophy - is to create shareable tests suites could be reused by someone else with different context ( monitoring, QA, development, devops ) but in easy manner.

Recently I have posted a informal swat introduction paper with the list of swat test suites could be base for such a sparrow plugins.

If you are inspired in test automation development on perl we probably could go one direction. So swat/sparrow contributors are needed!

Possible impact:

  • start using swat,sparrow and sparrow plugins
  • create new sparrow plugins ( swat test suites ) - it's really easy
  • contribute to sparrow - there is some TODOs here - implementing REST API, clear up documentation and my documentations typos, (--; , etc
  • contribute to swat - the api is going to be stable, but I am open to new ideas as Russians say two heads are better then one (-;

--- Thanks, Alexey Melezhik ( the author of swat and sparrow )

Doing testing in a swat way

Hi I wrote an informal introduction into swat, trying to highlights some benefits one could gain using swat in web test development. Feedback is appreciated. Thanks.

Bootstraping test infrastructure for mojo application using swat

Install swat mojo command

You need a swat mojo command to generate swat tests scaffolding for mojo application.

cpanm Mojolicious::Command::swat

Bootstrap mojo application

Then you need to bootstrap mojo application or choose existed one.

mkdir myapp
cd myapp
mojo generate lite_app myapp.pl

Define http resources ( mojo routes )

As well as define your routes.

$ nano myapp.pl

#!/usr/bin/env perl
use Mojolicious::Lite;

get '/' => sub {
  my $c = shift;
  $c->render(text => 'ROOT');

post '/hello' => sub {
  my $c = shift;
  $c->render(text => 'HELLO');

get '/hello/world' => sub {
  my $c = shift;
  $c->render(text => 'HELLO WORLD');


$ ./myapp.pl routes
/             GET
/hello        POST  hello
/hello/world  GET   helloworld

Bootstrap swat tests

And then create a swat tests for every route exists.

$ ./myapp.pl swat
generate swat route for / ...
generate swat data for GET / ...
generate swat route for /hello ...
generate swat data for POST /hello ...
generate swat route for /hello/world ...
generate swat data for GET /hello/world ...

Specify additional swat check lists

This phase might be skipped as preliminary 200 OK checks are already added on bootstrap phase.

But you may define more.

For complete documentation on how to write swat tests please visit https://github.com/melezhik/swat.

$ echo ROOT >> swat/get.txt
$ echo HELLO >> swat/hello/post.txt
$ echo HELLO WORLD >> swat/hello/world/get.txt

Start mojo application

$ morbo ./myapp.pl
Server available at

Run swat tests

vagrant@Debian-jessie-amd64-netboot:~/projects/myapp$ swat swat/
/home/vagrant/.swat/.cache/26576/prove/hello/world/00.GET.t ..
ok 1 - GET succeeded
# response saved to /home/vagrant/.swat/.cache/26576/prove/an7LtP99Ju
ok 2 - output match '200 OK'
ok 3 - output match 'HELLO WORLD'
/home/vagrant/.swat/.cache/26576/prove/foo/bar/00.PUT.t ......
ok 1 - PUT succeeded
# response saved to /home/vagrant/.swat/.cache/26576/prove/L1JTyul6W5
ok 2 - output match '200 OK'
/home/vagrant/.swat/.cache/26576/prove/00.GET.t ..............
ok 1 - GET succeeded
# response saved to /home/vagrant/.swat/.cache/26576/prove/YPnyXfYPXz
ok 2 - output match '200 OK'
ok 3 - output match 'ROOT'
/home/vagrant/.swat/.cache/26576/prove/hello/00.POST.t .......
ok 1 - POST succeeded
# response saved to /home/vagrant/.swat/.cache/26576/prove/baZKYm1hGD
ok 2 - output match '200 OK'
ok 3 - output match 'HELLO'
All tests successful.
Files=4, Tests=12,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.20 cusr  0.01 csys =  0.24 CPU)
Result: PASS

That's it.

Enjoy your testing with swat! ;--)

Outthentic latest releases

Hi! I am very glad to announce of outthentic stuff latest releases:

  • Outthentic::DSL - a core component for all outthentic test clients
  • Outthentic client - a general purposes test tool ( based on Outthentic::DSL )
  • Swat client - a web application test tool ( based on Outthentic::DSL )

So. Follow metacpan/github docs, find your proper tool and enjoy your testing with Outthentic!/var/www/users/melezhik/index.html

About melezhik

user-pic Dev & Devops --- Then I beheld all the work of God, that a man cannot find out the work that is done under the sun: because though a man labour to seek it out, yet he shall not find it; yea further; though a wise man think to know it, yet shall he not be able to find it. (Ecclesiastes 8:17)