# Nagios ruby script - code review

**URL:** <https://www.ruby-forum.com/t/nagios-ruby-script-code-review/167283>\
**Category:** Ruby\
**Created:** [May 6, 2009, 11:59am UTC](https://www.ruby-forum.com/t/nagios-ruby-script-code-review/167283 "2009-05-06T11:59:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johny006](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@johny006](https://www.ruby-forum.com/u/johny006)\
**Post date:** [May 6, 2009, 11:59am UTC](https://www.ruby-forum.com/t/nagios-ruby-script-code-review/167283/1 "2009-05-06T11:59:33Z")

</div>

Hi,

I’ve wrote my first ruby script. It’s a nagios plugin who get a full  
webpage.

Main features:  
\* Ruby small script, easy to understand and hack (I hope) …  
\* http/https  
\* Use the powerful and simple hpricot lib to parse html  
\* Multi-thread  
\* Keyword check  
\* Follow redirections

I would like to have opinions and advices about this code and enhance it  
if needeed.

[http://code.google.com/p/nagios-check-webpage/source/browse/trunk/check\_webpage.rb](http://code.google.com/p/nagios-check-webpage/source/browse/trunk/check_webpage.rb)

Thanks,
