Ad Widget

Collapse

Number of running processes = 0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wbro1
    Junior Member
    • Apr 2009
    • 17

    #1

    Number of running processes = 0

    chkconfig --list gives me a list of services on my SuSE 10 OES2 server. Some of theme I like to monitor, see below.

    apache2
    cron
    namcd
    ndsd
    network
    novell-httpstkd
    novell-idsd
    novell-ipsmd
    novell-ncs
    novell-nss
    novell-smdrd
    novell-tomcat5
    novell-xregd
    novell-xsrvd
    novell-zmd
    nscd
    ntp
    owcimomd
    slpd
    nxdrvd

    I use the proc.num[servicename like above] to count the number of running processes. Resulting in the list below.

    Number of running processes namcd 08 May 11:54:58 1
    Number of running processes novell-nss 08 May 11:54:56 0
    Number of running processes ntp 08 May 11:54:58 0
    Number of running processes apache2 08 May 11:55:00 0
    Number of running processes cron 08 May 11:55:01 1
    Number of running processes ndsd 08 May 11:55:04 1
    Number of running processes network 08 May 11:55:03 0
    Number of running processes novell-httpstkd 08 May 11:55:05 0
    Number of running processes novell-idsd 08 May 11:55:07 0
    Number of running processes novell-ipsmd 08 May 11:55:06 0
    Number of running processes novell-ncs 08 May 11:55:09 0
    Number of running processes novell-smdrd 08 May 11:55:06 0
    Number of running processes novell-tomcat5 08 May 11:55:07 0
    Number of running processes novell-xregd 08 May 11:55:10 1
    Number of running processes novell-xsrvd 08 May 11:55:11 11
    Number of running processes novell-zmd 08 May 11:55:11 0
    Number of running processes nscd 08 May 11:55:11 1
    Number of running processes owcimomd 08 May 11:55:12 1
    Number of running processes slpd 08 May 11:55:15 1
    Number of running processes nxdrvd 08 May 11:55:14 0
    Number of running processes sshd 08 May 11:55:41 1

    So, some of them end up with 0 (zero).

    WHY IS THIS ?
  • caarts
    Member
    Zabbix Certified Specialist
    • Aug 2008
    • 37

    #2
    Not sure (correct me if I am mistaken),
    A 0 indicates that either the process does not exist (or that it cannot find it), or mispelled name of the process you wish to monitor, or that it really is not running at all.

    I have several SuSE 9.1/9.3/10 servers at work that are monitored by Zabbix.

    Running #zabbix_agentd -t proc.num[apache2] will output

    #proc.num[apache2] [u|0]

    But, running #zabbix_agentd -t proc.num[httpd2-prefork] -> will result in:

    #proc.num[httpd2-prefork] [u|11]

    Do a ps -ef | grep (process you are looking for) and check the output.

    Comment

    • wbro1
      Junior Member
      • Apr 2009
      • 17

      #3
      Thanks for the response, I tried it right away, see results below.
      What can I do with this info.

      CN01:~ # ps -ef |grep novell-ncs
      root 25058 23890 0 08:09 pts/0 00:00:00 grep novell-ncs
      CN01:~ # ps -ef |grep novell-nss
      root 26828 23890 0 08:10 pts/0 00:00:00 grep novell-nss
      CN01:~ # ps -ef |grep ntp
      ntp 4386 1 0 Apr03 ? 00:00:00 /usr/sbin/ntpd -p /var/lib/ntp/var/run/ntp/ntpd.pid -u ntp -i /var/lib/ntp
      root 27443 23890 0 08:10 pts/0 00:00:00 grep ntp
      CN01:~ # ps -ef |grep apache2
      root 6421 1 0 Apr15 ? 00:00:00 /usr/sbin/httpd2-worker -f /etc/apache2/httpd.conf -DSSL
      wwwrun 12065 6421 0 04:12 ? 00:00:00 /usr/sbin/httpd2-worker -f /etc/apache2/httpd.conf -DSSL
      wwwrun 13462 6421 0 Apr23 ? 00:00:00 /usr/sbin/httpd2-worker -f /etc/apache2/httpd.conf -DSSL
      root 29811 23890 0 08:12 pts/0 00:00:00 grep apache2

      Comment

      • caarts
        Member
        Zabbix Certified Specialist
        • Aug 2008
        • 37

        #4
        wbro 1

        When you: # ps -ef |grep novell-ncs and it returns: root 25058 23890 0 08:09 pts/0 00:00:00 grep novell-ncs -> it means there is no such process, either other name or it is not running.

        Comment

        • wbro1
          Junior Member
          • Apr 2009
          • 17

          #5
          I can see it running with the status command below.
          How can I check this in Zabbix ? Isn't this a process ?


          CN01:~ # rcnovell-ncs status
          running
          CN01:~ #

          for your info, command below gives same result.

          CN01:/etc/rc.d # ./novell-ncs status
          running
          CN01:/etc/rc.d #
          Last edited by wbro1; 11-05-2009, 10:49.

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            you have to find out actual process name, not the name of the initscript.

            for a grepped list, i'd suggest using "ps -AH|grep <string>".
            for a definitive match on processname, use "ps -C <processname>"
            Zabbix 3.0 Network Monitoring book

            Comment

            • wbro1
              Junior Member
              • Apr 2009
              • 17

              #7
              Here's what I did so far,

              Looked in novell-ncs with cat novell-ncs.
              Found near the start parameter the calling of ldncs

              Looked in ldncs with cat ldncs.
              Found /sbin/evmsd

              this one I can find in ps -AH |grep evmsd

              What i don't know, is this the only thing novell-ncs is running.
              How can I find out values below with Zabbix

              chkconfig --list novell-ncs
              novell-ncs 0ff 1ff 2ff 3n 4ff 5n 6ff

              Comment

              • caarts
                Member
                Zabbix Certified Specialist
                • Aug 2008
                • 37

                #8
                Try the ps suggestions richlv gave and paste the output here in a new reply.

                Comment

                • richlv
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Oct 2005
                  • 3112

                  #9
                  first, yes, initscript could be starting multiple processes.
                  second, values you posted would make little sense to monitor - you would only find out whether service is _configured_ to run, not whether it is running. while a valid goal, i understood that you want to check whether the service is actually running.

                  you could rely on initscripts to work correctly and use service status, though. for that you could use user parameters (read in the manual about them) by configuring userparameter with a string, similar to this :
                  Code:
                  service <service> status > /dev/null 2>&1; echo $?
                  and checking whether returned values is 0. if it is, service is reported as running. if it's some other value, service is not running.

                  for bonus points use positional parameter instead of a fixed service name in the userparameter.
                  Zabbix 3.0 Network Monitoring book

                  Comment

                  • rue
                    Member
                    Zabbix Certified Specialist
                    • May 2006
                    • 43

                    #10
                    If evmsd is the only process started directly in the init script, try:

                    Code:
                    ps -ef --forest
                    ...to see what's running what on your system.

                    cheers

                    RĂ¼

                    Comment

                    • richlv
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Oct 2005
                      • 3112

                      #11
                      it would be helpful if you could find out process names yourself.
                      as a quick way you could try something like this to find out what processes the service might use...
                      Code:
                      SERVICE=novell-ncs; service $SERVICE stop; ps -Ao comm= | sort -u|less > no; service $SERVICE start; ps -Ao comm= | sort -u|less > yes; diff yes no
                      note, it restarts a particular service once. it will most likely also catch other processes, but you should be able to decypher which ones do not belong to a particular service
                      Zabbix 3.0 Network Monitoring book

                      Comment

                      • wbro1
                        Junior Member
                        • Apr 2009
                        • 17

                        #12
                        @ richlv

                        I think your option is the best for us.

                        I edited the zabbix_agentd.conf and added your line without the > /dev/null 2>&1; echo $?

                        UserParameter=OESstatus[*] $1 status

                        restarted with zabbix_agentd restart.

                        Then added an item with key

                        OESstatus[rcnovell-ncs]

                        resulting in value 0

                        0 is running, other values is not running I presume ?

                        Thanks for your input.

                        Comment

                        • wbro1
                          Junior Member
                          • Apr 2009
                          • 17

                          #13
                          This only works with 'text' values i guess. I get following message on another item.

                          Type of received value [NSS kernel modules..running NSS admin volume..unused] is not sutable for [OESstatus[rcnovell-nss]@CN03]


                          the console output of rcnovell-nss status is:

                          NSS kernel modules running
                          NSS admin volume running

                          Comment

                          • richlv
                            Senior Member
                            Zabbix Certified Trainer
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Oct 2005
                            • 3112

                            #14
                            and why did you remove "> /dev/null 2>&1; echo $?" part ?
                            Zabbix 3.0 Network Monitoring book

                            Comment

                            • wbro1
                              Junior Member
                              • Apr 2009
                              • 17

                              #15
                              To be sure I knew what the sentence did.
                              Your parameters I can't translate to what it wil do

                              Comment

                              Working...