Skip to content

Commit

Permalink
Modifications save commit!
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Mohier authored and mohierf committed Feb 10, 2020
1 parent 4bd764c commit cb0cfd1
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 144 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ modules/*
python27
python35
python36
python37

# Logs and databases #
######################
Expand All @@ -27,9 +28,10 @@ python36

# Docker files #
################
docker/.env
docker/data/mongodb/*
docker/data/alignak/run/*.pid
docker/data/alignak/log/*.pid
docker/data/alignak/log/*.log
docker/data/alignak/retention/*.json

# OS generated files #
Expand Down
1 change: 1 addition & 0 deletions alignak/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
import sys
import time
import json
import tempfile
import resource
import socket
import signal
Expand Down
12 changes: 3 additions & 9 deletions alignak/objects/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import logging
from alignak.misc.serialization import unserialize
from alignak.objects.item import Item
from alignak.objects.notificationway import NotificationWay
from alignak.objects.commandcallitem import CommandCallItems

from alignak.util import strip_and_uniq
Expand Down Expand Up @@ -177,13 +178,6 @@ class Contact(Item):
'contact_name'
)

simple_way_parameters = (
'service_notification_period', 'host_notification_period',
'service_notification_options', 'host_notification_options',
'service_notification_commands', 'host_notification_commands',
'min_business_impact'
)

def __init__(self, params, parsing=True):
# When deserialized, those are dict
if not parsing:
Expand Down Expand Up @@ -320,8 +314,8 @@ def want_host_notification(self, notifways, timeperiods, timestamp, state, n_typ
def get_notification_commands(self, notifways, n_type, command_name=False):
"""Get notification commands for object type
:param notifways: list of alignak.objects.NotificationWay objects
:type notifways: NotificationWays
:param notifways: list of notification ways objects
:type notifways: alignak.objects.notificationway.NotificationWays
:param n_type: object type (host or service)
:type n_type: string
:param command_name: True to update the inner property with the name of the command,
Expand Down
5 changes: 3 additions & 2 deletions alignak/objects/notificationway.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

from alignak.property import IntegerProp, StringProp, ListProp, FULL_STATUS
from alignak.commandcall import CommandCall
from alignak.misc.serialization import serialize

logger = logging.getLogger(__name__) # pylint: disable=invalid-name

Expand Down Expand Up @@ -154,11 +155,11 @@ def serialize(self, no_json=True, printing=False):
res = super(NotificationWay, self).serialize()

res['service_notification_commands'] = \
[elem.serialize(no_json=no_json, printing=printing)
[serialize(elem, no_json=no_json, printing=printing)
for elem in getattr(self, 'service_notification_commands')]

res['host_notification_commands'] = \
[elem.serialize(no_json=no_json, printing=printing)
[serialize(elem, no_json=no_json, printing=printing)
for elem in getattr(self, 'host_notification_commands')]

return res
Expand Down
2 changes: 1 addition & 1 deletion alignak/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def jsonify_r(obj, running_properties=False,
if prop in filtered_properties:
prop = '_' + prop

# Maybe the property is not jsonable
# Maybe the property is not json-able
try:
if isinstance(val, set):
val = list(val)
Expand Down
81 changes: 0 additions & 81 deletions docker/.env

This file was deleted.

15 changes: 11 additions & 4 deletions docker/.env.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
PYTHON_BASE_VERSION=3.6
ALIGNAK_IMAGE_TAG=0.0.1

DOCKER_USER=username
DOCKER_PASS=password

DOCKER_REPOSITORY=alignak
DOCKER_SERVICE=alignak
DOCKER_SERVICE_UI=alignak-ui

ALIGNAK_GIT_REPO=Alignak-monitoring/alignak
SHINKEN_WEBUI_GIT_REPO=mohierf/mod-webui
SHINKEN_UI_GRAPHITE_GIT_REPO=mohierf/mod-ui-graphite
# Web UI version: develop (old) or integ (the most recent!)
SHINKEN_WEBUI_VERSION=integ

PYTHONPATH=/shinken_modules

# Shared with the host
ALIGNAK_DATADIR=./data/alignak
Expand All @@ -23,8 +28,10 @@ ALIGNAK_CONFIGURATION_FILE=/alignak/etc/alignak.ini
# Alignak configuration
####################
# Use Shinken Web UI as the Alignak UI
ALIGNAK_SHINKEN_UI=yes
SHINKEN_UI_DEBUG=yes
ALIGNAK_DAEMON=yes
ALIGNAK_UI_DEBUG=yes
# Or:
#SHINKEN_UI_DEBUG=yes

# Alignak retention module configuration
# Override module configuration file!
Expand Down
17 changes: 10 additions & 7 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ SHELL := /bin/bash

.PHONY: help

# Create the .env file if it does not exist
ifeq (,$(wildcard .env))
$(shell cp .env.dist .env)
endif
# Get the environment variables
$(shell cp .env.dist .env)
include .env

ifndef ALIGNAK_IMAGE_TAG
Expand Down Expand Up @@ -39,14 +42,14 @@ banner: ## This help message
@echo -e "--------------------"

build: banner ## Build the image
$(info Building Alignak $(DOCKER_TAG) tagged images.)
$(info Building Alignak $(ALIGNAK_IMAGE_TAG) tagged images.)
@docker-compose build
@make -s clean

remove: banner ## Remove image
$(info Removing "$(DOCKER_IMAGE_DAEMON):$(DOCKER_TAG)" image...)
@docker rm $(DOCKER_IMAGE_DAEMON):$(DOCKER_TAG)
@docker rm $(DOCKER_IMAGE_WEBUI):$(DOCKER_TAG)
$(info Removing "$(DOCKER_IMAGE_DAEMON):$(ALIGNAK_IMAGE_TAG)" image...)
@docker rm $(DOCKER_IMAGE_DAEMON):$(ALIGNAK_IMAGE_TAG)
@docker rm $(DOCKER_IMAGE_WEBUI):$(ALIGNAK_IMAGE_TAG)

clean: banner ## Clean all
@docker system prune --volumes --force
Expand All @@ -73,8 +76,8 @@ push: banner login ## Push the image to the repository
@docker push $(DOCKER_IMAGE):$(ALIGNAK_IMAGE_TAG)

pull: banner ## Pull the image
$(info Pulling "$(DOCKER_TAG)" tagged image.)
@docker pull $(DOCKER_IMAGE):$(DOCKER_TAG)
$(info Pulling "$(ALIGNAK_IMAGE_TAG)" tagged image.)
@docker pull $(DOCKER_IMAGE):$(ALIGNAK_IMAGE_TAG)

login: banner ## Login to the repository
$(info Login to Docker Hub, user $(DOCKER_USER).)
Expand Down
2 changes: 1 addition & 1 deletion docker/data/alignak/etc/alignak.d/alignak-module-webui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name=webui
type=webui
# Expect that the module directory content of this project is copied to a directory
# named alignak_webui in the PYTHON_PATH (eg. /usr/local/lib/python2.7/dist-packages for instance!)
python_name=alignak_module_webui
python_name=alignak_webui
# With a former Shinken installation, add the /var/lib/shinken/modules directory to the PYTHONP_ATH
# or move its content to a directory defined in the PYTHON_PATH
# In Shinken, the module is named as:
Expand Down
12 changes: 6 additions & 6 deletions docker/data/alignak/etc/alignak.d/daemons.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name=arbiter-master
;host=127.0.0.1
; Set the host to 0.0.0.0 to allow Arbiter WS access from another system
port=7770
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Modules
Expand All @@ -42,7 +42,7 @@ name=scheduler-master
; My listening interface
;host=127.0.0.1
port=7768
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Modules
Expand Down Expand Up @@ -70,7 +70,7 @@ name=poller-master
; My listening interface
;host=127.0.0.1
port=7771
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Modules
Expand Down Expand Up @@ -114,7 +114,7 @@ name=reactionner-master
; My listening interface
;host=127.0.0.1
port=7769
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Modules
Expand Down Expand Up @@ -156,7 +156,7 @@ name=broker-master
; My listening interface
;host=127.0.0.1
port=7772
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Advanced parameters:
Expand Down Expand Up @@ -187,7 +187,7 @@ name=receiver-master
; My listening interface
;host=127.0.0.1
port=7773
; My adress for the other daemons
; My address for the other daemons
;address=127.0.0.1

; Modules
Expand Down
4 changes: 2 additions & 2 deletions docker/data/alignak/etc/base/templates/generic-contact.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ define contact{
# else the default created notification ways raise a configuration error!
service_notification_period 24x7
host_notification_period 24x7
host_notification_commands notify-host-by-log
service_notification_commands notify-service-by-log
# # # host_notification_commands notify-host-by-log
# # # service_notification_commands notify-service-by-log

# Only useful for the UI...
# Change this default password!!!
Expand Down
2 changes: 1 addition & 1 deletion docker/data/alignak/etc/realms/North/contacts/contacts.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
define contact{
use north-contact
contact_name north-admin
alias Administrateur europe
alias Administrateur North

contactgroups admins

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
define hostgroup{
hostgroup_name north-routers
alias North routers

realm North
#members
}

define hostgroup{
hostgroup_name north
alias North hosts

realm North
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
define hostgroup{
hostgroup_name south-routers
alias South routers

realm South
#members
}

define hostgroup{
hostgroup_name south
alias South hosts

realm South
}
Loading

0 comments on commit cb0cfd1

Please sign in to comment.