Easy nginx monitoring with sparrow

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

install sparrow

$ sudo apt-get install curl
$ sudo cpanm Sparrow

installs nginx sparrow plugin

$ sparrow index update
$ sparrow plg install swat-nginx

setup monitored host

$ sparrow project foo create
$ sparrow check add foo nginx-server
$ sparrow check set foo nginx-server -p swat-nginx -u 127.0.0.1

and finally ... run test suite

    $ sparrow check run foo nginx-server

    # sparrow environment initialzed at /home/vagrant/sparrow
    /home/vagrant/.swat/.cache/20277/prove/00.GET.t ..
    ok 1 - GET 127.0.0.1/ 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
    1..4
    ok
    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

PS

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

Leave a comment

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)