Skip to content

Instantly share code, notes, and snippets.

@qrohlf
Last active September 22, 2016 20:38
Show Gist options
  • Save qrohlf/9979074 to your computer and use it in GitHub Desktop.
Save qrohlf/9979074 to your computer and use it in GitHub Desktop.

Scout Realtime Install

#0. Install gem on server:

gem install scout_realtime
scout_realtime start

hemingway.qrohlf.com:5555 works now!

#1. Setup nginx reverse proxy:

create site:

/etc/nginx/sites-available/hemingway

server {
    server_name hemingway.qrohlf.com www.hemingway.qrohlf.com;
    listen 80;
    location / {
        proxy_pass http://localhost:5555; #serve realtime traffic with scout
    }
}

enable it

cd sites-enabled
sudo ln -s ../sites-available/hemingway .
sudo nginx -s reload

hemingway.qrohlf.com now shows stats!

#2. Setup upstart init script

/etc/init/scout.conf

# Scout Realtime Server Monitoring

description "Scout Realtime"

start on filesystem or runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5
umask 022
exec /usr/local/bin/scout_realtime -f 

Start the service:

sudo service scout start

"Crash" the service

sudo service scout status # note the pid
sudo kill -9 [pid]

Marvel at how the service is automatically restarted!

@basmith7
Copy link

could you do a systemd script for scout realtime?

@basmith7
Copy link

figured it out...

[Unit]
Description=Scout Realtime

[Service]
ExecStart=/usr/local/bin/scout_realtime -f
ExecStop=/usr/local/bin/scout_realtime stop
User=xxxx
Group=xxxx

[Install]
WantedBy=multi-user.target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment