Skip to content

Instantly share code, notes, and snippets.

@x684867
Created September 16, 2014 17:35
Show Gist options
  • Select an option

  • Save x684867/ab8c4341e408859569cc to your computer and use it in GitHub Desktop.

Select an option

Save x684867/ab8c4341e408859569cc to your computer and use it in GitHub Desktop.
This gist contains a script to install papertrail...
#!/bin/bash
#
# (c) 2014 EdgeCase, Inc. All Rights Reserved.
# sam@edgecase.io
#
apt-get install rsyslog-gnutls -y
cd /etc
wget https://papertrailapp.com/tools/papertrail-bundle.pem
cat > /etc/rsyslog.conf << EOF
# /etc/rsyslog.conf Configuration file for rsyslog.
#
\$ModLoad imuxsock # provides support for local system logging
\$ModLoad imklog # provides kernel logging support
\$ModLoad imfile
\$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
\$FileOwner root
\$FileGroup adm
\$FileCreateMode 0640
\$DirCreateMode 0755
\$Umask 0022
\$WorkDirectory /var/spool/rsyslog
\$DefaultNetstreamDriverCAFile /etc/papertrail-bundle.pem # trust these CAs
\$ActionSendStreamDriver gtls # use gtls netstream driver
\$ActionSendStreamDriverMode 1 # require TLS
\$ActionSendStreamDriverAuthMode x509/name # authenticate by hostname
\$ActionSendStreamDriverPermittedPeer *.papertrailapp.com
#
# Add any custom text files here.
#
#
*.* @@logs2.papertrailapp.com:38190
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment