Closed d-zalewski closed 8 years ago
Hi there,
Sorry to hear about your troubles. Based on that error message, it's pointing to https://github.com/thegreenrobot/pagerduty_dashing/blob/master/jobs/pagerduty_oncall.rb#L7.
Do you have a environment variable with your PagerDuty schedules?
Hi,
I have below in pagerduty_oncall.rb
env_schedules = ENV['Infrastructure - Primary on call rota']
Hi there,
As noted in the README, the environment variable for the schedules should like this:
{"schedules": { "oncall": "ABC1234","firefighter": "QAZ4567"}}
I've tried below and still no luck. Does the value have to be id not the name?
"PAGERDUTY_SCHEDULES": "{"schedules": { "oncall": "Infrastructure - Primary on call rota"}}"
When I query pagerduty API directly I'm getting:
{
"limit": 100,
"offset": 0,
"schedules": [
{
"description": "",
"escalation_policies": [
{
"id": "XXXXXXX",
"name": "Infrastructure - Escalation policy"
}
],
"id": "XXXXXXX",
"name": "Infrastructure - Primary on call rota",
"time_zone": "XXXXXXX",
"today": "2016-03-02"
},
{
"description": "",
"escalation_policies": [
{
"id": "XXXXXXX",
"name": "Infrastructure - Escalation policy"
}
],
"id": "XXXXXXX",
"name": "Infrastructure - Secondary on call rota",
"time_zone": "XXXXXXX",
"today": "2016-03-02"
}
],
"total": 2
}
Hi there,
It needs to be the actual id of the schedule, you're giving it the name.
The oncall job is making a call to https://developer.pagerduty.com/documentation/rest/schedules/entries in https://github.com/thegreenrobot/pagerduty_dashing/blob/master/jobs/pagerduty_oncall.rb#L26
Sorry for being a pain but IDs aren't working too. Probably something with my json...
"PAGERDUTY_SCHEDULES": "{"schedules": { "oncall": "PIH8XXX","firefighter": "P78PXXX"}}"
Are you trying to deploy this to Heroku using the push button?
If yes the value of the PAGERDUTY_SCHEDULES field just needs to be {"schedules": { "oncall": "ABC1234","firefighter": "QAZ4567"}}
Also, I just deployed to Heroku using the push button yesterday and all was well.
I don't use Heroku. Just copied pagerduty_oncall.rb into jobs folder in my dashing dashboard and app.json where vars are set to the dashboard folder. I've tried cloning the whole repo and starting dashing from there and getting same problem.
srv1:root:/var/www/html/ops_tv_dev> ll dashboards/pagerduty.erb
-rw-rw-r--. 1 root root 2072 Mar 1 10:52 dashboards/pagerduty.erb
srv1:root:/var/www/html/ops_tv_dev> ll app.json
-rw-rw-r--. 1 root root 578 Mar 2 14:37 app.json
I've added below to my custom dashboard:
<li data-row="2" data-col="3" data-sizex="1" data-sizey="1">
<div data-id="oncall-name" data-view="Text" data-title="Primary Oncall" data-moreinfo="Fix all the incidents!"</div>
</li>
The code as is, assumes that you are going to deploy to Heroku and that's what the app.json is for.
The incidents and oncall jobs take PagerDuty configuration data via environment variables. You could very easily change the code locally to read the PagerDuty variables from a local file (json) or set your own environment variables.
I know that is possible b/c I used to run this on a server (not Heroku) and all of the PagerDuty variables were defined in a json file.
My bad. I corrected environments and its all working fine now.
Thanks for help!
I'm getting below when trying to start dashing with pagerduty widget enabled:
My Gemfile includes:
gem 'dashing' gem 'rest-client' gem 'faraday'