Skip to content

Commit

Permalink
Merge e84352a into 7686020
Browse files Browse the repository at this point in the history
  • Loading branch information
mohierf committed Jan 7, 2017
2 parents 7686020 + e84352a commit 2a5982a
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 112 deletions.
22 changes: 22 additions & 0 deletions .landscape.yml
@@ -0,0 +1,22 @@
doc-warnings: true
test-warnings: false
strictness: medium
max-line-length: 100
autodetect: true
pep8:
full: true
pep257:
run: false
mccabe:
run: false
requirements:
- requirements.txt
python-targets:
- 2
- 3
ignore-paths:
- docs
- test
ignore-patterns:
# This file is only defining the imported Alignak version
- alignak_backend/__init__.py
12 changes: 11 additions & 1 deletion .travis.yml
Expand Up @@ -18,12 +18,22 @@ script:
- cd test
- pip freeze # so to help eventual debug: know what exact versions are in use can be rather useful.
- cd ..
# Code static analysis
- pep8 --max-line-length=100 --exclude='*.pyc, *.cfg, *.log' --ignore='E402' alignak_backend/*
- rm -fr alignak_backend/__pycache__
- pylint --rcfile=.pylintrc alignak_backend/*
- pep257 --select=D300 alignak_backend
# Code test and dynamic analysis
- cd test
- coverage erase
- nosetests -xv --nologcapture --process-restartworker --processes=1 --process-timeout=300 --with-coverage --cover-package=alignak_backend test*.py
- coverage report
# Test code static analysis
- pep8 --max-line-length=100 --exclude='*.pyc, *.cfg, *.log' --ignore='E402' test_*.py
- pylint --rcfile=../.pylintrc test_*.py
- nosetests -xv --nologcapture --process-restartworker --processes=1 --process-timeout=300
- cd ..
after_success:
# to get coverage data with relative paths and not absolute we have to
# execute coveralls from the base directory of the project,
# so we need to move the .coverage file here :
mv test/.coverage . && coveralls --rcfile=test/.coveragerc -v
66 changes: 43 additions & 23 deletions README.rst
Expand Up @@ -7,6 +7,14 @@ Alignak Backend
:target: https://travis-ci.org/Alignak-monitoring-contrib/alignak-backend
:alt: Develop branch build status

.. image:: https://landscape.io/github/Alignak-monitoring-contrib/alignak-backend/develop/landscape.svg?style=flat
:target: https://landscape.io/github/Alignak-monitoring-contrib/alignak-backend/develop
:alt: Development code static analysis

.. image:: https://coveralls.io/repos/Alignak-monitoring-contrib/alignak-backend/badge.svg?branch=develop&service=github
:target: https://coveralls.io/github/Alignak-monitoring-contrib/alignak-backend?branch=develop
:alt: Development code coverage

.. image:: https://readthedocs.org/projects/alignak-backend/badge/?version=latest
:target: http://alignak-backend.readthedocs.org/en/latest/?badge=latest
:alt: Latest documentation Status
Expand All @@ -17,7 +25,11 @@ Alignak Backend

.. image:: https://badge.fury.io/py/alignak_backend.svg
:target: https://badge.fury.io/py/alignak_backend
:alt: Last PyPi version
:alt: Most recent PyPi version

.. image:: https://img.shields.io/badge/IRC-%23alignak-1e72ff.svg?style=flat
:target: http://webchat.freenode.net/?channels=%23alignak
:alt: Join the chat #alignak on freenode.net

.. image:: https://img.shields.io/badge/License-AGPL%20v3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0
Expand All @@ -31,47 +43,55 @@ This package is an Alignak Backend.

It is used to:

* manage configuration (hosts, services, contacts, timeperiods...)
* manage monitoring configuration (hosts, services, contacts, timeperiods...)

* end user (webui, command line...) can get and add configurations elements
* Alignak gets this configuration when its arbiter module starts
* end user (WebUI, python/php client, curl command line,...) can get, add, edit monitoring configurations elements
* inner templating system to easily create new hosts, services, users, ...
* Alignak gets this configuration when its arbiter module starts

* manage retention

* Alignak load and save retention information for checks/hosts/services
* Alignak saves and loads retention information for checks/hosts/services from the backend

* manage live states
* manage the monitoring live state

* Alignak add/update states for hosts and services
* end user (webui, command line...) can get these information

* manage the metrics from the checks performance data

Release strategy
----------------
* Alignak backend send metrics to Graphite / InfluxDB timeseries databases
* Alignak backend automatically creates Grafana panels for hosts / services metrics

Alignak backend and its *satellites* (backend client, and backend import tools) must all have the
same features level. As of it, take care to install the same minor version on your system to
ensure compatibility between all the packages. Use 0.4.x version of Backend import and Backend
client with a 0.4.x version of the Backend.

The current version of Alignak backend is 0.5.6.
Installation
------------

From PyPI
~~~~~~~~~
To install the package from PyPI:
::

This version is published on PyPi and can be installed with ``pip install alignak_backend``.
sudo pip install alignak-backend

It contains:

- compatibility with new upcoming Alignak 1.0 version
From source files
~~~~~~~~~~~~~~~~~
To install the package from the source files:
::

- modified data model:
- live state in the host/service elements
- user preferences in the user data model
- unreachable managed for the hosts and services
git clone https://github.com/Alignak-monitoring-contrib/alignak-backend
cd alignak-backend
sudo pip install .

Previous versions:

- 0.4: version compatible with Alignak version 0.2 (objects serialization and uuid)
Release strategy
----------------

- 0.3: version compatible with Alignak version 0.1
Alignak backend and its *satellites* (backend client, and backend import tools) must all have the
same features level. As of it, take care to install the same minor version on your system to
ensure compatibility between all the packages. Use 0.4.x version of Backend import and Backend
client with a 0.4.x version of the Backend.

Bugs, issues and contributing
-----------------------------
Expand Down
22 changes: 19 additions & 3 deletions alignak_backend/__init__.py
Expand Up @@ -8,17 +8,33 @@
This module is an Alignak REST backend
"""
# Application version and manifest
VERSION = (0, 5, 6)
VERSION = (1, 0, 'rc1')
VERSION = (0, 7, 2)

__application__ = u"Alignak_Backend"
__short_version__ = '.'.join((str(each) for each in VERSION[:2]))
__version__ = '.'.join((str(each) for each in VERSION[:4]))
__author__ = u"Alignak team"
__copyright__ = u"(c) 2015 - %s" % __author__
__author_email__ = u"david.durieux@alignak.net"
__copyright__ = u"(c) 2015-2017 - %s" % __author__
__license__ = u"GNU Affero General Public License, version 3"
__description__ = u"Alignak REST backend"
__releasenotes__ = u"""Alignak REST Backend"""
__doc_url__ = "https://github.com/Alignak-monitoring-contrib/alignak-backend"
__git_url__ = "https://github.com/Alignak-monitoring-contrib/alignak-backend"
__doc_url__ = "http://alignak-backend.readthedocs.org"

__classifiers__ = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
'Programming Language :: Python',
'Topic :: System :: Monitoring',
'Topic :: System :: Systems Administration'
]

# Application manifest
manifest = {
'name': __application__,
Expand Down
8 changes: 4 additions & 4 deletions etc/settings.json
Expand Up @@ -22,11 +22,11 @@
"MONGO_USERNAME": null, /* Username to access to MongoDB */
"MONGO_PASSWORD": null, /* Password to access to MongoDB */

/* Timeseries data are stored in retention in backend. Activate the timeseries scheduler
will push into timeseries databases the data.
BE CAREFULL, ACTIVATE IT ONLY ON ONE BACKEND */
/* Timeseries data are stored internally in the backend.
The timeseries scheduler will push them regularly to the configured databases
BE CAREFULL, ACTIVATE THIS ON ONE BACKEND ONLY! */
"SCHEDULER_TIMESERIES_ACTIVE": false,
/* This scheduler will create / update dashboards in grafana.
BE CAREFULL, ACTIVATE IT ONLY ON ONE BACKEND */
BE CAREFULL, ACTIVATE IT ON ONE BACKEND ONLY! */
"SCHEDULER_GRAFANA_ACTIVE": false
}
23 changes: 0 additions & 23 deletions setup.cfg

This file was deleted.

70 changes: 16 additions & 54 deletions setup.py
Expand Up @@ -2,10 +2,8 @@
# -*- coding: utf-8 -*-

from __future__ import print_function
import os
import sys
import re
del os.link

from importlib import import_module

try:
Expand All @@ -20,83 +18,47 @@
if python_version < (2, 7):
sys.exit("This application requires a minimum Python 2.7.x, sorry!")

try:
from alignak.version import VERSION
__alignak_version__ = VERSION
except:
__alignak_version__ = 'x.y.z'

from alignak_backend import __application__, __version__, __copyright__
from alignak_backend import __releasenotes__, __license__, __doc_url__
from alignak_backend import __releasenotes__, __license__, __doc_url__, __git_url__
from alignak_backend import __author__, __author_email__, __classifiers__
from alignak_backend import __name__ as __pkg_name__

package = import_module('alignak_backend')

# Define paths
if 'linux' in sys.platform or 'sunos5' in sys.platform:
installation_paths = {
'bin': "/usr/bin",
'var': "/var/lib/alignak-backend/",
'etc': "/etc/alignak-backend",
'run': "/var/run/alignak-backend",
'log': "/var/log/alignak-backend",
}
elif 'bsd' in sys.platform or 'dragonfly' in sys.platform:
installation_paths = {
'bin': "/usr/local/bin",
'var': "/usr/local/libexec/alignak-backend",
'etc': "/usr/local/etc/alignak-backend",
'run': "/var/run/alignak-backend",
'log': "/var/log/alignak-backend",
}
else:
print("Unsupported platform, sorry!")
exit(1)

setup(
name=__pkg_name__,
version=__version__,

license=__license__,

# metadata for upload to PyPI
author="David Durieux",
author_email="d.durieux@siprossii.com",
author=__author__,
author_email=__author_email__,
keywords="alignak monitoring backend",
url="https://github.com/Alignak-monitoring-contrib/alignak-backend",
url=__git_url__,
description=package.__doc__.strip(),
long_description=open('README.rst').read(),

classifiers = __classifiers__,

zip_safe=False,

packages=find_packages(),
include_package_data=True,
# package_data={
# 'sample': ['package_data.dat'],
# },
data_files = [(installation_paths['etc'], ['etc/settings.json'])],

# Where to install distributed files
data_files = [('etc/alignak-backend', ['etc/settings.json'])],

# Dependencies (if some) ...
install_requires=[
'python-dateutil==2.4.2', 'Eve>=0.5', 'flask-bootstrap', 'docopt', 'jsonschema',
'eve-swagger', 'configparser',
'future', 'influxdb', 'flask-apscheduler'
'eve-swagger', 'configparser', 'future', 'influxdb', 'flask-apscheduler',
'uwsgi'
],

# Entry points (if some) ...
entry_points={
'console_scripts': [
'alignak-backend = alignak_backend.main:main'
],
},

classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Programming Language :: Python',
'Topic :: System :: Monitoring',
'Topic :: System :: Systems Administration'
]
}
)
12 changes: 8 additions & 4 deletions test/.coveragerc
@@ -1,6 +1,10 @@
[run]
omit =
./test*

[report]
omit =
*/python?.?/*
*/site-packages/nose/*
[run]
omit = test*
*/python?.?/*
*/site-packages/nose/*
/usr/share/pyshared/*
./test*

0 comments on commit 2a5982a

Please sign in to comment.