@@ -807,14 +807,26 @@ def GetStatus(self, output=None):
807
807
else :
808
808
return Result ()
809
809
810
- if status .error != '' or status .status_code > 400 :
810
+ # some monitor server seem to have a problem with too short intervals
811
+ # and sometimes send a bad status line which would result in a misleading
812
+ # ERROR display - it seems safe to ignore theese errors
813
+ # see https://github.com/HenriWahl/Nagstamon/issues/207
814
+ if 'BadStatusLine' in self .status_description :
815
+ self .status_description = ''
816
+ self .isChecking = False
817
+ return Result (result = self .status ,
818
+ error = self .status_description ,
819
+ status_code = self .status_code )
820
+
821
+ if (self .status_description != '' or
822
+ self .status_code > 400 ):
811
823
# ask for password if authorization failed
812
- if 'HTTP Error 401' in status . error or \
813
- 'HTTP Error 403' in status . error or \
814
- 'HTTP Error 500' in status . error or \
815
- 'bad session id' in status . error .lower () or \
816
- 'login failed' in status . error .lower () or \
817
- status .status_code in self .STATUS_CODES_NO_AUTH :
824
+ if 'HTTP Error 401' in self . status_description or \
825
+ 'HTTP Error 403' in self . status_description or \
826
+ 'HTTP Error 500' in self . status_description or \
827
+ 'bad session id' in self . status_description .lower () or \
828
+ 'login failed' in self . status_description .lower () or \
829
+ self .status_code in self .STATUS_CODES_NO_AUTH :
818
830
if conf .servers [self .name ].enabled == True :
819
831
# needed to get valid credentials
820
832
self .refresh_authentication = True
@@ -832,7 +844,7 @@ def GetStatus(self, output=None):
832
844
error = self .status_description ,
833
845
status_code = self .status_code )
834
846
835
- # no rew authentication needed
847
+ # no new authentication needed
836
848
self .refresh_authentication = False
837
849
838
850
# this part has been before in GUI.RefreshDisplay() - wrong place, here it needs to be reset
0 commit comments