thegreenrobot / pagerduty_dashing

A Dashing dashboard for PagerDuty Services & Schedules
MIT License
44 stars 23 forks source link

pagerduty with no heroku/rails? #25

Open tweedyjm opened 8 years ago

tweedyjm commented 8 years ago

Looking at the code, I am thinking that pagerduty_dashing won't work with regular sinatra Dashing. My team doesn't have or use Heroku, and of the widgets we've deployed, are for sinatra.

thegreenrobot commented 8 years ago

Prior to converting this over to run on Heroku, I ran this on a server for over a year so it is doable. Lemme look T this again, it's been a while. :)

tweedyjm commented 8 years ago

I certainly appreciate it. I’ve been trying to work out how we were going to setup a heroku server and setup a dashing-rails in addition to a sinatra server, and on and on and on. This would be great help.

-Jeremy Tweedy

On Jan 22, 2016, at 5:36 PM, Matthew Green notifications@github.com<mailto:notifications@github.com> wrote:

Prior to converting this over to run on Heroku, I ran this on a server for over a year so it is doable. Lemme look T this again, it's been a while. :)

— Reply to this email directly or view it on GitHubhttps://github.com/thegreenrobot/pagerduty_dashing/issues/25#issuecomment-174087843.

cjwallgren commented 8 years ago

Have you had any success in finding the local server code? I'd like to be able to run this directly from regular sinatra dashing. Thanks!

thegreenrobot commented 8 years ago

Hi there, thanks for reaching out.

So this works out of the box with no additional magic. To get pagerduty_dashing running locally you just need to set the PagerDuty environment variables.

$ cat environment.sh
#!/bin/bash

export PAGERDUTY_URL='https://yourname.pagerduty.com'
export PAGERDUTY_APIKEY='insert_api_key_here'
export PAGERDUTY_SERVICES='{"services": { "staging": "ZZZZZZ","preprod": "BBBBBB","production": "PPPPPP"}}'
export PAGERDUTY_SCHEDULES='{"schedules": { "oncall": "CCCCCC","firefighter": "EEEEEE"}}'

$ source environment.sh
$ dashing start
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:3030, CTRL+C to stop
127.0.0.1 - - [09/Apr/2016 15:00:57] "GET /pagerduty HTTP/1.1" 200 3043 0.0026
127.0.0.1 - - [09/Apr/2016 15:00:57] "GET /events HTTP/1.1" 200 - 1.6717
127.0.0.1 - - [09/Apr/2016 15:00:59] "GET /views/text.html HTTP/1.1" 200 175 0.0007
127.0.0.1 - - [09/Apr/2016 15:00:59] "GET /views/hotness.html HTTP/1.1" 200 192 0.0006

( if dashing start doesn't work, alternatively you could use rackup -p 3030 -s webrick )

Open a new tab in your browser and navigate to http://localhost:3030