HenriWahl / Nagstamon

Nagios status monitor for your desktop.
https://nagstamon.de
Other
420 stars 170 forks source link

Direct crash after clicking on OK from Create new server #516

Closed bphd closed 4 years ago

bphd commented 5 years ago
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Application Error" /> 
  <EventID Qualifiers="0">1000</EventID> 
  <Level>2</Level> 
  <Task>100</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2018-10-24T07:40:29.000000000Z" /> 
  <EventRecordID>76853</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer></Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Nagstamon.exe</Data> 
  <Data>0.0.0.0</Data> 
  <Data>00000000</Data> 
  <Data>ucrtbase.DLL</Data> 
  <Data>10.0.10586.1171</Data> 
  <Data>59ae5010</Data> 
  <Data>40000015</Data> 
  <Data>00000000000699df</Data> 
  <Data>10ac</Data> 
  <Data>01d46b6cbc9bf015</Data> 
  <Data>C:\temp\Nagstamon-3.0.1-win64\Nagstamon.exe</Data> 
  <Data>C:\windows\system32\ucrtbase.DLL</Data> 
  <Data>13f5f823-d760-11e8-863c-d8d385764f4d</Data> 
  </EventData>
  </Event>
mprenditore commented 5 years ago

Nagstamon logs will be useful to better understand the issue.

bphd commented 5 years ago

I haven't any

HenriWahl commented 5 years ago

Please enable debugging in Settings.

Also a good idea might be to use a newer version than the 3.0.1 - see https://nagstamon.ifw-dresden.de/download/ for more options.

bphd commented 5 years ago

debug mode doesn't generate any log at all, blank log And it's the same at the latest testing version

HenriWahl commented 5 years ago

Which Windows version do you use? Which server did you try to configure?

bphd commented 5 years ago

Windows 7, Centreon

HenriWahl commented 5 years ago

Are you able to run Nagstamon in a console (cmd.exe) from sources as in https://nagstamon.ifw-dresden.de/docs/requirements/ to get some output?

Edit: Does this happen with server types other than Centreon too?

bphd commented 5 years ago

Only with Centreon

HenriWahl commented 5 years ago

What about running from source to get some output? Would this be possible for you?

bphd commented 5 years ago

I haven't "C:\python36"

HenriWahl commented 5 years ago

Would it be possible to install Python for testing?

BenoitPoulet commented 5 years ago

Hello @bphd Also, can you post the screenshot of your config for the server type Centreon , just before saving the config ? (with the checkbox "Show more options" checked)

Thanks

bphd commented 5 years ago

I have Python installed

bphd commented 5 years ago

Salut @BenoitPoulet !

Non, the serv. settings are confidential. What you want to know about ?

And i have to say that the soft crash regardless of what i type on the form. A blank form result in a instant crash too

BenoitPoulet commented 5 years ago

@bphd Of course details are confidential, but you can anonymise the data....

bphd commented 5 years ago

Like i've said it crashes regardless of how it's filled. But i let all parameters per default except for the server address

BenoitPoulet commented 5 years ago

Can't reproduce with 3.0.2 under Windows 10 : I only changed the server address with the Centreon's demo server : capture

Last thing is to checkout the Git, and launch Nagstamon by hand with Python as @HenriWahl suggest.

bphd commented 5 years ago

https://github.com/HenriWahl/Nagstamon/issues/516#issuecomment-432962272

It's exacly like your screen, just i don't have the left window. I can type what i want in the right window, when i click OK it automaticaly crash

HenriWahl commented 5 years ago

Please check with latest release candidate 3.1.99rc2 because former binaries had problems with latest Python keyring module. Now I chose to use an older one and found it more stable.

bphd commented 5 years ago

Same with 3.2, crash after clicking OK

BenoitPoulet commented 5 years ago

Can you provided the anonymized Nagstamon debug log ? (without log or console log, we cannot debug)

bphd commented 5 years ago

Comment i'm supposed to do that ?

bphd commented 5 years ago

Some update about that concern.

All people in my office have the same problem (Windows 7 and Windows 10)

Just one person in my office hasn't any problem. We've all taked his "%USERPROFILE%/.nagstamon/server_Monitor server.conf" and now it finally work for all of us.

I want to locate the concern to correct the problem in the next update of Nagstamon, i have thinked about making a diff between my files and the working files. But it appears that it's the first configuration window who make problems. And if we not pass this window, no files are created. So i haven't anything to compare why this file works. But it appears that if we get around the first window, the software seems to work.

Any idea ?

HenriWahl commented 5 years ago

Which version do you use? Can you try latest testing please from https://nagstamon.ifw-dresden.de/download/#testing ?

bphd commented 5 years ago

Sure, and how can i help to report the problem ?

(3.3 just closes itself instead of crashing)

HenriWahl commented 5 years ago

The best solution would be you installed Python and its dependencies as described on https://nagstamon.ifw-dresden.de/docs/requirements/.

Then get you the sourcecode from Github.

After this run nagstamon.py in a commandline windows so we could get all output necessary.

If you need help let me know.

bphd commented 5 years ago
?:\Users\?>python ?:\temp\Nagstamon-master\nagstamon.py
Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
   QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen f
actors.
   QT_SCREEN_SCALE_FACTORS to set per-screen factors.
   QT_SCALE_FACTOR to set the application global scale factor.
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a la
yout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a la
yout
QLayout: Attempting to add QLayout "" to StatusWindow "", which already has a la
yout
Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Centreon.py", line 253, in _g
et_sid
    sid = self.session.cookies['PHPSESSID']
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\si
te-packages\requests\cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)

  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\si
te-packages\requests\cookies.py", line 399, in _find_no_duplicates
    raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='PHPSESSID', domain=None, path=None"

Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\QUI\__init__.py", line 5781, in ok
    statuswindow.servers_vbox.addLayout(statuswindow.create_ServerVBox(servers[s
elf.server_conf.name]))
  File "?:\temp\Nagstamon-master\Nagstamon\QUI\__init__.py", line 1348, in creat
e_ServerVBox
    server_vbox = ServerVBox(server, parent=self)
  File "?:\temp\Nagstamon-master\Nagstamon\QUI\__init__.py", line 2824, in __ini
t__
    self.table = TreeView(len(HEADERS) + 1, 0, sort_column, sort_order, self.ser
ver, parent=parent)
  File "?:\temp\Nagstamon-master\Nagstamon\QUI\__init__.py", line 3205, in __ini
t__
    self.worker = self.Worker(server=server, sort_column=self.sort_column, sort_
order=self.sort_order)
  File "?:\temp\Nagstamon-master\Nagstamon\QUI\__init__.py", line 3960, in __ini
t__
    self.server.init_config()
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Centreon.py", line 74, in ini
t_config
    self._define_url()
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Centreon.py", line 415, in _d
efine_url
    'xml_services': self.monitor_cgi_url + '/include/monitoring/status/Services/
' + self.XML_PATH + '/serviceXML.php',
AttributeError: 'CentreonServer' object has no attribute 'XML_PATH'
HenriWahl commented 5 years ago

@BenoitPoulet - any idea? Or opportunity to test?

HenriWahl commented 5 years ago

@bphd which version of Centreon do you currently use?

bphd commented 5 years ago

18.10

HenriWahl commented 5 years ago

I think i found some trace and tried to fix it. Please have a look at https://nagstamon.ifw-dresden.de/files/incoming/ and test if there is any improvement.

HenriWahl commented 5 years ago

@bphd where you able to test this fix?

BenoitPoulet commented 5 years ago

@HenriWahl Hello, sorry they changed my e-mail reader to Outlook, i'm so confused by this software, i missed your notification.

Your changes seems ok to me, let see if it's ok for @bphd

bphd commented 5 years ago

I have to wait 1 week to test

HenriWahl commented 5 years ago

@BenoitPoulet OK man, I hope I did not destroy something. Condolence due to Outlook...

bphd commented 5 years ago

It's HenriWahl's software, no ? Why is he afraid to break it and ask for an other person to check ?

Now the software does not crash, it shows "Monitor URL invalid" or "Empty host XML result"

DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DA8F0> for state "OK"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DA8A0> for state "INFORMATION"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DA940> for state "UNKNOWN"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DA990> for state "WARNING"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DA9E0> for state "AVERAGE"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DAA30> for state "HIGH"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DAA80> for state "CRITICAL"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DAAD0> for state "DISASTER"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DAB20> for state "UNREACHABLE"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DAB70> for state "DOWN"
DEBUG: SystemTrayIcon created icon <PyQt5.QtGui.QIcon object at 0x041DABC0> for state "ERROR"
DEBUG: 2019-04-23 10:01:01.119252 Saving configuration to file ?:\users\?\.nagstamon\nagstamon.conf
DEBUG: 2019-04-23 10:01:01.135252 Saving configuration to file ?:\users\?\.nagstamon\nagstamon.conf
DEBUG: 2019-04-23 10:01:01.137252 leNomDuMonitor Refreshing all hosts and services
DEBUG: 2019-04-23 10:01:01.948252 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:01:01.948252 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:01:01.948252 leNomDuMonitor FetchURL: http://?/centreon/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:01:02.025252 leNomDuMonitor Session status : "Unauthorized"
DEBUG: 2019-04-23 10:01:02.026252 leNomDuMonitor FetchURL: http://?/centreon/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1&sid=? CGI Data: None
DEBUG: 2019-04-23 10:01:02.135252 leNomDuMonitor Empty host XML result
DEBUG: 2019-04-23 10:01:16.079379 leNomDuMonitor Open monitor web page http://?/centreon/main.php?
DEBUG: 2019-04-23 10:02:02.141984 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:02:02.141984 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:02:02.141984 leNomDuMonitor FetchURL: http://?/centreon/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:02:02.220992 leNomDuMonitor Session status : "Unauthorized"
DEBUG: 2019-04-23 10:02:02.220992 leNomDuMonitor FetchURL: http://?/centreon/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1&sid=? CGI Data: None
DEBUG: 2019-04-23 10:02:02.328003 leNomDuMonitor Empty host XML result
DEBUG: 2019-04-23 10:03:02.335003 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:03:02.335003 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:03:02.335003 leNomDuMonitor FetchURL: http://?/centreon/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:03:02.412011 leNomDuMonitor Session status : "Unauthorized"
DEBUG: 2019-04-23 10:03:02.412011 leNomDuMonitor FetchURL: http://?/centreon/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1&sid=? CGI Data: None
DEBUG: 2019-04-23 10:03:02.522022 leNomDuMonitor Empty host XML result
DEBUG: 2019-04-23 10:03:34.582227 leNomDuMonitor Created server.
DEBUG: 2019-04-23 10:03:34.587228 leNomDuMonitor FetchURL: http://?/index.php CGI Data: None
DEBUG: 2019-04-23 10:03:34.593229 leNomDuMonitor Centreon version unknown : supposed to be >= 18.10
DEBUG: 2019-04-23 10:03:34.593229 leNomDuMonitor FetchURL: http://?/index.php CGI Data: None
DEBUG: 2019-04-23 10:03:34.595229 leNomDuMonitor Password login : ? : ?
ERROR: 2019-04-23 10:03:34.599229 leNomDuMonitor Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Centreon.py", line 255, in _get_sid
    sid = self.session.cookies['PHPSESSID']
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\cookies.py", line 399, in _find_no_duplicates
    raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='PHPSESSID', domain=None, path=None"

DEBUG: 2019-04-23 10:03:34.599229 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:03:34.635233 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:03:34.635233 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:03:34.635233 leNomDuMonitor FetchURL: http://?/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:03:34.637233 leNomDuMonitor Session status : <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/internal.php was not found on this server.</p>
</body></html>

DEBUG: 2019-04-23 10:03:34.638233 leNomDuMonitor FetchURL: http://?/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1&sid=ERROR CGI Data: None
DEBUG: 2019-04-23 10:03:36.147384 Saving configuration to file ?:\users\?\.nagstamon\nagstamon.conf
DEBUG: 2019-04-23 10:03:36.161385 Saving configuration to file ?:\users\?\.nagstamon\nagstamon.conf
DEBUG: 2019-04-23 10:03:36.164386 leNomDuMonitor Refreshing all hosts and services
DEBUG: 2019-04-23 10:03:36.643434 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:03:36.643434 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:03:36.643434 leNomDuMonitor FetchURL: http://?/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:03:36.646434 leNomDuMonitor Session status : <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/internal.php was not found on this server.</p>
</body></html>

DEBUG: 2019-04-23 10:03:36.646434 leNomDuMonitor FetchURL: http://?/include/monitoring/status/Hosts/xml/hostXML.php?num=0&limit=9999&o=hpb&p=20202&criticality=0&statusHost=hpb&sSetOrderInMemory=1&sid=ERROR CGI Data: None
DEBUG: 2019-04-23 10:04:07.967566 leNomDuMonitor Created server.
DEBUG: 2019-04-23 10:04:07.972566 leNomDuMonitor FetchURL: http://?/centreon/index.php CGI Data: None
DEBUG: 2019-04-23 10:04:08.166586 leNomDuMonitor Centreon version detected : 18.10
DEBUG: 2019-04-23 10:04:08.166586 leNomDuMonitor FetchURL: http://?/centreon/index.php CGI Data: None
DEBUG: 2019-04-23 10:04:08.351604 leNomDuMonitor FetchURL: http://?/centreon/index.php CGI Data: {'centreon_token': '?', 'submitLogin': 'Connect', 'useralias': '?', 'password': '?'}
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor Password login : ? : ?
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor SID : ?
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor Only Centreon Broker is supported in Centeon >= 2.7 -> XML_PATH=xml
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor Checking session status
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor URLs defined for Centreon 18.1
DEBUG: 2019-04-23 10:04:08.543623 leNomDuMonitor FetchURL: http://?/centreon/api/internal.php?object=centreon_keepalive&action=keepAlive CGI Data: None
DEBUG: 2019-04-23 10:04:08.618631 leNomDuMonitor Session status : "Unauthorized"

I tried to add "main.php" after "/centreon/" and the program has completly freezed, no crash, just a freeze, all windows does not respond but Windows don't block or close them

And log continue to loop with that :

DEBUG: 2019-04-23 10:29:01.972248 leNomDuMonitor Created server.
DEBUG: 2019-04-23 10:29:01.977248 leNomDuMonitor FetchURL: http://?/centreon/main.php/index.php CGI Data: None
ERROR: 2019-04-23 10:29:04.582248 leNomDuMonitor Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Generic.py", line 1383, in FetchURL
    response = self.session.get(url, timeout=self.timeout)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

DEBUG: 2019-04-23 10:29:04.582248 leNomDuMonitor Error getting the home page : requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

ERROR: 2019-04-23 10:32:27.245248 leNomDuMonitor Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Centreon.py", line 1034, in _check_session
    result = self.FetchURL(self.urls_centreon['autologoutXMLresponse'], giveback='xml')
AttributeError: 'CentreonServer' object has no attribute 'urls_centreon'

DEBUG: 2019-04-23 10:29:04.582248 leNomDuMonitor FetchURL: http://?/centreon/main.php/index.php CGI Data: None
ERROR: 2019-04-23 10:29:07.095248 leNomDuMonitor Traceback (most recent call last):
  File "?:\temp\Nagstamon-master\Nagstamon\Servers\Generic.py", line 1383, in FetchURL
    response = self.session.get(url, timeout=self.timeout)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "?:\Users\?\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py", line 668, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

DEBUG: 2019-04-23 10:29:07.095248 leNomDuMonitor Password login : ? : ?
DEBUG: 2019-04-23 10:29:07.095248 leNomDuMonitor SID : ?
DEBUG: 2019-04-23 10:29:07.095248 leNomDuMonitor Only Centreon Broker is supported in Centeon >= 2.7 -> XML_PATH=xml

After a short wait it says "Connection error" and i can click

HenriWahl commented 5 years ago

@bphd - the Centreon part is maintained by @BenoitPoulet.

BenoitPoulet commented 5 years ago

Hello, i was in vacation, i will have a look shortly.

Can you tell me 2 infos please ?

bphd commented 5 years ago

https://github.com/HenriWahl/Nagstamon/issues/516#issuecomment-482505757

No

BenoitPoulet commented 5 years ago

I think i successfully replicate your problem.

1) your URL seems to be : http://?/centreon , so please set it correctly 2) you get immediately, after saving your conf : "Session status : "Unauthorized"" and just after : "Empty host XML result". That means Nagstamon cannot open a valid session on your Centreon. Either your credentials are not valid, either the account do not have access to the web interface. ("Reach Centreon Front-end" in the user's conf in Centreon)

When the debug is enabled and your credentials are correct you must see "Session status : null" in the log.

Yes, the message shown in Nagstamon is not clear in this case, i will see if i can show a better one.

You are welcome to help me with this server support and enhance the class, as i'm not a dev, i do as much as i can. Any help is appreciated.

bphd commented 5 years ago

Ignore les "?" je les ai moi même ajoutés au log

J'utilise le compte superadmin habituel avec les bons identifiants

J'en suis pas un non plus figures-toi, j'vais pas pouvoir plus aider à ce niveau

HenriWahl commented 4 years ago

Any improvement in sight when using 3.4rc2?

bphd commented 4 years ago

I'm not in the same enterprise anymore, maybe the problem still, I don't know But when I used this software I was used to copy the configuration file from my colleague computer to mine to make Nagstamon work

HenriWahl commented 4 years ago

Ok... So I will close this issue.