
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
gem install riemann-client
require 'riemann/client'
# Create a client. Host, port and timeout are optional.
c = Riemann::Client.new host: 'localhost', port: 5555, timeout: 5
# Send a simple event
c << {service: 'testing', metric: 2.5}
# Or a more complex one
c << {
host: 'web3',
service: 'api latency',
state: 'warn',
metric: 63.5,
description: "63.5 milliseconds per request",
time: Time.now.to_i - 10
}
# :host defaults to gethostname(). :time defaults to current unix time. You
# can explicitly override host...
c << {host: nil, service: 'the cloud', state: 'nebulous'}
# Get all the states from the server
c['true']
# Or specific states matching a query
c['host =~ "%.dc1" and (state = "critical" or state = "warning")']
Riemann::Client sends small events over UDP by default, and uses TCP for queries and large events. UDP sends are essentially "shouting into the void". They will not block your application and are roughly an order of magnitude faster than TCP, but you will not know if the server is down or encountered an error. You can specify what transport to use by selecting a subclient:
c.udp << { :state => "ok" } # => nil
c.tcp << { :state => "ok" } # => #<Message ...>
c.tcp["true"] # => [#<Event ... >, ...]
c.udp["true"] # => raise Riemann::Client::Unsupported
Riemann::Client provides some classes to make managing state updates easier.
Riemann::MetricThread starts a thread to poll a metric periodically, which can be used to flush an accumulated value to ustate at regular intervals.
Riemann::AutoState bundles a state and a client together. Any changes to the AutoState automatically send the new state to the client.
The MIT License
Copyright (c) 2011-2022 Kyle Kingsbury
FAQs
Unknown package
We found that riemann-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.