Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-26573

proc.* items does not allow user id as parameter for username

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.0.13
    • Agent (G)
    • FreeBSD 14.2 amd64
    • Support backlog

      Steps to reproduce:{}

      1. Prepare chroot environment

      2. Add a user with a uid that does not exist in the host system to this environment:
      # cat /chroot/etc/passwd | grep vmal
      vmal:*:9001:0:vmal:/home/vmal:/usr/local/bin/bash

      # cat /etc/passwd | grep -c 9001
      0

      3. Run the process in the chroot environment as this user:
      # chroot /chroot/ su -l vmal -c top

      # ps aux | grep top
      root   22047   0,0  0,0   45320  2548  1  I    13:26             0:00,02 su -l vmal -c top
      9001   22048   0,0  0,0   16596  2520  1  S+   13:26             0:00,68 top

      Result:

      Since the user with this uid does not exist in /etc/passwd on the host system, proc.get returns the user's uid instead of the user name:
      # zabbix_agentd -t 'proc.get[top,,top,thread]'
      proc.get[top,,top,thread] [s|[\{"pid":2699,"ppid":2698,"jid":0,"name":"top","jname":null,"user":"9001","group":"wheel","uid":9001,"gid":0,"tid":294405,"tname":"top","cputime_user":0,"cputime_system":0,"state":"sleeping","ctx_switches":1098,"io_read_op":0,"io_write_op":0}]]

      # zabbix_agentd -t 'proc.num[top,,sleep,top]'
      proc.num[top,,sleep,top] [u|1]

      However, this value cannot be used further to obtain information about the process:
      # zabbix_agentd -t 'proc.get[top,9001,top,thread]'
      proc.get[top,9001,top,thread] [s|[]]

      # zabbix_agentd -t 'proc.num[top,9001,sleep,top]'
      proc.num[top,9001,sleep,top] [u|0]

      Expected:
      Using user ID as a parameter for user name may be allowed if no user with that name is found.

            zabbix.dev Zabbix Development Team
            olorin Vyacheslav Terekhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: