Ad Widget

Collapse

proc.num returns 0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dan1
    Junior Member
    • Apr 2016
    • 3

    #1

    proc.num returns 0

    I'm having issues getting proc.num to return anything other than 0 for certain services. Main one is Apache. Monitoring an open port isn't good enough, so I want to check the process is alive.

    See below for info:
    Code:
    [root@servername ~]# ps aux | grep httpd
    root         991  0.0  0.1 259792  9328 ?        Ss   Apr06   0:41 /usr/sbin/httpd -DFOREGROUND
    apache    182560  0.0  0.0 258616  4180 ?        S    Apr17   0:00 /usr/sbin/httpd -DFOREGROUND
    apache    182561  0.0  0.0 259792  3912 ?        S    Apr17   0:02 /usr/sbin/httpd -DFOREGROUND
    apache    182562  0.0  0.1 612156  7252 ?        Sl   Apr17   1:04 /usr/sbin/httpd -DFOREGROUND
    apache    182571  0.0  0.1 1070908 8048 ?        Sl   Apr17   1:03 /usr/sbin/httpd -DFOREGROUND
    apache    182596  0.0  0.1 1333052 8332 ?        Sl   Apr17   1:02 /usr/sbin/httpd -DFOREGROUND
    apache    187496  0.0  0.1 1857340 8044 ?        Sl   Apr17   0:55 /usr/sbin/httpd -DFOREGROUND
    root      265436  0.0  0.0 112648   956 pts/0    S+   12:06   0:00 grep --color=auto httpd
    
    [root@servername ~]# zabbix_get -s 127.0.0.1 -k 'proc.num[,apache,,"/usr/sbin/httpd -DFOREGROUND"]'
    0
    
    [root@servername ~]# zabbix_get -s 127.0.0.1 -k 'proc.num[,,,httpd]'
    0
    
    [root@servername ~]# zabbix_get -s 127.0.0.1 -k 'proc.num[httpd]'
    0
    
    [root@servername ~]# zabbix_get -s 127.0.0.1 -k 'proc.num[,apache]'
    0
    
    [root@sid-plesk-01 ~]# zabbix_get -s 127.0.0.1 -k 'proc.num[zabbix_agentd]'
    6
    
    
    [[root@servername ~]# sestatus
    SELinux status:                 disabled
    
    [[root@servername ~]# cat /etc/sysconfig/selinux
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=permissive
    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     minimum - Modification of targeted policy. Only selected processes are protected.
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    Am I being really thick? What am I missing?
  • dan1
    Junior Member
    • Apr 2016
    • 3

    #2
    Fixed. Realised that Zabbix couldn't see any other processes than itself, so it would be permission related.

    Need to set AllowRoot=1 in the zabbix agent config


    I think this is something that should be mentioned in the documentation, as I couldn't find any mention at all!

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3
      Originally posted by dan1
      Fixed. Realised that Zabbix couldn't see any other processes than itself, so it would be permission related.

      Need to set AllowRoot=1 in the zabbix agent config


      I think this is something that should be mentioned in the documentation, as I couldn't find any mention at all!
      Instead giving zabbix agent privileges you should add to zabbix account permission to be able check other processes status.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • dan1
        Junior Member
        • Apr 2016
        • 3

        #4
        Originally posted by kloczek
        Instead giving zabbix agent privileges you should add to zabbix account permission to be able check other processes status.
        That does sound better than giving root access. How do you do it?

        Comment

        Working...