shinken-monitoring / mod-booster-nrpe

Shinken module for boosting NRPE connections

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnboundLocalError

myroslav opened this issue · comments

We are sometimes getting following error in log:

2014-12-04 09:18:25,512 [1417681105] Error : NRPE poller exited with an unmanaged exception :+1: 
Traceback (most recent call last):
  File "/var/lib/shinken/modules/booster-nrpe/module.py", line 507, in work
    self.do_work(s, returns_queue, c)
  File "/var/lib/shinken/modules/booster-nrpe/module.py", line 546, in do_work
    self.launch_new_checks()
  File "/var/lib/shinken/modules/booster-nrpe/module.py", line 445, in launch_new_checks
    n = NRPEAsyncClient(host, port, use_ssl, timeout, unknown_on_timeout, cmd)
  File "/var/lib/shinken/modules/booster-nrpe/module.py", line 188, in __init__
    self.create_socket(family, socket.SOCK_STREAM)
UnboundLocalError: local variable 'family' referenced before assignment

There is a chance that if there is exception in

try block, execution should interrupt.

Fixed, thanks.

commented

The current version of booster-nrpe which is downloaded by 'shinken install booster-nrpe' seems not to have this fix...

I tried to do it (as I'm actually owner of the booster-nrpe module on shinken.io (from where the shinken command line fetchs what you tell it to install).
But got an error :

$ shinken -A hidden publish
* Hostname was NOT found in DNS cache
*   Trying 178.32.100.40...
* Connected to shinken.io (178.32.100.40) port 80 (#0)
> POST /push HTTP/1.1
User-Agent: PycURL/7.19.3 libcurl/7.35.0 GnuTLS/2.12.23 zlib/1.2.8 libidn/1.28 librtmp/2.3
Host: shinken.io
Accept: */*
Content-Length: 15632426
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------267f1dbc2258713f

< HTTP/1.1 100 Continue
< HTTP/1.1 413 Request Entity Too Large
* Server nginx/0.7.67 is not blacklisted
< Server: nginx/0.7.67
< Date: Thu, 29 Oct 2015 20:10:07 GMT
< Content-Type: text/html
< Content-Length: 199
< Connection: close
< 
* we are done reading and this is set to close, stop send
* Closing connection 0
[1446149426] ERROR: [Shinken] There was a critical error : <html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/0.7.67</center>
</body>
</html>

@naparuba ?

commented

Can anyone explain the status of this issue? @gst are you saying that you tried to update the booster-nrpe module on shinken.io and failed?

We are having this issue in a 2.4.2 install that went live in February of 2016. As the bug was closed in 2014, I am rather confused as to why we are experiencing this.

commented

FWIW, it appears in our case that the exception was getting thrown when shinken tried to connect to a handful of our linux servers that did not yet have NRPE installed and configured.

commented

bump?