README.rdoc in nagiosharder-0.3.0 vs README.rdoc in nagiosharder-0.4.0.rc1

- old
+ new

@@ -1,30 +1,49 @@ = nagiosharder -Query and command a Nagios install using the power of ruby. +Query and command a Nagios install using the power of ruby (and lots of screen-scaping)! Do the usual gem install jig: + gem install nagiosharder + + +Now you have access to both a Ruby interface and a command line interface. + +Here's some examples to get you started with the Ruby API: + require 'nagiosharder' site = NagiosHarder::Site.new('http://path/to/nagios/cgi/directory', 'user', 'password', 'version') # version defaults to 3 - + # get details back about a host's services puts site.host_status('myhost') # schedule a host to have services checks run again right now site.schedule_host_check('myhost') # get details on all services - site.service_status(:all) - # or just services that have problems - site.service_status(:all_problems) - # (other valid symbols: :ok, :warning, :unknown, :critical, :pending, :all_problems) - # or make it sorted by duration, descending - site.service_status(:all_problem, :sort_option => :duration, :sort_type => :desc - # (other sort_options: :host, :service, :status, :last_check, :duration, :attempts) - # (other sort_types: :asc, :desc) + site.service_status + + # or just things with problems + site.service_status( + :service_status_types => [ + :critical, + :warning, + :unknown + ] + ) + + # or just muted services, sorted desc by duration + site.service_status( + :service_props => [ + :notifications_disabled, + ], + :sort_type => :descending, + :sort_option => :state_duration, + ) + # or get the details for a single service group - site.service_status(:all_problem, :group => "AWESOME") + site.service_status(:group => "AWESOME") # schedule a host to have services checks run again right now site.schedule_service_check('myhost', 'myservice') # schedule 20 minutes of downtime, starting now @@ -37,10 +56,13 @@ site.acknowledge_service('myhost', 'myservice', 'something bad happened') # or unacknowledge site.unacknowledge_service('myhost', 'myservice') + # acknowledge a down service + site.acknowledge_host('myhost', 'something bad happened') + # disable notifications for a service: site.disable_service_notifications('myhost', 'myservice') # check if notifications are disabled: site.service_notifications_disabled?('myhost', 'myservice') @@ -52,13 +74,22 @@ site.disable_service_notifications('myhost', 'myservice') until site.service_notifications_disabled?('myhost', 'myservice') sleep 3 end -To be continue? +Then there's the command line. Start with --help + nagiosharder --help + +This will show you how you configure nagiosharder enough to talk to your nagios. You need at least a username, password, and nagios url. These can alternatively be in a config file. For example: + + nagiosharder --config /path/to/yaml + +This will display all available commands. + + == Note on Patches/Pull Requests - + * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. Bonus points for topic branches.