$ python get_logs.py rds-db-instance-name rds.log aws-access-key aws-secret-key
$ ./pgbadger -p '%t:%r:%u@%d:[%p]:' ./rds.log
$ open out.html
This file contains hidden or 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
; | |
; Riemann Service Down Alerts | |
; =================================================== | |
; | |
; The index stores the most recent state for any [host, service] pair. Clients | |
; can search the index for various states with a basic query language. The | |
; default implementation is a NonBlockingHashMap. | |
; | |
(let [my-index (index) |
This file contains hidden or 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
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; |
A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E
- WAL-E: https://github.com/wal-e/wal-e
- Assuming Ubuntu 12.04 LTS ("Precise")
- We'll be using S3. Make sure you have an IAM in a group with
GetObject
,ListBucket
andPutObject
on the bucket you want to use (and that it's not public).
- These packages:
This file contains hidden or 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
vagrant@precise64:~$ irb | |
1.9.3-p484 :002 > require "riemann" | |
=> true | |
# Activate maintenance-mode: | |
1.9.3-p484 :010 > Riemann::Client.new << {service: "maintenance-mode", host: "precise64", state: "active", ttl: Float::INFINITY} | |
=> nil | |
# Deactivate maintenance-mode: | |
1.9.3-p484 :011 > Riemann::Client.new << {service: "maintenance-mode", host: "precise64", state: nil, ttl: Float::INFINITY} | |
=> nil |
This file contains hidden or 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
version: 1 | |
formatters: | |
simple: | |
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
handlers: | |
console: | |
class: logging.StreamHandler | |
level: DEBUG | |
formatter: simple | |
stream: ext://sys.stdout |
This file contains hidden or 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
_ssh_auth_save() { | |
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock.$HOSTNAME" | |
} | |
alias screen='_ssh_auth_save ; export HOSTNAME=$(hostname) ; screen' | |
alias tmux='_ssh_auth_save ; export HOSTNAME=$(hostname) ; tmux' |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
This file contains hidden or 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
# | |
# Since I have to look this up every time... | |
# | |
# Add the following in /etc/default/tomcat7 | |
# | |
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote" | |
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=9991" | |
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false" | |
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" |