0

how can I enable under Debian 6 to list the processes of a foreign user? I have the user nagios but this user can only list his own processes.

Br

1 Answer 1

0

check_procs command accepts a "-u USER" argument to list the processes for the specified user.

You have to edit you command.cfg (the place where your nagios command are defined), and add something like this:

define command{
    command_name    check_user_procs
    command_line    /usr/lib/nagios/plugins/check_procs -w '$ARG1$' -c '$ARG2$' -u '$ARG3$'
    }

and create a service check for the user:

define service{
    use                             generic-service
    host_name                       YOUR-HOST-NAME   
    service_description             Total Processes
    check_command                   check_user_procs!250!400!USER_NAME_OR_ID
    }

you have to replace USER_NAME_OR_ID withe the user info you are checking for.

The first two number specify the limits for warning and critical events.

3
  • Thx for your answer. This is not working if I execute check_procs as user nagios. Because ps aux also lists only own processes. It must be a system wide setting on Debian not nagios.
    – TheFox
    Apr 22, 2012 at 11:38
  • This is just not true, actually... unless maybe you have selinux enabled, or something like that? You can add "-vv" to check_procs to make it show you exactly what "ps" command it's using.
    – Keith
    Apr 24, 2012 at 17:54
  • It works on my Debian Squeeze box, you should check for apparmor or selinux on your box as Keith suggested. May 2, 2012 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .