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