Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rhigdon updates merge and obfuscate #29

Merged
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

update to give us a configurable domain

  • Loading branch information
rhigdon committed Aug 31, 2013
commit 0b9eb2c189d6479d4a42e174834477eea2f4cb48
@@ -54,6 +54,7 @@
PROD_RSYSLOG = 2
PROD_UNSUPPORTED = -1

LOGGLY_DOMAIN = "gen2.loggly.com"
LOGGLY_SYSLOG_SERVER = "logs-01.loggly.com"
LOGGLY_SYSLOG_PORT = 514
DISTRIBUTION_ID = "41058"
@@ -80,10 +81,9 @@
"to manually re-configure syslog for Loggly.")
STR_SYSLOG_DAEMON_MESSAGE = ("\nSyslog daemon (%s) is not running. "
"Please start %s daemon and try again.\n")
REST_URL_GET_AUTH_TOKEN = ("http://%s.loggly.com/apiv2/customer")
REST_URL_GET_SEARCH_ID = ("http://%s.loggly.com"
"/apiv2/search?q=%s&from=-2h&until=now&size=10")
REST_URL_GET_SEARCH_RESULT = ("http://%s.loggly.com/apiv2/events?rsid=%s")
REST_URL_GET_AUTH_TOKEN = ("http://%s.%s/apiv2/customer")
REST_URL_GET_SEARCH_ID = ("http://%s.%s/apiv2/search?q=%s&from=-2h&until=now&size=10")
REST_URL_GET_SEARCH_RESULT = ("http://%s.%s/apiv2/events?rsid=%s")
USER_NAME_TEXT = ("Enter the username that you use to log into your Loggly account.")
ACCOUNT_NAME_TEXT = ("Enter your Loggly account name. This is your subdomain. "
"For example if you login at mycompany.loggly.com,"
@@ -842,7 +842,7 @@ def get_json_data(url, user, password):
sys_exit(reason = "%s" % e)

def get_auth(loggly_user, loggly_password, loggly_subdomain):
url = (REST_URL_GET_AUTH_TOKEN % (loggly_subdomain))
url = (REST_URL_GET_AUTH_TOKEN % (loggly_subdomain, LOGGLY_DOMAIN))
data = get_json_data(url, loggly_user, loggly_password)
auth_tokens = data["tokens"]
if not auth_tokens or AUTH_TOKEN_FAIL in LOGGLY_QA:
@@ -1129,14 +1129,14 @@ def doverify(loggly_user, loggly_password, loggly_subdomain):
Logger.printLog("Sending message (%s) to Loggly server (%s)"
% (dummy_message, LOGGLY_SYSLOG_SERVER))
os.popen("logger -p INFO '%s'" % dummy_message).read()
search_url = REST_URL_GET_SEARCH_ID % (loggly_subdomain, unique_string)
search_url = REST_URL_GET_SEARCH_ID % (loggly_subdomain, LOGGLY_DOMAIN, unique_string)
# Implement REST APIs to search if dummy message has been sent.
wait_time = 0
while wait_time < VERIFICATION_SLEEP_INTERAVAL:
Logger.printLog("Sending search request. %s" % search_url)
data = get_json_data(search_url, loggly_user, loggly_password)
rsid = data["rsid"]["id"]
search_result_url = REST_URL_GET_SEARCH_RESULT % (loggly_subdomain, rsid)
search_result_url = REST_URL_GET_SEARCH_RESULT % (loggly_subdomain, LOGGLY_DOMAIN, rsid)
Logger.printLog("Sending search result request. %s" % search_result_url)
data = get_json_data(search_result_url, loggly_user, loggly_password)
total_events = data["total_events"]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.