Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uptrends_extended

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uptrends_extended

  • 0.7.1
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Uptrends RESTful API Client

Code Climate Test Coverage Build Status License Gem Version

This is a ruby wrapper around the Uptrends API. Uptrends is a monitoring service that let's you monitor Web pages, Web services, Mail servers, Database servers, DNS, SSL certificates, FTP and more.

NOTE: This is a 3rd party gem and not an official product from Uptrends.

Installation

Add this line to your application's Gemfile:

gem 'uptrends_extended'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uptrends_extended

Usage

require 'uptrends_extended'
u = UptrendsExtended::Client.new(username: 'my@email.com', password: 'MyP@sswo0rd')   #=> #<UptrendsExtended::Client>

probes = u.probes                     #=> [#<UptrendsExtended::Probe>, #<UptrendsExtended::Probe>, ...]
p = probes.first                      #=> #<UptrendsExtended::Probe>
p.attributes                          #=> [:guid, :name, :url, :port, :check_frequency, :probe_type, :is_active, :generate_alert, :notes, :performance_limit1, :performance_limit2, :error_on_limit1, :error_on_limit2, :min_bytes, :error_on_min_bytes, :timeout, :tcp_connect_timeout, :match_pattern, :dns_lookup_mode, :user_agent, :user_name, :password, :is_competitor, :checkpoints, :http_method, :post_data]
p.guid                                #=> "7ef43a1b255949f5a052444348971690"
p.name                                #=> "My Probe's Name"
p.statistics('2015/01/01', '2015/12/31', 'Year') #=> [{"Dimension"=>"2015", "Alerts"=>0, "SLAPercentage"=>99.8, "SLATotalTime"=>2, "SLAOperatorResponseTime"=>15, "AvgOperatorResponseTime"=>0, "PercentageOK"=>99.82507, "PercentageError"=>0.1749256, "PercentageUnknown"=>0, "PercentageUptime"=>99.82507, "TotalChecks"=>3168, "Errors"=>5, "UnconfirmedErrors"=>12, "SecondsOK"=>1893489, "SecondsError"=>3318, "SecondsUnknown"=>0, "AverageTotalTime"=>1.229745, "AverageResolveTime"=>0.1484861, "AverageConnectionTime"=>0.1247686, "AverageDownloadTime"=>0.9560824, "AverageTotalBytes"=>6961}]
p.uptime_this_year                    #=> {:sla=>99.8, :uptime=>99.82507}
p.uptime_last_12_month                #=> {:sla=>99.8, :uptime=>99.82158}

probe_groups = u.probe_groups         #=> [#<UptrendsExtended::ProbeGroup>, #<UptrendsExtended::ProbeGroup>, ... ]
pg = probe_groups.first               #=> #<UptrendsExtended::ProbeGroup>
pg.attributes                         #=> [:guid, :name, :is_all, :is_client_probe_group]
pg.guid                               #=> "c8d6a0f704494c37823850f3d4fd4273"
pg.name                               #=> "All probes"

# Let's change the name of the probe:
p.name = "My Probe's NEW name"        #=> "My Probe's NEW name"
p.update!                             #=> nil

# Let's add our probe to our probe group
pg.add_probe(p)                       #=> [#<UptrendsExtended::ProbeGroup>, #<UptrendsExtended::Probe>]

Contributing

  1. Fork it ( https://github.com/microting/uptrends-gem/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 07 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc