Skip to content

shoonoise/gns

 
 

Repository files navigation

Build Status Coverage Status Docker Repository on Quay.io Latest Version Dependency Status Gitter chat

##Global Notification System##

###Quick start### To try GNS, you need to install Python 2 and Docker from your repositories. Docker must be running on the local socket and a special network interface:

sudo ip addr add 172.18.43.1/24 dev lo label lo:1
sudo docker -d -H unix:///var/run/docker.sock -H tcp://172.18.43.1:4243

For configuration management, we use Maestro-NG. You can install it from GitHub and register in the $PATH:

python2 -m pip install --user --upgrade git+https://github.com/signalfuse/maestro-ng.git
export PATH=$PATH:~/.local/bin

Next, you can clone GNS from GitHub:

git clone https://github.com/yandex-sysmon/gns.git
cd gns
git submodule update --init --recursive

Run the maestro configuration. This command can take a long time, it needs to download several images:

./maestro/run local reinit start
./maestro/run local reinit stop
./maestro/run local dev start

You can change part of the configuration parameters using environment variables. For example, you should use your repository with the rules (variable REPO_URL). List of all parameters can be found in YAML-files in directory ./maestro. See file ./maestro/common.yaml for example.

###Basic API usage### Compatibility layer with Golem/submit.sbml:

curl --data 'info=test' 'http://localhost:7887/api/compat/golem/submit?object=foo&eventtype=bar&info=test&status=critical'

Native pushing of event:

curl -H 'Content-Type: application/json' --data '{"host":"foo", "service":"bar", "status":"CRIT", "description":"test"}' http://localhost:7887/api/rest/v1/jobs

Dropping the event:

curl -X DELETE http://localhost:7887/api/rest/v1/jobs/<UUID>

Getting the information about the event:

curl http://localhost:7887/api/rest/v1/jobs/<UUID>

###Build your own image### To build and run your locally changed GNS, you can use these following commands:

make docker
export DOCKER_GNS_IMAGE=gns:latest
export DOCKER_GNS_API_IMAGE=gns:latest
./maestro/run local dev start

###Testing### To test your must have installed and configured ZooKeeper. Intall PyPy3 and dependencies:

wget https://bootstrap.pypa.io/ez_setup.py -O - | pypy3 - --user
pypy3 -m easy_install tox

Testing:

make tox

See all testing targets in Makefile.

About

Universal distributed notification service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.0%
  • Shell 4.0%