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

Enhancements #71

Merged
merged 53 commits into from May 13, 2015
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3a59a73
Added support to Debian OS
Oct 27, 2014
7210c7d
Added a check for syslog-ng
Oct 28, 2014
b782617
Check if logs are parsed in Loggly
Oct 28, 2014
ca64536
Check if logs are parsed in Loggly
Oct 28, 2014
c217c36
Check if logs are parsed in Loggly
Oct 28, 2014
c60835a
Added support to suppress prompts
Oct 31, 2014
c53de77
Added support to suppress prompts
Oct 31, 2014
995d96a
Added support to suppress prompts
Oct 31, 2014
ac4f3f1
Added support to suppress prompts
Oct 31, 2014
8ea9e55
Added support to suppress prompts
Oct 31, 2014
6e316ad
Added support to suppress prompts
Oct 31, 2014
32cb0b8
Linux Script: Minor Bug Fix
Oct 31, 2014
743fc92
Linux Script: Bug Fix
Nov 4, 2014
48e750b
File Monitoring: Check if logs are rotated.
Nov 6, 2014
1afae10
File Monitoring: Check if logs are rotated.
Nov 11, 2014
bdddbb0
Updated Mac logs link
Nov 12, 2014
ee39dc6
Checks if log rotation is enabled on the File
Nov 20, 2014
76af2ad
Checks if log rotation is enabled on the Log files
Nov 20, 2014
65e3be8
Checks if log rotation is enabled on the Log files
Nov 20, 2014
8aff0e5
Minor modifications
Nov 21, 2014
9d3f561
Minor modifications
Nov 21, 2014
25754be
Minor modifications
Nov 21, 2014
33d993d
Added support to multiple tags
Nov 25, 2014
75c172c
Added support to multiple tags
Nov 25, 2014
f8a92a1
Added support to multiple tags
Nov 25, 2014
e083b05
Added support to multiple tags
Nov 26, 2014
5b59acb
Linux Script: Bug Fixes.
Dec 2, 2014
4669afc
Removed Log Rotation Check
Dec 2, 2014
8e33628
Removed Log Rotation Check
Dec 2, 2014
b907287
Removed Log Rotation Check
Dec 2, 2014
245c946
Bug Fixes
Dec 3, 2014
0f2b748
Bug Fixes
Dec 3, 2014
2d26c06
Remove state files on same alias
Dec 15, 2014
d642646
Bug Fixes
varshneyjayant Jan 21, 2015
c382fc1
Added troubleshooting rsyslog link
varshneyjayant Jan 23, 2015
4a6fba1
Added troubleshooting rsyslog link
varshneyjayant Jan 23, 2015
352212d
Revert "Added troubleshooting rsyslog link"
Jan 23, 2015
af0be39
Revert "Added troubleshooting rsyslog link"
Jan 23, 2015
b67a2c8
Added rsyslog troubleshooting link
Jan 23, 2015
95cb2ab
Added support to Disk Assisted queues
varshneyjayant Mar 4, 2015
bf14a8e
Added support to Directory Monitoring
varshneyjayant Mar 4, 2015
884113e
Added Mac Script
Mar 4, 2015
ded22fe
Added README
varshneyjayant Mar 4, 2015
3215989
Bug Fixes
Mar 18, 2015
62fce97
Bug fixes for syslog-ng detection
varshneyjayant Mar 24, 2015
164b2f4
Improved syslog-ng detection
varshneyjayant Mar 27, 2015
2a44bab
Improved error text
Mar 27, 2015
074e02a
Bug Fixes
varshneyjayant Apr 3, 2015
35cda1c
version number update from 1.0 to 1.1
varshneyjayant Apr 22, 2015
9afecfa
version number update from 1.12 to 1.13
varshneyjayant Apr 22, 2015
271d3cd
checks if cron is running during rollback
varshneyjayant Apr 22, 2015
6da5dad
Added script to publish on S3
varshneyjayant May 6, 2015
4d7af77
Updated Manual instructions
varshneyjayant May 6, 2015
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Added support to suppress prompts

A new argument '-s' is added to the script to support the 'No Prompt' mode. User can use this argument if he wants to give no inputs in the script at runtime.
  • Loading branch information
psquickitjayant
psquickitjayant committed Oct 31, 2014
commit ac4f3f14c89212cd25b802a5df687dba511fc9d1
@@ -9,7 +9,7 @@ source configure-linux.sh "being-invoked"
#name of the current script
SCRIPT_NAME=configure-nginx.sh
#version of the current script
SCRIPT_VERSION=1.1
SCRIPT_VERSION=1.2

#we have not found the nginx version yet at this point in the script
APP_TAG="\"nginx-version\":\"\""
@@ -137,20 +137,24 @@ checkLogFileSize()
errorFileSize=$(wc -c "$2" | cut -f 1 -d ' ')
fileSize=$((accessFileSize+errorFileSize))
if [ $fileSize -ge 102400000 ]; then
logMsgToConfigSysLog "INFO" "INFO: "
while true; do
read -p "WARN: There are currently large log files which may use up your allowed volume. Please rotate your logs before continuing. Would you like to continue now anyway? (yes/no)" yn
case $yn in
[Yy]* )
logMsgToConfigSysLog "INFO" "INFO: Current nginx logs size is $fileSize bytes. Continuing with nginx Loggly configuration.";
break;;
[Nn]* )
logMsgToConfigSysLog "INFO" "INFO: Current nginx logs size is $fileSize bytes. Discontinuing with nginx Loggly configuration."
exit 1
break;;
* ) echo "Please answer yes or no.";;
esac
done
if [ "$SUPPRESS_PROMPT" == "false" ]; then
while true; do
read -p "WARN: There are currently large log files which may use up your allowed volume. Please rotate your logs before continuing. Would you like to continue now anyway? (yes/no)" yn
case $yn in
[Yy]* )
logMsgToConfigSysLog "INFO" "INFO: Current nginx logs size is $fileSize bytes. Continuing with nginx Loggly configuration.";
break;;
[Nn]* )
logMsgToConfigSysLog "INFO" "INFO: Current nginx logs size is $fileSize bytes. Discontinuing with nginx Loggly configuration."
exit 1
break;;
* ) echo "Please answer yes or no.";;
esac
done
else
logMsgToConfigSysLog "WARN" "WARN: There are currently large log files which may use up your allowed volume."
logMsgToConfigSysLog "INFO" "INFO: Current nginx logs size is $fileSize bytes. Continuing with nginx Loggly configuration.";
fi
elif [ $fileSize -eq 0 ]; then
logMsgToConfigSysLog "WARN" "WARN: There are no recent logs from nginx there so won't be any sent to Loggly. You can generate some logs by visiting a page on your web server."
exit 1
@@ -162,19 +166,25 @@ write21NginxConfFile()
#Create nginx syslog config file if it doesn't exist
echo "INFO: Checking if nginx sysconf file $NGINX_SYSLOG_CONFFILE exist."
if [ -f "$NGINX_SYSLOG_CONFFILE" ]; then
logMsgToConfigSysLog "WARN" "WARN: nginx syslog file $NGINX_SYSLOG_CONFFILE already exist."
while true; do
read -p "Do you wish to override $NGINX_SYSLOG_CONFFILE? (yes/no)" yn
case $yn in
[Yy]* )
logMsgToConfigSysLog "INFO" "INFO: Going to back up the conf file: $NGINX_SYSLOG_CONFFILE to $NGINX_SYSLOG_CONFFILE_BACKUP";
sudo mv -f $NGINX_SYSLOG_CONFFILE $NGINX_SYSLOG_CONFFILE_BACKUP;
write21NginxFileContents;
break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
logMsgToConfigSysLog "WARN" "WARN: nginx syslog file $NGINX_SYSLOG_CONFFILE already exist."
if [ "$SUPPRESS_PROMPT" == "false" ]; then
while true; do
read -p "Do you wish to override $NGINX_SYSLOG_CONFFILE? (yes/no)" yn
case $yn in
[Yy]* )
logMsgToConfigSysLog "INFO" "INFO: Going to back up the conf file: $NGINX_SYSLOG_CONFFILE to $NGINX_SYSLOG_CONFFILE_BACKUP";
sudo mv -f $NGINX_SYSLOG_CONFFILE $NGINX_SYSLOG_CONFFILE_BACKUP;
write21NginxFileContents;
break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
else
logMsgToConfigSysLog "INFO" "INFO: Going to back up the conf file: $NGINX_SYSLOG_CONFFILE to $NGINX_SYSLOG_CONFFILE_BACKUP";
sudo mv -f $NGINX_SYSLOG_CONFFILE $NGINX_SYSLOG_CONFFILE_BACKUP;
write21NginxFileContents;
fi
else
write21NginxFileContents
fi
@@ -302,7 +312,7 @@ remove21NginxConfFile()
usage()
{
cat << EOF
usage: configure-nginx [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)]
usage: configure-nginx [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-s suppress prompts {optional)]
usage: configure-nginx [-a loggly auth account or subdomain] [-r to rollback]
usage: configure-nginx [-h for help]
EOF
@@ -334,6 +344,9 @@ while [ "$1" != "" ]; do
-r | --rollback )
LOGGLY_ROLLBACK="true"
;;
-s | --suppress )
SUPPRESS_PROMPT="true"
;;
-h | --help)
usage
exit
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.