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

All the changes between the two forks. #81

Merged
merged 28 commits into from Jul 13, 2016
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
882b339
checking connectivity using telnet
varshneyjayant May 13, 2015
8eb4f1a
Added check for xcode command line tools
varshneyjayant May 15, 2015
b7c061f
fluent.conf now created in .loggly
varshneyjayant May 19, 2015
f8d885f
Added support to Tomcat 8 (package version)
Jul 9, 2015
8cca0cf
Added new syntax support
varshneyjayant Jan 11, 2016
3e40991
Added support for Access logs
varshneyjayant Jan 22, 2016
b87e366
Added support for Access logs
varshneyjayant Jan 22, 2016
13f4681
Merge pull request #3 from psquickitjayant/script-dev-2
varshneyjayant Jan 27, 2016
6961b2e
Added Mac script README link
varshneyjayant Jan 27, 2016
7c8a520
Create update-loggly-certificate.sh
varshneyjayant Feb 26, 2016
94c641b
Default Test Mode and Bug Fixes
varshneyjayant Feb 29, 2016
9620d00
Updated Certificate Path
varshneyjayant Mar 1, 2016
e03a420
Updated Certificate Path
varshneyjayant Mar 2, 2016
e4be7a7
Added Trapping Control + C
varshneyjayant Mar 3, 2016
b3ae0af
Added Sleep after updating Hosts file
varshneyjayant Mar 4, 2016
15dc9f7
Added MaxMessageSize
varshneyjayant Mar 9, 2016
69b90da
Configure Tomcat Access Logs
varshneyjayant Mar 9, 2016
97afefe
Added support for Systemd
varshneyjayant Mar 14, 2016
1c5ff65
Added support for Systemd
varshneyjayant Mar 14, 2016
09c09c3
Added support for Rsyslog Systemd service
varshneyjayant Mar 23, 2016
2f8d252
Added support for Systemd
varshneyjayant Mar 31, 2016
ee9768e
Delete configure-linux-systemd.sh
varshneyjayant Mar 31, 2016
a3200f0
Updated Script Version
varshneyjayant Mar 31, 2016
b78ff00
Changed Fluentd's install directory
varshneyjayant Apr 6, 2016
bae0b60
Fixed Base64 decode issue
varshneyjayant Apr 6, 2016
40f1b4e
Added support for amazon ami
varshneyjayant Apr 21, 2016
147ba9c
Merge pull request #6 from psquickitjayant/amazon-ami-support
varshneyjayant Apr 21, 2016
ad360ea
Merge pull request #5 from psquickitjayant/rsyslog-systemd
varshneyjayant May 4, 2016
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Added check for xcode command line tools

  • Loading branch information
varshneyjayant committed May 15, 2015
commit 8eb4f1a5373c3d081112ca8f33449ff817bd1b60
@@ -15,7 +15,7 @@ function ctrl_c() {
#name of the current script. This will get overwritten by the child script which calls this
SCRIPT_NAME=configure-mac.sh
#version of the current script. This will get overwritten by the child script which calls this
SCRIPT_VERSION=1.1
SCRIPT_VERSION=1.2

#application tag. This will get overwritten by the child script which calls this
APP_TAG=
@@ -89,6 +89,8 @@ PROP_FILE=
#manual instructions to be show in case of error
MANUAL_CONFIG_INSTRUCTION="Manual instructions to configure Loggly on Mac are available at https://www.loggly.com/docs/send-mac-logs-to-loggly/."

MANUAL_XCODE_INSTALL_INSTRUCTION="Xcode command line tools are not installed on your system. Try running \"xcode-select --install\" to install xcode command line tools and run script again. You can download tools manually from https://developer.apple.com/"

checkMacLogglyCompatibility()
{
#check if the user has root permission to run this script
@@ -115,7 +117,10 @@ checkMacLogglyCompatibility()
#check if minimum version of ruby is installed
checkIfMinRubyVersionInstalled

MAC_ENV_VALIDATED="true"
#check if xcode command line tools are installed
checkIfXCodeCommandlineToolsInstalled

MAC_ENV_VALIDATED="true"
}

# executing the script for loggly to install and configure fluentd.
@@ -191,9 +196,9 @@ checkIfUserHasRootPrivileges()
#check if supported operating system
checkIfSupportedOS()
{
# Determine OS platform
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
MAC_DIST=$UNAME
# Determine OS platform
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
MAC_DIST=$UNAME
if [ "$MAC_DIST" == "darwin" ]; then
logMsgToConfigSysLog "INFO" "INFO: Operating system is Mac"
else
@@ -304,6 +309,18 @@ checkIfMinRubyVersionInstalled()
fi
}

checkIfXCodeCommandlineToolsInstalled()
{
logMsgToConfigSysLog "INFO" "INFO: Checking if Xcode command line tools are installed."

if [ $(xcode-select -p 2>/dev/null | wc -l ) == 0 ]; then
logMsgToConfigSysLog "ERROR" "ERROR: $MANUAL_XCODE_INSTALL_INSTRUCTION"
exit 1
else
logMsgToConfigSysLog "INFO" "INFO: Xcode command line tools are installed in your system."
fi
}

#this functions checks if the Fluentd gem is installed in the system
checkIfFluentdInstalled()
{
@@ -333,8 +350,8 @@ installFluentd()
#this function installs Loggly fluentd plugin
installLogglyFluentdPlugin()
{
logMsgToConfigSysLog "INFO" "INFO: Installing Loggly plugin for Fluentd"
sudo gem install fluent-plugin-loggly
logMsgToConfigSysLog "INFO" "INFO: Installing Loggly plugin for Fluentd"
sudo gem install fluent-plugin-loggly
logMsgToConfigSysLog "INFO" "INFO: Loggly fluentd plugin installed successfully."
}

@@ -415,7 +432,7 @@ configureFluentdAsService()
fi

sudo touch $PROP_FILE
sudo chmod +x $PROP_FILE
sudo chmod +x $PROP_FILE

propStr="
<?xml version="1.0" encoding="UTF-8"?>
@@ -455,7 +472,10 @@ startFluentdService()
#check if the logs made it to Loggly
checkIfLogsMadeToLoggly()
{
logMsgToConfigSysLog "INFO" "INFO: Sending test message to Loggly."
logMsgToConfigSysLog "INFO" "INFO: Sending test message to Loggly. Waiting for 30 secs."

#sleeping for 30 secs so that fluentd service can start doing its work properly
sleep 30
uuid=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)

queryParam="tag%3AMac%20$uuid"
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.