This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from caskdata/feature_release/gh144-to-release35
CDAP-7660 Use scripts to check status of CDAP Auth Server/Router
- Loading branch information
Showing
3 changed files
with
81 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# coding=utf8 | ||
# Copyright © 2016 Cask Data, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
import logging | ||
|
||
from resource_management import * | ||
|
||
RESULT_STATE_OK = 'OK' | ||
RESULT_STATE_CRITICAL = 'CRITICAL' | ||
RESULT_STATE_UNKNOWN = 'UNKNOWN' | ||
|
||
LOGGER_EXCEPTION_MESSAGE = "[Alert] CDAP Auth Server Health on {0} fails:" | ||
logger = logging.getLogger('ambari_alerts') | ||
|
||
|
||
def execute(configurations={}, parameters={}, host_name=None): | ||
if configurations is None: | ||
return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to the script.']) | ||
try: | ||
check_cmd = format('service cdap-auth-server status') | ||
Execute(check_cmd, timeout=5) | ||
return(RESULT_STATE_OK, ['Auth Server OK - CDAP Auth Server is running']) | ||
except: | ||
return(RESULT_STATE_CRITICAL, [LOGGER_EXCEPTION_MESSAGE]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# coding=utf8 | ||
# Copyright © 2016 Cask Data, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
|
||
import logging | ||
|
||
from resource_management import * | ||
|
||
RESULT_STATE_OK = 'OK' | ||
RESULT_STATE_CRITICAL = 'CRITICAL' | ||
RESULT_STATE_UNKNOWN = 'UNKNOWN' | ||
|
||
LOGGER_EXCEPTION_MESSAGE = "[Alert] CDAP Router Health on {0} fails:" | ||
logger = logging.getLogger('ambari_alerts') | ||
|
||
|
||
def execute(configurations={}, parameters={}, host_name=None): | ||
if configurations is None: | ||
return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to the script.']) | ||
try: | ||
check_cmd = format('service cdap-router status') | ||
Execute(check_cmd, timeout=5) | ||
return(RESULT_STATE_OK, ['Router OK - CDAP Router is running']) | ||
except: | ||
return(RESULT_STATE_CRITICAL, [LOGGER_EXCEPTION_MESSAGE]) |