Skip to content

Commit f21537d

Browse files
authored
1 parent 2a87b82 commit f21537d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ Using the opsreview tool, you can quickly compile a report on recent alerts for
1212
```
1313
> python pull_alerts.py
1414
15-
Time: Tuesday, January 19 - 9:19 AM
15+
Time: Tuesday, January 19 - 9:19 AM +0000
1616
Service: api
1717
Description: Failing API alarm: CRON failure
1818
URL: https://subdomain.pagerduty.com/incidents/ABC123
1919
Notes:
2020
['bob@lyft.com: #a - Re-ran CRON']
2121
22-
Time: Tuesday, January 19 - 12:03 PM
22+
Time: Tuesday, January 19 - 12:03 PM +0000
2323
Service: api
2424
Description: Failing API alarm: CPU percent > 10
2525
URL: https://subdomain.pagerduty.com/incidents/ABC124
2626
Notes:
2727
['bob@lyft.com: #na - Temporary spike in CPU, no action taken. Alert is too sensitive.']
2828
29-
Time: Tuesday, January 19 - 1:35 PM
29+
Time: Tuesday, January 19 - 1:35 PM +0000
3030
Service: www
3131
Description: Failing WWW alarm: 5XX percent > 5
3232
URL: https://subdomain.pagerduty.com/incidents/ABC125
@@ -57,3 +57,9 @@ Run the script.
5757
```bash
5858
python pull_alerts.py
5959
```
60+
61+
## Timezone
62+
By default, local timezone is used to print alert time. To change default timezone use `TZ` environment variable:
63+
```bash
64+
TZ=UTC python pull_alerts.py
65+
```

pull_alerts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class FormattedIncident(object):
3737
def pretty_output(self):
3838
return u'Time: {}\nService: {}\nDescription: {}\nURL: {}\nNotes:\n{}\n'.format(
39-
self.created_on.strftime('%A, %B %-d - %-I:%M %p'),
39+
self.created_on.strftime('%A, %B %-d - %-I:%M %p %z'),
4040
self.service,
4141
self.description,
4242
self.url,

0 commit comments

Comments
 (0)