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

Add a varnish service check. #1213

Merged
merged 1 commit into from Dec 10, 2014
Merged

Conversation

conorbranagan
Copy link
Member

The service check uses the varnishadm debug.health command to
get the health of available backends. One check per backend will
be submitted, tagged by the backend name.

The BIG question here is how we will let users enable this because
the varnishadm command requires access to the secret key which has
root permissions by default (and is owned by root).

I don't know what the answer is yet but this will open up the discussion.

@remh remh added this to the 5.2.0 milestone Nov 21, 2014
@LeoCavaille
Copy link
Member

@conorbranagan we can specify the same setup guidelines that we give in the postfix check:
https://github.com/DataDog/dd-agent/blob/master/conf.d/postfix.yaml.example#L4-L6

The "have better experience when check needs root access" is on the new agent core roadmap.

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
output, _ = proc.communicate()
if varnishadm_path:
self._parse_varnishadm(varnishadm_path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these two last lines, you probably meant output instead of varnishadm_path?

@conorbranagan
Copy link
Member Author

Updated to use sudo now and fixed that other issue. Thanks.

# privilleges. You can configure your sudoers file for this:
#
# example /etc/sudoers entry:
# dd-agent ALL=(ALL) NOPASSWD:/usr/bin/find
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/find/varnishadm/ :rocket:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Copypasta

The service check uses the `varnishadm debug.health` command to
get the health of available backends. One check per backend will
be submitted, tagged by the backend name.

The BIG question here is how we will let users enable this because
the varnishadm command requires access to the secret key which has
root permissions by default (and is owned by root).
@LeoCavaille
Copy link
Member

😄 thanks!

LeoCavaille added a commit that referenced this pull request Dec 10, 2014
@LeoCavaille LeoCavaille merged commit 26c97df into master Dec 10, 2014
@LeoCavaille LeoCavaille deleted the conor/varnish-service-check branch December 10, 2014 22:47
output, error = proc.communicate()
if error and len(error) > 0:
self.log.error(error)
self._parse_varnishstat_metrics(varnishstat_path, use_xml, tags)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should pass "output" instead of "varnishstat_path" here.
See pullrequest #1377

LeoCavaille pushed a commit that referenced this pull request Feb 19, 2015
Another change from #1213 introduced a regression by passing the
path of the command instead of the output of the comand.
LeoCavaille pushed a commit that referenced this pull request Feb 19, 2015
Another change from #1213 introduced a regression by passing the
path of the command instead of the output of the comand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants