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

qnotifier

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qnotifier

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Plugin Development

QNotifier supports user defined plugins to extend its capability. With this ability you can monitor and alert on pretty much anything on your system.

Location

  • User generated plugins should be placed in /var/lib/qnotifier/plugins

Plugin Structure

  • A plugin must subclass Qnotifier::Plugin and contain a main method and an initializer.

Here's a basic plugin that counts the number of processes on the system:

module Qnotifier class Iostat < Qnotifier::Plugin def main processes = ps -ef if processes process_count = processes.split("/n").count stat("Count", process_count) report("Count", process_count) if process_count > 100 alert("Count", "There are more than 100 processes running") else reset_alert("Count", "There are now under 100 processes running") end else Qnotifier.log.error "Couldn't get output from the ps command" end end end end

Methods:

stat(key, value) Will update the stat for key with value on the server. Value is a text field that will appear next to the property in the stats portion of the client.

report(key, value) Will create a datapoint for graphs for the associated key. Value is a float or integer.

alert(key, message) Sends a push notification for the specified key with the message string.

reset_alert(key, message) Resets an alert, key must match the alert that it is associated with.

put(key, value) Puts a value string in the saved variables to be retrieved on a subsequent run by get.

get(key) Retrieves a stored value by key.

Submit your plugin to support@qnotifier.com if you feel like sharing it with others!

FAQs

Package last updated on 04 Nov 2010

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