Results 1 to 3 of 3
Hi,
I am using Zabbix to monitor our production environments. One of these environments is an array of VPSs (not maintained by us but to which I do have root ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-02-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 23
monitoring beancounters - or run single command as root
Hi,
I am using Zabbix to monitor our production environments. One of these environments is an array of VPSs (not maintained by us but to which I do have root access).
I am trying to monitor data from the /proc/user_beancounters file which contains OpenVZ related counters.
Anyway in the Zabbix config I am to place something that looks like:
but when the Zabbix agent attempts to run the command it fails since as it turns out /proc/user_beancounters has only read access for root while the zabbix agent is running under (believe it or not) user zabbix.Code:UserParameter=beancounters.tcpsndbuf.failcount,cat /proc/user_beancounters | grep tcpsndbuf | tr -s ' ' | cut -d' ' -f7
I tried various methods using sudo and su to get this running. I'd rather not to have to resort to that at all since that would mean using root password in the config file, but that is another story.
Anyway, nothing works... anyone got an idea either how to get the beancounter data using zabbix, or to help me get su to do the trick (without user interaction of course)?
Cheers,
DB
- 11-02-2010 #2
Wrap the commands in a script,
set it executeable and readable by root
and then set up sudo to allow the user zabbix to execute this one command without password.You must always face the curtain with a bow.
- 11-03-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 23
Thanks Irithori,
Can you please point me to the right config line I need to put in sudoers file to enable this?
And BTW, why does it need to be a shell script? Why can't I just do the following?
Reason I'm asking is that when I tried using sudo before it gave me weird results. It tried to run some of the command parameters separately or something like that. Maybe it simply can't be done in some cases? But if that's true, in which cases?Code:UserParameter=command.name,sudo myCommand
Cheers,
DBLast edited by devboy; 11-03-2010 at 03:07 PM.


Reply With Quote
