2010/11/19 QuickeneR <q...@tut.by>

> Hi Jean, thanks for the quick fix!
> I go on with trying to run on Windows. I had to add this line to
> nagios-windows.cfg, as the default is a unix path
> log_archive_path=c:/shinken/var/archives/
>
This value should be in the log module in the shinken-specific.cfg in fact,
but I'll add this too.


>
> Here is what I get now
>
> I am Status Dat Broker
> Get a Simple log broker for plugin Simple-log-Autogenerated
> Load 1 module instances
> I open the log file c:/shinken/var/shinken.log
> Starting external process (pid:3456) for instance Simple-log-Autogenerated
> [Default-Broker] I correctly load the modules :
> ['Simple-log-Autogenerated']
>
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "E:\Python27\lib\multiprocessing\forking.py", line 346, in main
> prepare(preparation_data)
> File "E:\Python27\lib\multiprocessing\forking.py", line 461, in prepare
> '__parents_main__', file, path_name, etc
> File "c:\shinken\bin\shinken-broker.py", line 69, in <module>
> my_path = os.path.abspath(sys.modules['__main__'].__file__)
> AttributeError: 'module' object has no attribute '__file__'
> Got a new conf
> Error : the external module Simple-log-Autogenerated goes down unexpectly!
>
> Traceback (most recent call last):
> File "E:\Python27\lib\multiprocessing\queues.py", line 238, in _feed
> send(obj)
> IOError: [Errno 232]
>
Outch, I forgot that the Broker also launch childs, so I ust add the same
bypass thing I add in the poller/reactionner code but in the broker.


>
> OK, a little bit of googling shows that not all modules have this
> attribute. Don't know enough Python to fix it properly, came up with a quick
> hack to get over it and see what comes next
> shinken-broker.py, line 69, replace with
>
> if hasattr(sys.modules['__main__'], "__file__"):
>    my_path = os.path.abspath(sys.modules['__main__'].__file__)
> else:
>    my_path = "c:/shinken/bin/shinken-broker.py"
>
Yes, good way to bypass ;)


>
> Indeed, this helps, the next error the broker gives is
> ...
> I open for append the log file c:/shinken/var/shinken.log
> ...
> I am simple log Broker
> Process Process-1:
>
> Traceback (most recent call last):
> File "E:\Python27\lib\multiprocessing\process.py", line 232, in _bootstrap
> self.run()
> File "E:\Python27\lib\multiprocessing\process.py", line 88, in run
> self._target(*self._args, **self._kwargs)
> File "c:\shinken\shinken\modules\simplelog_broker.py", line 182, in main
> self.manage_brok(b)
> File "c:\shinken\shinken\modules\simplelog_broker.py", line 145, in
> manage_bro
> k
> f(b)
> File "c:\shinken\shinken\modules\simplelog_broker.py", line 151, in
> manage_log
> _brok
> self.file.write(data['log'].encode('UTF-8'))
> ValueError: I/O operation on closed file
>
Hum... The close is only in the quit() method if I remember right. I'll try
it.


> Got a new conf
> Error : the external module Simple-log-Autogenerated goes down unexpectly!
>
> Traceback (most recent call last):
> File "E:\Python27\lib\multiprocessing\queues.py", line 238, in _feed
> send(obj)
> IOError: [Errno 232]
>
> Now I'm stuck. The file is opened, as the diagnostic message in the console
> verifies, but then it seems to be closed. Maybe it has something to do with
> the multi-process architecture, like file handle not being available in a
> child process
>
In fact the log module is a whole process, and its his reponsability to
open/close the file. The main broker process open/close nothing else than
modules that do the job. You don't have anyother message like "I close the
file"  or something like this?


>
> By the way, here is a script I use to get this info, as the services give
> away nothing ))
>
> start "arbiter" python c:\shinken\bin\shinken-arbiter.py -c
> c:\shinken\etc\nagios-windows.cfg
> start "poller" python c:\shinken\bin\shinken-poller.py -c
> c:\shinken\etc\pollerd-windows.ini
> start "reactionner" python c:\shinken\bin\shinken-reactionner.py -c
> c:\shinken\etc\reactionnerd-windows.ini
> start "scheduler" python c:\shinken\bin\shinken-scheduler.py -c
> c:\shinken\etc\schedulerd-windows.ini
> start "broker" python c:\shinken\bin\shinken-broker.py -c
> c:\shinken\etc\brokerd-windows.ini
>

Thanks :)

But the services are not good? (the broker should failed, but for the
others?)


Jean


>
> 2010/11/18 nap <napar...@gmail.com>
>
> Hi again,
>> I was stupid : it's better to do the move just in the .py in the install
>> script, and keep the unix version clean for packagers :)
>> It's commited :)
>> Jean
>>
>>
>> On Thu, Nov 18, 2010 at 3:25 PM, nap <napar...@gmail.com> wrote:
>>
>>> Hi,
>>> I solve it, but Linux packagers won't be happy : the "module" under
>>> windows that is look for the Manager() should got the .py extention! So I
>>> must rename all bin/shinken-* into .py :(
>>> I try with a 2.6, and it seems that with a 2.7 it's the same problem.
>>> Thanks for the bug report, the code is available in the git :)
>>> Jean
>>>
>>>
>>> On Thu, Nov 18, 2010 at 1:40 PM, nap <napar...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> On Thu, Nov 18, 2010 at 12:43 PM, Петров Иван <q...@tut.by> wrote:
>>>>
>>>>> Hi. I Just found out about shinken and tried to run it under Windows
>>>>> XP. Got the latest revision from git. Edited the reg files for the 
>>>>> services
>>>>> to be like this:
>>>>>
>>>>>
>>>>> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Shinken-Arbiter\Parameters]
>>>>> "Application"="e:\\Python27\\python.exe"
>>>>> "AppDirectory"="c:\\shinken"
>>>>> "AppParameters"="c:\\shinken\\bin\\shinken-arbiter -c
>>>>> c:\\shinken\\etc\\nagios-windows.cfg"
>>>>>
>>>>> When I start the services, I get 5 srvany processes but only 3 python
>>>>> processes. Looks like poller and reactionner are missing. Trying to run
>>>>> poller manually with "python c:\shinken\bin\shinken-poller -c
>>>>> c:\shinken\etc\pollerd-windows.ini", I get
>>>>>
>>>>> License: AGPL
>>>>> Sorry, you can't change user on this system
>>>>> Traceback (most recent call last):
>>>>> File "<string>", line 1, in <module>
>>>>> File "E:\Python27\lib\multiprocessing\forking.py", line 346, in main
>>>>> prepare(preparation_data)
>>>>> File "E:\Python27\lib\multiprocessing\forking.py", line 455, in prepare
>>>>> file, path_name, etc = imp.find_module(main_name, dirs)
>>>>> ImportError: No module named shinken-poller
>>>>> Traceback (most recent call last):
>>>>> File "c:\shinken\bin\shinken-poller", line 156, in <module>
>>>>> p = Poller(config_file, is_daemon, do_replace, debug, debug_file)
>>>>> File "c:\shinken\shinken\satellite.py", line 257, in __init__
>>>>> self.manager = Manager()
>>>>> File "E:\Python27\lib\multiprocessing\__init__.py", line 98, in Manager
>>>>> m.start()
>>>>> File "E:\Python27\lib\multiprocessing\managers.py", line 502, in start
>>>>> self._address = reader.recv()
>>>>> EOFError
>>>>>
>>>> Outch. It seems that the Manager() call is raising an errror. It's not
>>>> good, it's a standard function. I try to look why it failed here.
>>>> Thanks for this bug report.
>>>>
>>>> This show me that we do not have automatic tests on a Windows box, we
>>>> should add it so such a regression will not occur anymore :)
>>>>
>>>>
>>>>> The contents of pollerd-windows.ini is
>>>>>
>>>>> [daemon]
>>>>> workdir=c:\shinken/var
>>>>> pidfile=%(workdir)s/pollerd.pid
>>>>> interval_poll=5
>>>>> maxfd=1024
>>>>> port=7771
>>>>> host=0.0.0.0
>>>>> user=shinken
>>>>> group=shinken
>>>>> idontcareaboutsecurity=no
>>>>>
>>>>> Same error with reactionner.
>>>>> Am I missing something or is Windows support broken?
>>>>>
>>>> The conf is good. It's a regression bug. Let's hunt it :)
>>>>
>>>> Jean
>>>>
>>>>
>>>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Shinken-devel mailing list
> Shinken-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/shinken-devel
>
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to