Last active
January 3, 2016 02:29
-
-
Save ronbee/8396324 to your computer and use it in GitHub Desktop.
Revisions
-
ronbee revised this gist
Jan 13, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Say you wanna monitor that your REST'ful service is up & working. 1. treat gitted-file as a TAP unit-test 2. define a TAP output project in Jenkins (that runs every xx minutes and sends email notifications) 3. you're done _(in case of need, define more tests)_ -
ronbee renamed this gist
Jan 13, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ronbee revised this gist
Jan 13, 2014 . 3 changed files with 10 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ # A Poor Man's Monitoring Say you wanna monitor that your REST'ful service is up & working. 1. treat gitted-file as a TAP unit-test 2. define a TAP output project in Jenkins (that runs every xx minutes) 3. you're done _(in case of need, define more tests)_ -
ronbee created this gist
Jan 13, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 1) treat gitted-file as a TAP unit-test 2) define a TAP output project in Jenkins (that runs every xx minutes) 3) you're done (in case of need, define more tests) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ require 'json' require 'net/http' class Service_Status_Monitor TEST_SERVICES = [ 'http://111.111.111.111:8001/status' ] # this IS our config file.. def run outf out = File.new( "#{File.dirname(__FILE__)}/#{outf}", "w" ) out.puts "1..#{TEST_SERVICES.size}" TEST_SERVICES.each_with_index do |ustr,ii| begin reply = Net::HTTP.get_response( URI( ustr ) ) body = JSON.parse( reply.body ) rescue { "status" => "no content / http code #{reply.code}" } out.puts "#{ ( reply.code == '200' and body["status"] == 'ok' ) ? "ok" : "not ok" } #{ii+1} - #{body}" rescue => err out.puts "not ok #{ii+1} - info: #{err}" end end out.close end end Service_Status_Monitor.new.run "monitor_status.out"