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

Improper handling of supervisord uptime output format #4

Closed
ckrough opened this issue Feb 11, 2015 · 1 comment
Closed

Improper handling of supervisord uptime output format #4

ckrough opened this issue Feb 11, 2015 · 1 comment

Comments

@ckrough
Copy link

ckrough commented Feb 11, 2015

When supervisord process uptime exceeds 24 hours, supervisor reports time in days + hh:mm:ss format. The supervisord.py script is expecting time only in hh:mm:ss format.

For example, for a running process:

mygroup:myprocess-00       RUNNING    pid 26786, uptime 6 days, 21:58:15

in _extract_uptime, it's assumed that the uptime time can be parse using

h, m, s = desc.split('uptime ')[1].split(':')

This causes the following error:

Traceback (most recent call last):
  File "/opt/datadog-agent/agent/checks/__init__.py", line 543, in run
    self.check(copy.deepcopy(instance))
  File "/etc/dd-agent/checks.d/supervisord.py", line 80, in check
    uptime = self._extract_uptime(proc)
  File "/etc/dd-agent/checks.d/supervisord.py", line 101, in _extract_uptime
    return int(s) + 60 * (int(m) + 60 * int(h))
ValueError: invalid literal for int() with base 10: '6 days, 21'

Before I update the code to handle this situation, I want to verify that this code has been used on processes running beyond 24hr and confirm that this is not a configuration issue with supervisord's output format.

@isaacdd, have you run into this?

@isaacdd
Copy link
Owner

isaacdd commented Feb 11, 2015

@ckrough. I saw this and already fixed it. This is going into the dd-agent repo in the next release. For now, you can pull latest check from here: DataDog/dd-agent#1165. Please let me know if you run into any other issues.

@isaacdd isaacdd closed this as completed Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants