Michael Michael - 2 years ago 73
Linux Question

(Pdb) coming up when executing python script

I have a werid issue with a Python script. I already asked the developer of that script, unfortunately he did not gave any helpful answer besides telling me that it "should work fine".

The script is this one and is also importing this one.

When I try to use it (filled my data in) it runs for a sec and then:

> /opt/monitis_nginx_monitoring/sdk/monitisserver.py(84)monitisPost()
-> postArgs['timestamp'] = self.timestamp()

Comes up and is waiting for an user input. Not too familar with pythhon, but this appears to be the debugger, so something seems to be wrong.

When I type in
it is showing all expected post arguments, besides the timestamp, the timestamp is not included in the post data, so it looks like that something goes wrong with the timestamp. However, when I type in
it is outputting a correct timestamp.

Any idea what is wrong with this script?

Update: Just removed the debugger statement, now something else goes wrong:

Traceback (most recent call last):
File "nginx_stubstatus.py", line 139, in <module>
result=result, checkTime=None)
File "/opt/monitis_nginx_monitoring/sdk/monitisserver.py", line 129, in addResult
monitorId = self.requestMonitorId(monitorTag)
File "/opt/monitis_nginx_monitoring/sdk/monitisserver.py", line 40, in requestMonitorId
return root.find('./monitor/id').text
AttributeError: 'NoneType' object has no attribute 'text'

Answer Source

Line 83 of monitisserver.py: import pdb; pdb.set_trace().

This causes python to break into the debugger (pdb) on this line.

Tell the maintainer about this. This should not be in production code without any condition (i.e debug mode)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download