Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error when message not well formated #7

Open
ddurieux opened this issue May 3, 2015 · 4 comments
Open

Fatal error when message not well formated #7

ddurieux opened this issue May 3, 2015 · 4 comments
Labels

Comments

@ddurieux
Copy link
Contributor

ddurieux commented May 3, 2015

[nsca] Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/Shinken-2.4_rc4-py2.7.egg/shinken/basemodule.py", line 164, in start_module
    self._main()
  File "/usr/local/lib/python2.7/site-packages/Shinken-2.4_rc4-py2.7.egg/shinken/basemodule.py", line 296, in _main
    self.main()
  File "/usr/local/libexec/shinken/modules/nsca/module.py", line 213, in main
    self.process_check_result(databuffer[s], IVs[s])
  File "/usr/local/libexec/shinken/modules/nsca/module.py", line 164, in process_check_result
    (timestamp, rc, hostname, service, output) = self.read_check_result(databuffer, IV, payload_length)
  File "/usr/local/libexec/shinken/modules/nsca/module.py", line 136, in read_check_result
    struct.unpack(unpackFormat, data)
error: bad char in struct format
@ddurieux ddurieux added the bug label May 3, 2015
@mohierf
Copy link
Contributor

mohierf commented May 3, 2015

Should try to catch the exception to avoid module break ... and to make a log of the bad message ?

@ddurieux
Copy link
Contributor Author

ddurieux commented May 4, 2015

It's difficult to log the bad message because this error mean the unpack binary message failed

@mohierf
Copy link
Contributor

mohierf commented May 4, 2015

Should log byte per byte ?

@ddurieux
Copy link
Contributor Author

ddurieux commented May 4, 2015

Possible, but it's a very long chain and in binary, andvery hard to unpack if you don't have the pack string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants