lita-icinga2 is a handler for Lita that allows interaction with Icinga monitoring solution. It listens for notifications on a HTTP endpoint.
Work is based upon lita-nagios handler.
Note: Colors in notifications are not enabled yet, because it relies completely on the adapter and no abstraction layer is implemented nor designed as of now.
Add lita-icinga2 to your Lita instance's Gemfile:
gem "lita-icinga2"
default_room
(String) - Default chat room for notifications
api
- Icinga API URLuser
- Icinga user with system commands authorizationpass
- User passwordverify_ssl
- default:true
Lita.configure do |config|
config.handlers.icinga2.default_room = "#admin_room"
config.handlers.icinga2.api = "http://icinga.example.com:5665"
config.handlers.icinga2.user = "lita"
config.handlers.icinga2.pass = "xxxx"
config.handlers.icinga2.verify_ssl = true
end
lita-icinga provides a HTTP endpoint to receive Icinga notifications:
POST /icinga2/notification
Request parameters must include those fields:
type
-host
orservice
room
- notifications destination (seedefault_room
in configuration section)host
- Icinga' $HOSTNAME or $HOSTALIASoutput
- Icinga' $HOSTOUTPUT or $SERVICEOUTPUTstate
- Icinga' $HOSTSTATE or $SERVICESTATEnotificationtype
- Icinga' $NOTIFICATIONTYPEdescription
- Icinga' $SERVICEDESC (only forservice
type)
see contrib/icinga2.txt for information how to enable and configure notification in icinga2
lita: icinga2 recheck <-h | --host HOST> [-s | --service SERVICE] - Reschedule check for given host/service
lita: icinga2 ack(nowledge) <-h | --host HOST> [-s | --service SERVICE] [-m | --message MESSAGE] - Acknowledge host/service problem with optional message
lita: icinga2 unack(nowledge) <-h | --host HOST> <-s | --service SERVICE> - Remove acknowledge on host/service problem
lita: icinga2 list [-h | --host HOST] - List all checks (optional on specific host)
lita: icinga2 enable notif(ication(s)) <-h | --host HOST> [-s | --service SERVICE] - Enable notifications for given host/service
lita: icinga2 disable notif(ication(s)) <-h | --host HOST> [-s | --service SERVICE] - Disable notifications for given host/service
lita: icinga2 (fixed|flexible) downtime <-d | --duration DURATION > <-h | --host HOST> [-s | --service SERVICE] - Schedule downtime for a host/service with duration units in (m, h, d, default to seconds)