alignak-monitoring / alignak Goto Github PK
View Code? Open in Web Editor NEWMonitoring tool, highly flexible and new standard oriented
Home Page: https://alignak-monitoring.github.io
License: GNU Affero General Public License v3.0
Monitoring tool, highly flexible and new standard oriented
Home Page: https://alignak-monitoring.github.io
License: GNU Affero General Public License v3.0
It can be nice to keep the queue in the broker, so if queue begin to be big in module and module is killed, for the moment the queue is lost.
We can see how to keep the queue when module killed and wait to restart
I would like to follow the workflow present here : http://nvie.com/posts/a-successful-git-branching-model/ (really worth reading !)
With it : we would/could disable "bare" push of commits to master ; only merge from develop "release" branch would be allowed in master.
master -> THE master branch, should always only point to the last stable released version.
develop -> The branch in which others "dev" branches are merged. Let them be feature or fix branches.
When we would (want to) be in a "freeze period" for preparing the next prod release : git checkout -b release-$x.$y develop
and last bug fixes would be merged in this temporary release branch.
Once we assume it's ok : git checkout master && git merge --no-ff release-$x.$y && git tag $x.$y
I'd like to clean the project of any reference to android ; which is anyway not fully supported - if something would work at all..
any one wants to raise some cons about this ?
For better read of code, put all private functions (like str) immediately after class declaration avec init .
We have some classes where we have these functions anywhere in class
... current default author for automatic generated comments is (Nagios process).
When a downtime is programmed an automatic comment is created. The author of this automatic comment is (Nagios Process) ... should use (Alignak) instead ?
What about having parameters in the configuration file for comments author and text ?
Should be interesting to get informed about start and end of the different timeperiods : check period, notification period, ...
As of it, start and end of scheduled downtimes is also interesting
Those new broks will allow to develop many interesting features in external modules.
In Host class, we have this property :
'labels':
StringProp(default=[], fill_brok=['full_status'], merging='join', split_on_coma=True),
It's a string and default can't be [], or default is right [] but type is list, not string
We have rotation log of broker and after no write in this file.
[1432677602] INFO: [broker-master] We are archiving the old log file
[1432677602] INFO: [broker-master] Moving the old log file from /var/log/shinken/shinken.log to /var/log/shinken/archives/shinken-05-26-2015-00.log
[1432677602] DEBUG: [broker-master] I open the log file /var/log/shinken/shinken.lo
Don't use anymore pycurl.
I propose to use the requests (http://docs.python-requests.org/) module.
Hello,
I am getting this:
[1434467974] ERROR: [Alignak] Cannot find python lib crypto: export to kernel.alignak.io isnot available
Wasn't sending usage statistics disabled in Alignak?
BaseModule
Hi,
I saw in file install_hooks.py this line :
8 def get_init_scripts(config):
9 """ Add init scripts in data_files for install """
10 data_files = config['files']['data_files']
11 if 'win' in sys.platform:
12 pass
13 elif 'linux' in sys.platform or 'sunos5' in sys.platform:
14 data_files = data_files + "\netc/init.d = bin/init.d/*"
15 data_files = data_files + "\netc/default = bin/default/alignak.in"
Can you add code to make it compatible with systemd ?
Thank
See shinken-solutions/shinken#1656
The host state id is defined as is :
Source: http://nagios.sourceforge.net/docs/3_0/macrolist.html#hoststateid
Shinken has inverted the values for DOWN and UNREACHABLE ... a quick test is possible with the WebUI that allows to Submit a check result on an host.
When comment modules (pylint), I have seen the function get_hostgroup_members of Hostgroup never works because property 'hostgroup_members' not exist.
So clean it and remove the call in function 'get_hosts_by_explosion' in same class
bad references missed during rename, and content should be changed regarding installation and so..
Remove 'timeperiods' argument because not used. (think to modify the calls ;) )
I think we need to separate data to class/function.
For exemple, we have
'contacts': <shinken.objects.contact.Contacts object at 0x808eaa6d0
instead
'contacts' : {'contact_name': 'koinkoin', 'alias': 'koin2'}
The main reasons:
Because when call a function we add the data dict in parameter and return a data or the complete dict transformed (depend of cases).
The issue #30 is related to this
For the pylint, we see that we have many problem with variables not initialized, invalid, and others things. There are very lots of problems and I think code this issue before fix pylint can same us lot of time after because the code will be more easier to read and will have less errors in pylint
Only files aimed to be executed should have a shebang line.
any other file module (let it be part of package or not) should not have that shebang.
Bonjour,
Lorsque que l'on attribue un template de service ping à un template d'hote generic-host et que l'on veut l' utiliser pour un autre template linux le service n'apparait jamais.
Ma configuration pour exemple :
define host{
name generic-host
alias generic-host
check_command check_host_alive
check_interval 5
max_check_attempts 3
active_checks_enabled 1
passive_checks_enabled 0
check_period 24x7
contact_groups +Admin
notification_period 24x7
notification_options d,r
notification_interval 0
realm All
register 0
}
define service{
host_name generic-host
name Ping
service_description Ping
use generic-service
check_command check_fping!3!3000,40%!5000,50%
register 0
}
define host{
name Server-Linux
alias Server-Linux
use generic-host
register 0
_SNMPCOMMUNITY
}
Est ce que vous avez déjà eut le problème ?
Merci
Hi,
I'm trying to centralize talk we had about how packaging of Alignak will be implemented.
As far as I remember we stayed on 1 branch for packaging type. Like rpm / debian. So that we don't have packaging file in master/develop.
I can't remember the pros cons of that.
Linked to #91 (remove for fedora maybe)
initial_state is not managed in alignak.
See https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectdefinitions.html
Arguments initial_state don't work because is not present in alignak code but present in the doc.
it's not anymore valid since the old change from Pyro to http for communication.
if you call it with say 10 : wait_for_initial_conf(10)
then you will have to wait 10 secs, even if a new conf is received meanwhile :
def wait_for_initial_conf(self, timeout):
cur_timeout = timeout
...
elapsed, _, _ = self.handleRequests(cur_timeout)
def handleRequests(self, timeout, suppl_socks=None):
socks = []
if suppl_socks:
socks.extend(suppl_socks)
...
ins = self.get_socks_activity(socks, timeout)
def get_socks_activity(self, socks, timeout):
if socks == []:
time.sleep(timeout)
return []
So wait_for_initial_conf(x)
is the same as sleep(x)
which is not what is intended..
Tests will be moved to tests/folder and not be in the file of app
Hi,
Arguments initial_state don't work because is not present in alignak code but present in the doc.
Best regard
but, depending on your installation setup, this can miserably fails because of, already, missing stuffs,
like the "working" directory :
gstarck@taf 10:19 $ which python
/home/gstarck/.virtualenvs/test_alignak_pip_install_venv/bin/python
gstarck@taf 10:19 $ alignak-reactionner
...
[1433513984] WARNING: [Alignak] No config file specified, use defaults parameters
...
raise InvalidWorkDir(e)
InvalidWorkDir: [Errno 2] No such file or directory: '/var/run/alignak'
Traceback (most recent call last):
...
File "/home/gstarck/.virtualenvs/test_alignak_install/local/lib/python2.7/site-packages/alignak/daemon.py", line 429, in change_to_workdir
raise InvalidWorkDir(e)
alignak.http_daemon.InvalidWorkDir: [Errno 2] No such file or directory: '/var/run/alignak'
In this case the alignak was installed within a virtualenv (with pip install .
),
but in such a case (virtualenv install) : it would be cool / good if the pip install would have set such default config values to something usable, like : $VIRTUALENV_PATH/var/run/arlignak
for this specific setting, the others required default settings could also be set to things usable, like $VIRTUALENV_PATH/var/log/alignak
for the logs directory .. etc ..
So that in the virtualenv, the daemons can be directly started AND usable just by calling alignak-scheduler
for instance..
To be able to have this feature, the default values for such directives (log dir, run dir, etc..) could be stored in a dedicated module of alignak, say alignak.defaults
(and the daemons would import and use that) and just be overhidden by the setup/installation (if needed)..
not really required actually but it would have been made like that since the start that would have been incredible - it's never too late :)
When arbiter is spare it wait for master death.
Unfortunately, this function (https://github.com/Alignak-monitoring/alignak/blob/develop/alignak/daemons/arbiterdaemon.py#L638) basically only do a sleep(1.0) and never modify the variable used to trigger high availability switch.
Every 300s (master timeout) the spare arbiter will try to run until/unless the master send a HTTP message to say the opposite. This could lead to bad conf dispatched and non wanted monitoring downtime as other satellite would drop their conf and setup the new one. Probability is low because master arbiter is sending the order not to run every loop : https://github.com/Alignak-monitoring/alignak/blob/develop/alignak/dispatcher.py#L191
Wait for master death could be rewritten to really wait for master death instead of basically sleep(300) and being call again and again
Originally reported here : shinken-solutions/shinken#1430 by @andyxning
find a better way to handle the feature that alignak.log.Log.load_obj()
permits ..
actually : depending on the conditions, sometimes the load_obj() method is called multiple times, which results in so many ("Brok"-)log handlers being created and attached to the logger.. which can finally be bad because this results in the logs being dispatched multiple times to different "destination" but you are not anymore sure what they are. On its own this can be bad and is almost never desirable (at least as it is right now done).
def load_obj(self, object, name_=None):
""" We load the object where we will put log broks
with the 'add' method
"""
global _brokhandler_
_brokhandler_ = BrokHandler(object)
if name_ is not None or self.name is not None:
if name_ is not None:
self.name = name_
# We need to se the name format to all other handlers
for handler in self.handlers:
handler.setFormatter(defaultFormatter_named)
_brokhandler_.setFormatter(defaultFormatter_named)
else:
_brokhandler_.setFormatter(defaultFormatter)
self.addHandler(_brokhandler_)
the global _brokhandler_
is on its own a code smell here..
Every module does at least "from shinken.modules import BaseModule".
(but each one also import others objects from the shinken package..)
For now : to not be obligated to clone and rename these imports in every module : we can hack sys.modules['shinken']
so that it's an alias for alignak
gonna open a PR with this..
I have seen many performances pages about thi son the web and we can see all result (cpickle > simplesjon and other cpickle < simplejson).
Somebody has made performances tests with both in alignak (currently use cpickle)?
If no, I can try it
Il a module has a memory leak, the broker module has so too many memory and is an external module crash, it run again this external process with clone and so with leak memory.
So disable 'internal module'
IMHO : too complex / code smells / etc..
and there are often problems when shutting down it because it doesn't join/clean the http threads (properly or at all).
plus the module global daemon_inst
(declared in http_daemon.py) which is a code smell on its own.
We had discussions about it.
We need to have an unique domain (readthedoc) for multiple types of documentations (on different repositories) like:
We can do this like explained here: https://read-the-docs.readthedocs.org/en/latest/faq.html#how-do-i-host-multiple-projects-on-one-cname
We can have http://alignak.readthedocs.org/en/latest/ where centralize summary and each type of documentation listed before in link (example have http://alignak.readthedocs.org/projects/userdoc/en/latest/)
Remove some useless file. Go through file and see if we can remove them :
Hi,
Here is an example:
define host {
host_name host-foo
use template-with-duplicate-foreach-key
address www.xxx.yyy.zzz
# Key from a "duplicate_foreach" instruction.
_my_key description n1 $(val1)$ $(val2)$, \
description n2 $(val1)$ $(val2)$, \
description n3 $(val1)$ $(val2)$,
}
In this example, the descriptions of the services will be "description n1 "
, "description n2 "
and "description n3 "
with a trailing space in the name which will trigger some problems for instance in the WebUI. Indeed, the WebUI will have some dead links (error 500) such as http://fqdn/service/<host>/<description-of-a-service>
(link to a service).
Currently, there is a workaround: just remove the space between the description and the dollar like this:
define host {
host_name host-foo
use template-with-duplicate-foreach-key
address www.xxx.yyy.zzz
# Key from a "duplicate_foreach" instruction.
_my_key description n1$(val1)$ $(val2)$, \
description n2$(val1)$ $(val2)$, \
description n3$(val1)$ $(val2)$,
}
In this case, no problem, the descriptions will be "description n1"
, "description n2"
and "description n3"
without the trailing space.
But it should be smarter if the description of a service was systematically striped, ie with desc = desc.strip()
somewhere in the code.
Regards.
and more specifically : its setUp() -> setup_with_file()
it obviously already miss a tearDown() implementation where what's done in the setup_with_file() is correctly cleared/stopped/unconfigured ..
gstarck@taf 10:07 $ nosetests -xv test_dateranges.py:TestDataranges.test_weekdaydaterange_start_end_time
test_weekdaydaterange_start_end_time (test_dateranges.TestDataranges) ... FAIL
======================================================================
FAIL: test_weekdaydaterange_start_end_time (test_dateranges.TestDataranges)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gstarck/work/work/SFL/Supervision/alignak/test/test_dateranges.py", line 139, in test_weekdaydaterange_start_end_time
self.assertEqual(start, ret[0])
AssertionError: 1442203200.0 != 1439179200.0
-------------------- >> begin captured stdout << ---------------------
to be investigated .. probably a "timing" issue I'd say at first.
Linked to #97
Broker put data to queue for each external modules.
When a module crash, it restart the module external with new queue but old queue not deleted and is always in memory of broker process.
#19 was merged but the test needs to be transposed to a good nosetest one.
I would like for Alignak-arbiter to reload (config) without changing PID.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.