beanstalk-munin icon indicating copy to clipboard operation
beanstalk-munin copied to clipboard

TypeError: an integer is required

Open fl0pp opened this issue 9 years ago • 1 comments

I run Ubuntu with Python 2.7.3. I got an exception when I run: munin-run --debug bs_connections.py run

# Warning: Unrecognised argument 'run' passed to plugin.
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Set /rgid/ruid/egid/euid/ to /111/65534/111 111 /65534/
# Setting up environment
# Environment HOST = *my_hostname*
# Environment PORT = 11301
# About to run '/etc/munin/plugins/bs_connections.py'
Traceback (most recent call last):
  File "/etc/munin/plugins/bs_connections.py", line 28, in <module>
    do_data()
  File "/etc/munin/plugins/bs_connections.py", line 10, in do_data
    stats = beanstalkc.Connection(HOST, PORT).stats()
  File "/usr/local/lib/python2.7/dist-packages/beanstalkc.py", line 59, in __init__
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/beanstalkc.py", line 65, in connect
    SocketError.wrap(self._socket.connect, (self.host, self.port))
  File "/usr/local/lib/python2.7/dist-packages/beanstalkc.py", line 41, in wrap
    return wrapped_function(*args, **kwargs)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
TypeError: an integer is required

I fixed it by replacing

PORT = os.environ.get('PORT', 11300)

to

PORT = int(os.environ.get('PORT', 11300))

in all plugins.

My plugins config-file:

[bs_cmd_rate.py]
env.HOST myhost.com
env.PORT 11301

fl0pp avatar May 18 '15 12:05 fl0pp

Hi! When I am running this command: munin-run --debug bs_connections.py run I am getting this message: # Unknown service 'bs_connections.py' Could you please help me with this.

Thanks!

PraveenkumarDonga avatar Apr 18 '17 12:04 PraveenkumarDonga