Skip to content

Commit

Permalink
Final Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastian-Kuhn committed Sep 8, 2022
1 parent 6432a3c commit 168c3e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from application.modules.log import Log


VERSION = '2.0.0-beta1'
VERSION = '2.0.0'


app = Flask(__name__)
Expand Down
14 changes: 9 additions & 5 deletions application/plugins_shipped/target_cmk2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
def cli_cmk():
"""Checkmk commands"""

# .-- Class Update CMKv2
class UpdateCMKv2(CMK2):
"""
Update Functions
Expand Down Expand Up @@ -274,8 +275,9 @@ def update_host(self, db_host, cmk_host, folder, labels, additional_attributes=N
print(f"{ColorCodes.OKBLUE} *{ColorCodes.ENDC} Updated Host in Checkmk")
db_host.set_export_sync()


@cli_cmk.command('hosts_export')
#.
# .-- Command: Export Hosts
@cli_cmk.command('export_hosts')
@click.argument("account")
def cmk_host_export(account):
"""Add hosts to a CMK 2.x Insallation"""
Expand All @@ -288,7 +290,8 @@ def cmk_host_export(account):
print(f"{ColorCodes.FAIL} Target not found {ColorCodes.ENDC}")
except CmkException as error_obj:
print(f'C{ColorCodes.FAIL}MK Connection Error: {error_obj} {ColorCodes.ENDC}')

#.
# .-- Command: Host Debug
@cli_cmk.command('debug_host')
@click.argument("hostname")
def debug_cmk_rules(hostname):
Expand Down Expand Up @@ -326,8 +329,8 @@ def debug_cmk_rules(hostname):
pprint(params_import)
print(f"{ColorCodes.UNDERLINE}Actions based on Action Rules {ColorCodes.ENDC}")
pprint(actions)


#.
# .-- Command: Print All
@cli_cmk.command('print_all')
def get_cmk_data():
"""Print List of all Hosts and their Labels"""
Expand All @@ -345,3 +348,4 @@ def get_cmk_data():
print(extra_actions)
print(f"Labels for {db_host.hostname}")
pprint(applied_labels)
#.

0 comments on commit 168c3e6

Please sign in to comment.