bb-ricardo / icinga-slack-bot Goto Github PK
View Code? Open in Web Editor NEWuse slack to manage alarms in Icinga2
License: MIT License
use slack to manage alarms in Icinga2
License: MIT License
it would be a nice feature if there are also the bot commands
ss ack
ss dt
ss com
hs ack
hs ack
hs dt
hs com
to get the overview of the hosts/services which are commented/acknowledged or set with a downtime.
The host filter host.state != HostUP
does not seem to work and should be changed to host.state != 0
.
Allow to use filters like "reset"
to allow Icinga to search for hosts or services called reset instead of triggering the bot action to reset an action command. This would also add the possibility to search for services like "HTTPS Cert"
which would not return service https on host cert.
It would be really nice to be able to set a downtime directly via Slack
It should also be possible to remove acknowledgments, downtimes and comments
Is there a way to use non-legacy api for bots in slack ? Unfortunately I don't see that option - I think legacy has been disabled for my wokspace.
TraceBack:
"Output": icinga_object.get("last_check_result").get("output"),
AttributeError: 'NoneType' object has no attribute 'get'
Following steps need to be added/documented
Add action button to detailed view and deliver image as attachment
This could help the user to get more informations directly. Otherwise it should also be ok to just link the README.
Links to images in this repo could be used as "in Slack help"
these loooong if clauses need to fixed, this is quite ugly.
from #43
We have the bot in a shared channel with all lot of people who probably muted this channel, and sometimes you want to @ a person and you will get the response I didn't understand the command I would love a ignore character if a line starts with @ or # the line is not ment for the bot this would save some responses of the bot during a short convo about the problem like # I have acked the problem working on it or @here, working on it
Hi,
I was playing with this bot and wonderd if it was possible to add a 'ticket' command in the ack
style. or as a extra question to the ack
command do you want a ticket?
It would be great to call a python script with a name like send_ticket.py
with arguments: host
service
state
the first argument would be the subject
the second and third arguments would be the description
like:
f"Service: {var1} State: {var2}"
With that we can send it towards Fresh service. We don't want Icinga to do this as it would just be creating too many tickets.
Help would be appreciated. Or if it could become a feature out of the box would just be superb!
I can imagine adding every ticket sollotion in the world would be too much to ask but this way users could implement it really easy themselfs in the send_ticket.py
and setting a ini value to enable this feature
This way you could easily reuse the filter from last command.
Add comment:
com webserver ntp with all peers seem to be offline
Check if comment was set
ss !!
This would use the last commands filter list
This project should make use of the message builder classes which were added with python-slackbot 2.1.0.
Get a quick idea about the status of the Icinga instance your Slack bot is connected to.
Similar to the bot startup message but with more details.
Once the service list gets really long it would be great to add a possibility to exclude services which are acknowledged or in downtime by default. Or with an extra command option.
Ideas and suggestions are more then welcome.
shortcut: dn
This way you could connect multiple bots to the same Icinga instance and limit the scope of each bot.
This way multiple Slack projects could use the same Icinga Instance. Or production and development could be separated if they are monitored by the same instance.
add openrc init file to start the bot as a daemon on openrc systems
With big Instances it could be a problem if the result list gets too long.
A config option should be added to limit the amount of returned/requested results.
Command name suggestion
• send custom host notification (shn)
• send custom service notification (ssc)
highlight if host or service object has one or more comments
Add comment and downtime information to detailed object view.
This might clutter the view with to much information. Needs to be tested if this helps or not.
Otherwise there needs to be another command to view comments and downtime’s which is also not very helpful.
Version 0.7.1 needed
This way we can switch notifications on and off globally
Command suggestions
• reschedule host check (rhc)
• reschedule service check (rsc)
Add force option at the end
Slack has changed the permission model and we need to add a detailed description of how to set up a slack bot which is able to post to chat, red user informations and listens to RTM.
help should describe actions better to help user to work with actions
Make it more verbose if an issue is taken care of
It would be great to able to acknowledge problems directly in Slack.
Slack attachments action should help
Split code into modules to have a cleaner approach
Add a docker file and document the building steps in the README.md
Had problems connecting to Slack API.
Did the following changes:
Icinga-bot.ini:
Added entry for proxy under [slack]
proxy_url = <PROXY SERVER>:<PORT>
i2_slack_modules/common.py:
Added parser under 'read common section'
config_dict["slack.proxy_url"] = config_handler.get(this_section, "proxy_url", fallback="")
Icinga-bot.py:
Added proxy to connection methods:
client = slack.WebClient(token=config["slack.bot_token"], ssl=slack_ssl_context, proxy=config["slack.proxy_url"], run_async=True)
and
rtm_client = slack.RTMClient( token=config["slack.bot_token"], ssl=slack_ssl_context, run_async=True, loop=loop, proxy="http://" + config["slack.proxy_url"] )
The last will probably fail splendidly if no proxy is defined :) But since the rim_client demanded 'http://' ...
Probably better ways to do this, but it works.
Thanks for making this bot!
R.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.