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

Can't get metrics-jstat.rb to work because of the elevated privileges required by jstat #9

Open
bradenwright opened this issue Nov 13, 2016 · 4 comments

Comments

@bradenwright
Copy link

metrics-jstat.rb works fine from my local command line metrics-jstat.rb -j :::app_name::: -H :::name::: of course on the command line I have to actually type the app name. But it doesn't seem to work when running from sensu. It simple exits 1 with no output, and I don't see any details in sensu logs.

I've even tried giving sensu user full sudo access.

@efontana
Copy link

Bump, same problem here. I can see it's executing in the sensu-client.log and sensu-server.log(s)
but there is no output. it's almost as if there is too much output?

@efontana
Copy link

I figured out why it isn't working, however I don't know yet how to get around it.
In my case, I'm trying to monitor the Jenkins process, which was started by user jenkins.

when you run jps -v as user sensu, it doesn't see the jenkins process, so nothing gets printed.
if I run it as root, it does, the question is what's the workaround?

@andyfoster05
Copy link

Bump. Having the same issue. Tried adding sensu user to sudors all over the place, add sensu to admin groups, tried calling a script to sudo command, tried adding sudo before the check in sensu. I still cant figure out a work around.

@eheydrick
Copy link
Contributor

jstat has to run as the user owning the java process. e.g. sudo -u nobody -g sensu metrics-jstat.py -j <processname>

@majormoses majormoses changed the title Can't get metrics-jstat.rb to work from sensu, works fine from cli Can't get metrics-jstat.rb to work because of the elevated privileges required by jstat Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants