Project

lita-monit

0.0
No commit activity in last 3 years
No release in over 3 years
Lita handler for accepting and forwarding monit alerts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 2.14

Runtime

~> 2.3
 Project Readme

lita-monit

Lita-monit is a simple handler to catch monit notifications and forward them directly into your chat.

Installation

Add lita-monit to your Lita instance's Gemfile:

gem "lita-monit"

Configuration

There are two configuration options provided:

token - is a token string to confirm that it's real monit alert. By default token string is null. So no validation happens and anyone can send notification to your handler. Adding that configuration option is recommended.

rooms - JIDs of rooms to send notification. Default value is :all.

Usage

To send monit notifications you need to make a simple shell script:

#!/bin/sh
/usr/bin/curl -s \
  -F "message=$HOST" \
  -F "service=$SERVICE" \
  -F "description=$DESCRIPTION" \
  -F "token=**token**"\
  http://0.0.0.0:8080/monit

By default lita listens 8080 port. Don't forget to add token to configuration options. After that you can add following to your monitrc config

check program check-mysql with path "/opt/monit/check_mysql.sh"
     if status != 0 then exec /home/user/monit.sh

to call notification for certain events

License

MIT