This repository has been archived by the owner on May 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
6 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 @@ | ||
requests==2.22.0 |
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,16 @@ | ||
import requests | ||
import sys | ||
|
||
kibana_uri = 'http://localhost:5601/app/kibana' | ||
|
||
try: | ||
resp = requests.get(kibana_uri) | ||
except Exception as e: | ||
print("Failed to get %s: %s" % (kibana_uri, e.message)) | ||
sys.exit(1) | ||
else: | ||
if resp.status_code == 200: | ||
sys.exit(0) | ||
else: | ||
print("kibana response with: %s" % resp.reason) | ||
sys.exit(1) |
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,23 @@ | ||
import requests | ||
import sys | ||
import json | ||
|
||
kibana_uri = 'http://localhost:5601/api/saved_objects/_find?type=dashboard&fields=id&fields=title' | ||
|
||
try: | ||
resp = requests.get(kibana_uri) | ||
except Exception as e: | ||
print("Failed to get %s: %s" % (kibana_uri, e.message)) | ||
sys.exit(1) | ||
else: | ||
if resp.status_code == 200: | ||
jd = resp.json() | ||
if (jd['total'] != 0): | ||
print("total dashboards: %d" % jd['total']) | ||
sys.exit(0) | ||
else: | ||
print("kibana response with 0 dashboards: %s" % json.dumps(jd)) | ||
sys.exit(1) | ||
else: | ||
print("kibana response with: %s" % resp.reason) | ||
sys.exit(1) |