Posted by Tim Galyean in Monitoring, Ruby
on Sep 4th, 2010
While there are plenty of URL monitor’s available to verify if your site is working or not, many of them cost money. I was recently debugging a monitoring issue and found that I needed a simple URL monitor which would return the HTTP response code only, and provide some basic logging as well so that I wouldn’t have to sift through two day’s worth of shell output. Long story short this was a temporary solution and not one that I had any desire to spend money on so I threw together the following script.
I wrote it in ruby because I like its logger library which gives enough options and...
Posted by Tim Galyean in Ruby
on Apr 28th, 2010
Here is a pretty basic example of a ruby script, which contains a function, defining a variable, grabbing data from standard input, and calling the function.
#!/usr/bin/ruby
$variable = STDIN.gets
def function(variable)
puts "Your STDIN is: #{variable}"
end
function($variable)
Example:
[h1tman@h1tman ruby]$ echo "TEST" | ./stdin.rb
Your STDIN is: TEST
[h1tman@h1tman ruby]$