Skip to content

Commit

Permalink
Add output from last check to problem
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianCzoch committed Mar 11, 2019
1 parent f050447 commit 47b14b9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ icinga2-bitbar
This is [Icinga2](https://icinga.com) plugin for [Bitbar](https://github.com/matryer/bitbar). It is using Icinga2 API.

## Screenshots
![screenshot](./assets/bitbar.png)
![screenshot](./assets/bitbar1.png)

![screenshot](./assets/bitbar2.png)

## Features
* Show list of
Expand Down
Binary file removed assets/bitbar.png
Binary file not shown.
Binary file added assets/bitbar1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/bitbar2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/mock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ echo "Services: 10002934"
echo "---"
echo "Host problems"
echo "kittens-a-0.internal | color=#ff0000"
echo "--HOST IS DOWN"
echo "-- Acknowledge | href=\"#\""
echo "-- Check now | href=\"#\""
echo "---"
Expand Down
6 changes: 5 additions & 1 deletion bitbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# <bitbar.author>Sebastian Czoch</bitbar.author>
# <bitbar.author.github>SebastianCzoch</bitbar.author.github>
# <bitbar.desc>Icinga2 monitoring BitBar plugin</bitbar.desc>
# <bitbar.image>https://github.com/SebastianCzoch/icinga2-bitbar/blob/master/assets/bitbar.png?raw=true</bitbar.image>
# <bitbar.image>https://github.com/SebastianCzoch/icinga2-bitbar/blob/master/assets/bitbar2.png?raw=true</bitbar.image>
# <bitbar.dependencies>python3,requests</bitbar.dependencies>
# <bitbar.abouturl>https://github.com/SebastianCzoch/icinga2-bitbar</bitbar.abouturl>

Expand Down Expand Up @@ -112,6 +112,7 @@ def __print_service(item):
__get_color_for_item(item),
)
)
print("--{}".format(item["attrs"]["last_check_result"]["output"]))
print(
'--Acknowledge | bash={} param2=ack param3=service param4="{}" terminal=false refresh=true'.format(
SCRIPT_PATH, item["attrs"]["__name"]
Expand All @@ -133,6 +134,7 @@ def __print_service_acked(item):
__get_color_for_item(item),
)
)
print("----{}".format(item["attrs"]["last_check_result"]["output"]))
print(
'----Remove acknowledgement | bash={} param2=remove_ack param3=service param4="{}" terminal=false refresh=true'.format(
SCRIPT_PATH, item["attrs"]["__name"]
Expand All @@ -152,6 +154,7 @@ def __print_host(item):
item["attrs"]["display_name"], __get_color_for_item(item)
)
)
print("--{}".format(item["attrs"]["last_check_result"]["output"]))
print(
'--Acknowledge | bash={} param2=ack param3=host param4="{}" terminal=false refresh=true'.format(
SCRIPT_PATH, item["attrs"]["__name"]
Expand All @@ -171,6 +174,7 @@ def __print_host_acked(item):
item["attrs"]["display_name"], __get_color_for_item(item)
)
)
print("----{}".format(item["attrs"]["last_check_result"]["output"]))
print(
'----Remove acknowledgement | bash={} param2=remove_ack param3=host param4="{}" terminal=false refresh=true'.format(
SCRIPT_PATH, item["attrs"]["__name"]
Expand Down

0 comments on commit 47b14b9

Please sign in to comment.