Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Generate alerts on error'd responses #225

Closed
hnnesv opened this issue May 5, 2014 · 4 comments
Closed

Generate alerts on error'd responses #225

hnnesv opened this issue May 5, 2014 · 4 comments
Assignees

Comments

@hnnesv
Copy link
Contributor

hnnesv commented May 5, 2014

On certain responses such as errors (http status 500), it would be valuable to generate an alert such as an email or sms in order to notify someone about this.

This could be handled on a per-channel basis using alert groups (defaultchannel-mapping.json):

{
  "urlPattern": "test/sample/.+",
  "host": "localhost",
  "port": 8080,
  "alertGroups": [
    {
      "status": "4xx",
      "group": "adminGroup1"
    },
    {
      "status": "500",
      "group": "adminGroup2"
    }
  ]
}

We could initially then allow for email and clickatell SMS's (since we already have experience with them and have an account we can use). Setup could be in a config file such as resources/alertGroups.json:

[
  {
    "group": "adminGroup1",
    "email": [ "admin1@somewhere.org", "admin2@somewhere.org" ],
    "sms": [ "27731234567" ]
  },
  {
    "group": "adminGroup2",
    "sms": [ "27732345678" ]
  }
]

In the above examples, if a transaction responds with anything in the 4xx range, emails and SMSs will be sent out to adminGroup1, while if a transaction responds with 500, an SMS will be sent out to adminGroup2.

In order not to spam people, we could restrict it to one alert per 24hour period (or handle this per config).

@rcrichton
Copy link
Member

Hi @devcritter, this is a good idea, I like it. This would be good for the new OpenHIM as well.

@hnnesv
Copy link
Contributor Author

hnnesv commented May 13, 2014

As discussed, we're rather going to put the development effort for this ticket into the new HIM:
jembi/openhim-core-js#46

I'll leave this issue open though in case somebody someday feels like picking this up.

@hnnesv
Copy link
Contributor Author

hnnesv commented May 29, 2014

So I guess the somebody picking this up is me :)

We'll be implementing this for RHIE, although I won't go as in depth as the design, only minimal functionality.

@hnnesv hnnesv self-assigned this May 29, 2014
@hnnesv
Copy link
Contributor Author

hnnesv commented Jun 5, 2014

After losing a lot of time struggling to get this functionality to (unsuccessfully) work in Mule, I decided to switch and set this up as a set of cron triggered python scripts:
https://github.com/jembi/openhim-report-tasks

Python ftw :)

Closing this issue for now, we can reopen it if someone feels like implementing this natively in the Mule HIM.

@hnnesv hnnesv closed this as completed Jun 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants