Code Monkey home page Code Monkey logo

openduty's Introduction

Build status

Gitter image Requirements Status

Important notice - project suspended

The ex-Ustream team which is now part of IBM are no longer maintaining this project. Feel free to fork it and maintain it somewhere else, we will leave it accessible here but no new merges or commits will be made. Soon we will set the repository to read-only on Github.

What is this?

Openduty is an incident escalation tool, just like Pagerduty . It has a Pagerduty compatible API too. It's the result of the first Ustream Hackathon. We enjoyed working on it. #Integrations Has been tested with Nagios, works well for us. Any Pagerduty Notifier using the Pagerduty API should work without a problem. Icinga2 config for openduty integration

Notifications

XMPP, email, SMS, Phone(Thanks Twilio for being awesome!), and Push notifications(thanks Pushover also),and Slack are supported at the moment.

Current status

Openduty is in Beta status, it can be considered stable at the moment, however major structural changes can appear anytime (not affecting the API, or the Notifier structure)

Contribution guidelines

Yes, please. You are welcome.

Feedback

Any feedback is welcome

Try it

go to http://openduty.herokuapp.com , log in with root/toor , create your own user. In heroku demo mode user edit feature is disabled, so you can't misbehave.

Running on Heroku

add the parts below to your settings.py and add psycopg2==2.5.1 to your requirements.txt

# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES['default'] =  dj_database_url.config()

# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Allow all host headers
ALLOWED_HOSTS = ['*']

# Static asset configuration
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

Contributors at Ustream

The team

Main contributors

Other contributors

Getting started:

sudo easy_install pip
sudo pip install virtualenv
virtualenv env --python python2.7
. env/bin/activate
pip install -r requirements.txt
export DJANGO_SETTINGS_MODULE=openduty.settings_dev
python manage.py syncdb
python manage.py migrate
python manage.py collectstatic
python manage.py runserver

now, you can start hacking on it.

After models you've changed your models please run:

./manage.py schemamigration openduty --auto
./manage.py schemamigration notification --auto
./manage.py migrate

If you see a new file appearing in migrations directory when pulling from upstream please run

./manage.py migrate

Default login:

root/toor

Celery worker:

celery -A openduty worker -l info

Login using basic authentication with LDAP-backend

Add the following snippet to your settings_prod/dev.py, dont forget about import

AUTH_LDAP_SERVER_URI = "ldap://fqdn:389"
AUTH_LDAP_BIND_DN = ""
AUTH_LDAP_BIND_PASSWORD = ""
AUTH_LDAP_START_TLS = False
AUTH_LDAP_MIRROR_GROUPS = True #Mirror LDAP Groups as Django Groups, and populate them as well.
AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=Group,dc=domain,dc=com",
    ldap.SCOPE_SUBTREE, "(&(objectClass=posixGroup)(cn=openduty*))"
)
AUTH_LDAP_GROUP_TYPE = PosixGroupType()

AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=People,dc=domain,dc=com",
ldap.SCOPE_SUBTREE, "(uid=%(user)s)")

AUTH_LDAP_USER_ATTR_MAP = {
"first_name": "uid",
"last_name": "sn",
"email": "mail"
}


AUTHENTICATION_BACKENDS = (
    'django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend',
)

MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
  'openduty.middleware.basicauthmiddleware.BasicAuthMiddleware',
)

openduty's People

Contributors

christ66 avatar deathowl avatar gitter-badger avatar gu3sss avatar jkapusi avatar kozmagabor avatar krutaw avatar leventyalcin avatar luto avatar mrweeble avatar sheran-g avatar zstakacs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openduty's Issues

Un-Acknowledge / Un-Resolve

Feature idea: There needs to be a way via the GUI to un-resolve or un-acknowledge an event so that it re-triggers.

Schedule.css not found

I got a lot of 404 on the openduty schedule view.

Where are these files (js and css?) I did not find them in the codebase.
misconfig

Open Duty HA

Hello.

Has anyone ever used OpenDuty in a HA, master-master mode?

Thanks

Turn off notifications

Give the user the ability to turn notifications temporarly off for him, or for a whole service. Remove this setting automatically after a given period of time.

OpenLDAP Integration

I updated the ldap configuration to refer to the locally installed openldap, under settings_dev.py as I would use the same settings configuration for running the env.

However, I don't see it working. I believe, there should be other configuration, which I couldn't find in the documentation, that would make the app to use ldap instead of db for authentication?

pip install throwing exception

pip install -r requirements.txt
Exception: Traceback (most recent call last): File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/commands/install.py", line 262, in run for req in parse_requirements(filename, finder=finder, options=options, session=session): File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/req.py", line 1631, in parse_requirements req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None)) File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/req.py", line 172, in from_line return cls(req, comes_from, url=url, prereleases=prereleases) File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/req.py", line 70, in __init__ req = pkg_resources.Requirement.parse(req) File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2606, in parse reqs = list(parse_requirements(s)) File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2544, in parse_requirements line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec") File "/root/virtualenvs/openduty/local/lib/python2.7/site-packages/pip/_vendor/pkg_resources.py", line 2512, in scan_list raise ValueError("Expected "+item_name+" in",line,"at",line[p:]) ValueError: ('Expected version spec in', 'kombu~=3.0', 'at', '~=3.0')

create_event 'details' field should be optional

Usign the following 'curl':

curl --insecure -H "Content-type: application/json" -H "Authorization: token yoursecretkey" -X POST -d '{"service_key":"MY_OPENDUTY_SERVICE_KEY","event_type":"trigger","description":"test","incident_key":"1234567"}' https://SCRUBBED/api/create_event

Gives:

KeyError at /api/create_event ******
'details'

If I provide the details field, the incident is created OK.

Conversely, the following:

curl --insecure -H "Content-type: application/json" -H "Authorization: token yoursecretkey" -X POST -d '{"service_key":"MY_PAGERDUTY_SERVICE_KEY","event_type":"trigger","description":"test","incident_key":"1234567"}' https://events.pagerduty.com/generic/2010-04-15/create_event.json

returns:

{"status":"success","message":"Event processed","incident_key":"1234567"}

The API docs at https://v2.developer.pagerduty.com/docs/trigger-events do not flag details field as required. It is making the integration with the PagerDuty Drupal module fail, since the module function correctly handles the details field as optional, as shown on this line.

If this can be easily solved, I think that OpenDuty will be swappable with PD when I finishthe module's customization to allow it to use a endpoint URL other than https://events.pagerduty.com/...

Can't send the mail

Hi,
I am can't send the mail in Pagerduty. Please help me how to configure the mail setting.

I have configured the mail setting in here method

EMAIL_SETTINGS = {
'user': "[email protected]",
'password': "password"
}

If above step right. But send the mail and not error getting me.

Demo Login does not work

the demo at openduty.herokuapp.com seems broken to me. Login with root/toor does not work anymore.

API create_event fails

First off, this is likely something that I'm simply missing and I'm going to apologize for that up front. I've setup a POC server to prove that it functions (you guys rock, seriously.)

In an attempt to perform a post using either CURL, the wrapper script or even the web interface, I'm consistently getting back the following:
"POST /api/create_event HTTP/1.1" 403 2

I wasn't 100% certain that the service_key was supposed to be the text name of the service, so I also pulled the ID of the service from the database and attempted using that as well in both examples:

Wrapper script:
I modified the wrapper.sh to include the local API_BASE: 'declare API_BASE="http://192.168.0.92:9080/api"'

wrapper script command line options:
./wrapper.sh -t "trigger" -k "Nagios" -i "Localhost" -d "Drive is out of space" -e "This is a test"

CURL command:
curl --insecure -H "Content-type: application/json" -H "Authorization: token thisismysecret" -X POST -d '{"service_key":"Nagios","event_type":"trigger","description":"test","incident_key":"1234567","details":"Details here"}' http://192.168.0.92:9080/api/create_event

Build details:
CentOS Linux release 7.2.1511 (Core)
Python 2.7.5

Please let me know if there's any other details required.

Any ideas what I could be doing wrong here?

Requirements file needs to be updated

The "kombu" entry needs to be more specific and define an actual version, otherwise an older version will be installed and thus the OrderedDict version won't be loadable by the manage.py script. Here's the specific update that I had to make in order to get the manage.py syncdb command to work properly:

kombu==3.0.37

Schedule.css error

when i do './manage.py collectstatic' then copyed stuff from env/ to openduty/
but when i want to create +New Event in one of Calendares then i recieve 404 errors
centos

so i solved it, when we use './manage.py collectstatic' its copy openduty/static/schedule/img/.png
but openduty request files from openduty/static/schedule/images/
.png
and one more request from openduty/static/schedule/css/images/*.png
if you copy to those 2 directory`s then it is solved .

A few more details on deployment?

Hey there!
So, this looks like a cool project - and I'd like to try getting it running. I've followed the Readme.md, and I can get the service up and running locally. But...I'm not a coder. Not at all. So it's not at all clear to me how to get a new configuration set up to run on a public IP. I tried copying the settings_dev.py to settings_prod.py and modifying accordingly, then reloading the DJANGO setting module. But nothing happens when I runserver. I'm a fawn lost in the woods. Can you provide a little more guidance on getting this running?

Thanks!

Missing UI element for Recurring Schedules

The recurring schedule functionality exists, however, there's no UI elements to inject the necessary values into the database. I was able to get recurring schedules working by manually injecting values into the openduty.schedule_rule table with values that I was able to glean from this page: https://github.com/schacon/django-schedule/blob/master/schedule/models.py. It would be nice to be able to manage this via the UI to avoid having to inject values into the database directly.

missing phonenumbers

heya. After my install manage.py complained about ImportError: No module named phonenumbers. I suspect it may be missing in requirements.txt.

consul integration

The current integration method is to use the public api to notify openduty from an external source like nagios. I'm thinking about the reverse for an external source like consul. If openduty would have access to a local consul agent, it could register a watch for a consul service. The watch events would then be posted into a consul specific openduty api entry point. It will miss however soft/hard state and flapping detection but even it would be nice without them for a first shot.

Handling stucked acknowledged incidents

Acknowledged incidents can stuck when the resolve notification fails to arrive for some reason. I'm thinking of cleaning up these incidents automatically after some grace time.

Question: Is there a mobile application?

We are considering OpenDuty because PagerDuty turns out prohibitively expensive.

One point that'll suck is losing their excellent mobile application.

Is anyone aware of a good alternative? Is the mobile web interface or Slack integration a good enough replacement?

Should redirect to the incident page after login

When I follow the $URL of a notification like this one: "A Service is experiencing a problem: $SERVICE. Handle at: $URL Details: $DETAILS" and I'm logged out before, I get the login screen and get redirected to the main dashboard after successful login.

Demo app is not working

Readme says: http://openduty.herokuapp.com , log in with root/toor
But those credentials are not working.

Can't finish syncdb

Did nothing, just created mysql db, user, started using "getting started" instructions and it fails:

(oduty)[bajal@bajal:~/git/openduty]# python manage.py syncdb
/home/bajal/oduty/lib/python2.7/site-packages/schedule/models/calendars.py:8: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
  from django.contrib.contenttypes import generic

/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/commands/syncdb.py:24: RemovedInDjango19Warning: The syncdb command will be removed in Django 1.9
  warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning)

Operations to perform:
  Synchronize unmigrated apps: openduty, staticfiles, djcelery, messages, templatetags, django_tables2, notification, rest_framework, bootstrap3, django_tables2_simplefilter
  Apply all migrations: schedule, admin, django_twilio, sessions, kombu_transport_django, contenttypes, auth
Synchronizing apps without migrations:
  Creating tables...
    Creating table openduty_token
    Creating table openduty_schedulepolicy
    Creating table openduty_service
    Creating table openduty_eventlog
    Creating table openduty_incident
    Creating table openduty_servicetokens
    Creating table openduty_schedulepolicyrule
    Creating table openduty_userprofile
    Creating table openduty_servicesilenced
    Creating table openduty_incidentsilenced
    Creating table celery_taskmeta
    Creating table celery_tasksetmeta
    Creating table djcelery_intervalschedule
    Creating table djcelery_crontabschedule
    Creating table djcelery_periodictasks
    Creating table djcelery_periodictask
    Creating table djcelery_workerstate
    Creating table djcelery_taskstate
    Creating table openduty_usernotificationmethod
    Creating table openduty_schedulednotification
    Running deferred SQL...
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 25, in handle
    call_command("migrate", **options)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 179, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 318, in sync_apps
    cursor.execute(statement)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/home/bajal/oduty/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 124, in execute
    return self.cursor.execute(query, args)
  File "/home/bajal/oduty/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/bajal/oduty/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.OperationalError: (1005, 'Can\'t create table `openduty`.`#sql-331e_14` (errno: 150 "Foreign key constraint is incorrectly formed")')

Failing to create service in heroku-type deployment

I have it deployed in a Heroku-like system. (Uses Heroku buildpacks, generally behaves like Heroku.) Everything looks good.

However, when I try to save a new Service, I get this error:

DataError at /services/save
invalid input syntax for uuid: "0"
LINE 1: ... FROM "openduty_service" WHERE "openduty_service"."id" = '0'

In the Postgres log:

ERROR:  invalid input syntax for uuid: "0" at character 257
STATEMENT:  SELECT "openduty_service"."name", "openduty_service"."id", "openduty_service"."retry", "openduty_service"."policy_id", "openduty_service"."escalate_after", "openduty_service"."notifications_disabled" FROM "openduty_service" WHERE "openduty_service"."id" = '0'

Any ideas?

Recurring schedule parameters not respected

If additional parameters are entered regarding the rules for schedules, the advanced parameters are not respected when calculating the current on-call.

Example Schedule details:
Starts Nov. 3, 2016, 2 p.m.
Ends Nov. 4, 2016, 2 a.m.
Reoccurs Rule Every 4 weeks params interval:4;

Schedule rule:
Name: Every 4 weeks
Description: Every 4 weeks
Frequency: WEEKLY
Params: interval:4;

While the calendar does technically show the on-call, the "Primary on-call engineer" and "Secondary on-call engineer" show up as "Nobody". Further, if an incident is created during such a timeframe, it sits dormant since there is not technically anyone on-call.

Permissions model implementation

While there are obviously placeholders for advanced permissions in OpenDuty, there's no way to manage it via the GUI. Further, it looks like the advanced permissions model has been setup in the database without corresponding hooks in the code to take advantage of the permissions model.

default login not working.

I installed opeduty application and database migrate everything. its running perfectly but default login username and password not working. so please help me. how to solve the issue?

Thanks,
ashok

Nagios Configuration

@ALL Hi,
How to configure the openduty in nogios.
Please sahre the document I tried long time.
Waiting for my configuration.

Twilio integration

Hi,
I'm looking to integrate openduty with twilio. How can I get it working, I assume that I need to create app in twilio which will look at BASE_URL + "/twilio/%s/%s" and will call the contact who's on-call ?

For me BASE_URL + "/twilio/%s/%s" doesn't exist.

Thanks,
Hristo

bug: change user profile

below code snippet is from user.py
try:
profile = request.user.get_profile()
except UserProfile.DoesNotExist:
profile = UserProfile()
profile.user = request.user

the code will always change the current login user profile, but the aucutal user is a new user or some updating user, is it a bug?

Better schedule override

There should be a better way to temporarily reassign on-call duties from one user to another without editing the recurring events or relying on someone to edit each and every on-call schedule.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.