NAME

App::Wubot::Plugin::SQLite - monitor results of SQLite queries

VERSION

version 0.3.10

  ~/wubot/config/plugins/SQLite/notifyqueue.yaml

  ---
  delay: 5m
  dbfile: /Users/wu/wubot/sqlite/notify.sql
  statements:
    - SELECT count(*) AS unseen FROM notifications WHERE seen IS NULL

DESCRIPTION

This plugin executes a sqlite query and sends a message with the results.

EXAMPLES

I find it useful to monitor the length of my notification queues. The first example monitors the total number of items in the queue that are unread.

  ~/wubot/config/plugins/SQLite/notifyqueue.yaml

  ---
  delay: 5m
  dbfile: /Users/wu/wubot/sqlite/notify.sql
  statements:
    - SELECT count(*) AS unseen FROM notifications WHERE seen IS NULL

The next example selects the number of items that were added to the queue in the last 24 hours:

  ~/wubot/config/plugins/SQLite/notify-day.yaml

  ---
  delay: 5m
  dbfile: /Users/wu/wubot/sqlite/notify.sql
  statements:
    - SELECT count(*) AS day FROM notifications WHERE lastupdate > ( select strftime('%s','now','-24 hours') )

SUBROUTINES/METHODS

check( $inputs )

The standard monitor check() method.