Giter Club home page Giter Club logo

openduty's Introduction

Build status

image Coverage Status Requirements Status Gitter


Outdated Requirements Status

2 packages (indirect dependencies) are outdated - but required by other packages:

Faker installed ==0.9.1 | latest ==1.0.5

urllib3 installed ==1.24.2 | latest ==1.25.1


What is this?

Openduty is an incident escalation tool, just like Pagerduty . It has a Pagerduty compatible API too.

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

Email, SMS, Phone(Thanks Twilio for being awesome!), Push notifications(thanks Pushover, Prowl as well!)and Slack, HipChat, Rocket.chat 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://demo.openduty.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 Openduty

Contributors at Ustream

Other contributors

Getting started:

sudo easy_install pip
sudo pip install pipenv
pipenv install
pipenv shell
export DJANGO_SETTINGS_MODULE=config.settings_dev
docker-compose up
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

because of the django_tables2 it is tricky to migrate the changes to the DB

One quick fix would be to migrate in steps:

First we do:

./ manage.py migrate notification

And the we do:

./ manage.py migrate openduty

Then we can check it by running the general migrate

./ manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, django_celery_beat, django_twilio, notification, openduty, schedule, sessions
Running migrations:
  No migrations to apply.
(.venv) mac:catalin$ 

now, you can start hacking on it.

Running as a service with systemd

OpenDuty can be ran as a service with the help of gunicorn and systemd

cp -r systemd/gunicorn.service.* /etc/systemd/system/

cp -r systemd/celery.service* /etc/systemd/system/

// EDIT VARIABLES IN *.service.d/main.conf TO REFLECT YOUR ENV
vi /etc/systemd/system/gunicorn.service.d/main.conf
vi /etc/systemd/system/celery.service.d/main.conf

systemctl daemon-reload
sudo systemctl start gunicorn
sudo systemctl enable gunicorn

After 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

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',
)


DEMO DATA

  1. Migrate
  2. flush current db content
  3. Repopulate db
python manage.py install_demo
Running Migrating on DB.....
Operations to perform:
  Apply all migrations: accounts, admin, auth, contenttypes, django_celery_beat, django_twilio, events, incidents, notification, policies, schedule, schedules, services, sessions
Running migrations:
  No migrations to apply.
Preparing to clear the db.....
All is clean, installing new data...
Installed 52 object(s) from 1 fixture(s)
Successfully installed dummy environment

Manual ways

Having PSQL Docker container running, you can backup demo sql data:

pg_dump -h 127.0.0.1 -U openduty --data-only --column-inserts openduty > dummydata.sql

Load Demo data:

pg_dump  -h 127.0.0.1 -U openduty -c --column-inserts openduty < dummydata.sql

Django way to Dump Database and Load Database

python manage.py dumpdata --exclude=contenttypes --exclude=sessions -o demodata.json

**Usually contenttypes and sessions will cause you: **

IntegrityError: Problem installing fixture 'demodata.json': Could not load contenttypes.ContentType(pk=2)

** so we exclude that data since it is not relevant for us anyway.

Load Demo data:

# Make sure you have a clean DB and  everything migrated
python manage.py fushall

# Load data from demodata.json
python manage.py loaddata demodata.json

openduty's People

Contributors

catalincoroeanu avatar christ66 avatar danmoz avatar deathowl avatar gitter-badger avatar gu3sss avatar jbarascut avatar jkapusi avatar kozmagabor avatar krutaw avatar leventyalcin avatar luto avatar mrweeble avatar sheran-g avatar sysrex 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

openduty's Issues

upstream/openduty - Forked maybe pull changes back in?

Hey team,

Before I noticed your old code branch (oops!), I forked upstream/openduty into elmobp/openduty (look at branch snow) if you want there is working Docker support there using either SQLite or MySQL. MySQL will run in its own container via docker-compose.

As part of that I ported the twilo notifiers to new the use SDK version for both calls and SMS.

And one new notifier added. Servicenow the process behaves as follows:

Alert comes into OpenDuty
OpenDuty searches ServiceNow for a subject matching $SERVER – Monitoring alert
If found and the ticket is not resolved and is less than 30 days old the ticket will have work notes added with the output from the monitoring alert
If the ticket has been found and is older than 30 days it will create a new ticket with the short description being: $SERVER – Monitoring Alert
The description will then contain the output like the following “The check $check currently has problems output: $OUTPUT”
It will be assigned to whom ever the incident is assigned to in OpenDuty + what ever assignment group that user belongs to

Feel free to pick what ever you like out!

If you want to run the docker stuff up it simple

cd extra/docker
make all

As a user I need Clean Pages

Finish to convert/adapt all the templates after the new AdminLte theme

Essential Components:

{% extends 'base.html' %}{% load arrowfilter static %}
{% block title %}{% if title %}{{ title }}{% else %}PAGE NAME{% endif %}{% endblock %}
{% block content %}
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            {% if title %}{{ title }}{% else %}PAGE NAME{% endif %}
        </h1>
        <ol class="breadcrumb">
            <li><i class="fa fa-dashboard"></i> PAGE NAME</li>
        </ol>
    </section>
    <div class="content">
        {% if messages %}
            <div class="alert alert-success alert-dismissible">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                {% for message in messages %}
                    <h4>
                        {% if message.tags %}<i class="icon fa fa-check {{ message.tags }}"></i>{% endif %}
                        {{ message }}
                    </h4>
                {% endfor %}
            </div>
        {% endif %}
        <div class="row">
            <div class="col-xs-12">

           <!-- / CONTENT BLOCK  -->

            </div>
        </div>
    </div>
</div>
{% endblock %}

Migrations fail on a freshly cloned repo

/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/environ/environ.py:630: UserWarning: /home/deathowl/work/odrework/openduty/config/settings/.env doesn't exist - if you're not configuring your environment separately, create one.
"environment separately, create one." % env_file)
/home/deathowl/work/odrework/openduty/config/settings/init.py:102: UserWarning: SQLite URL contains host component 'openduty.db', it will be ignored
'default': env.db('DATABASE_URL', default='sqlite://openduty.db')
Traceback (most recent call last):
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_group

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/base.py", line 361, in execute
self.check()
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 65, in _run_checks
issues.extend(super()._run_checks(**kwargs))
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/management/base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
url_patterns = getattr(resolver, 'url_patterns', [])
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/utils/functional.py", line 80, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/urls/resolvers.py", line 571, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/utils/functional.py", line 80, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/urls/resolvers.py", line 564, in urlconf_module
return import_module(self.urlconf_name)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/deathowl/work/odrework/openduty/config/urls.py", line 43, in
path('events/', include('apps.events.urls')),
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/deathowl/work/odrework/openduty/apps/events/urls.py", line 2, in
from apps.events.views import CustomCreateEventView, CustomUpdateEventView, CustomDeleteEventView
File "/home/deathowl/work/odrework/openduty/apps/events/views.py", line 9, in
from apps.events.forms import CustomEventForm
File "/home/deathowl/work/odrework/openduty/apps/events/forms.py", line 11, in
class CustomEventForm(EventForm):
File "/home/deathowl/work/odrework/openduty/apps/events/forms.py", line 26, in CustomEventForm
('Groups', [(x.name, x.name) for x in Group.objects.all()]),
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/models/query.py", line 274, in iter
self._fetch_all()
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/models/query.py", line 1242, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/models/query.py", line 55, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1097, in execute_sql
cursor.execute(sql, params)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/deathowl/.virtualenvs/openduty/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_group

Please make migrations work @catalincoroeanu so I can start code review properly.

cannot select escalation policy for service

Glad to see that this project is gaining some traction again! I tried to set it up and create a basic config.

  1. create an Escalation Policy
  2. create a service
  3. expect to be able to select policy created earlier, but the list is empty

This seems to be due to there being two SchedulePolicy models: policies.SchedulePolicy and schedules.SchedulePolicy. The code looks pretty much identical to me, so I guess this is in the middle of some restructuring? It is not quite clear to me which one is the current one.

Adminlte

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

As a User I need an App Updated and Secure

We need to upgrade all the dependencies for the project to the latest version.

Since this is an Old project upgraded from Django==1.6 and python 2.7 it requires a lot of refactoring and replacing maybe a lot of deprecated | unsecure | outdated versions of some of the Dependencies.

Demo down

The demo link seems to be down... is it possible to see the demo elsewhere please ?

Getting involved in the project

Hi, my co-workers and I are going to be creating a proof-of-concept deployment of openduty to assess if it could be a useful tool for teams in our org. We are doing this for a three-day hack-a-thon next week starting Monday. Aside from the README file, is there anything else we should know about the project? Is the current state of the code in a working state? Is development still active? Are there new features planned or a roadmap? Thanks!

Create README according to the new changes

  • Create a docs Folder and put inside all the documents related to any kind of documentation including README.md

  • README.md has to be changed after the new structure and new versions

Project goals / roadmap

I'm excited to see this project being rejuvenated, it promises to be extremely useful.

Is there a roadmap, or any specific project goals that you're working towards?

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.