jasonmcintosh / rabbitmq-zabbix

Zabbix RabbitMQ Configuration
Apache License 2.0
251 stars 168 forks source link

Empty tmp* files being created in /tmp directory every minute #89

Closed DSimmons2018 closed 6 years ago

DSimmons2018 commented 6 years ago

Not sure if this is a configuration issue but I have been using the rabbitmq template from zabbix to monitor our rabbitmq server when a inodes error was generated. Noticed zabbix sender generating a blank tmp file every minute. Had to disable sender until resolved. Any idea where to look or why empty tmp files being generated every minute?

Thanks, David

jasonmcintosh commented 6 years ago

SO the /tmp/files are supposedly the contents of queue status checks. They're temporary files created in python and are SUPPOSED to be deleted after the checks finish.
https://github.com/jasonmcintosh/rabbitmq-zabbix/blob/master/scripts/rabbitmq/api.py#L107 Is where these are created. Unlink is supposed to remove them afterwards.

Raaveni commented 6 years ago

Happens on my server too. Seems like the unlink isn't working as it is supposed to.

ricohomewood commented 6 years ago

I can confirm this is happening on my server too. Eventually the server will run out of spare inodes.

jasonmcintosh commented 6 years ago

Bleh had seen reports of this before but could never track it down exactly. Wondering if it's a python bug. See a ton of bug reports around NamedTemporaryFiles - so if anyone is good at python and debugging would welcome some assistance tracking this one down.

jasonmcintosh commented 6 years ago

Hrmm, digging through... wondering if this doesn't need to be os.remove() and ignore the close method... but this is where my python starts to fall down :( SO if people want to try things and see if there's a solution, would love that!

niakrisn commented 6 years ago

Please check #92 PR

jasonmcintosh commented 6 years ago

Thanks @niakrisn approved & merged :) @ricohomewood see if this fixes the issues?

ricohomewood commented 6 years ago

Thanks @jasonmcintosh and @niakrisn. I have applied this lasted fix and so far it is looking good.