Ad Widget

Collapse

CPU Usage Of A Process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gpmidi
    Member
    • Aug 2009
    • 62

    #1

    CPU Usage Of A Process

    Is there any way to monitor the CPU usage of a process with a given name? Either in % or seconds? I'm just wondering if I missed something in the docs or a way to do it other than a script.
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Pretty easy to do on Windows using PerfMon counters and UserParameters.

    What platform are you talking about?

    Comment

    • gpmidi
      Member
      • Aug 2009
      • 62

      #3
      Linux

      Originally posted by tchjts1
      Pretty easy to do on Windows using PerfMon counters and UserParameters.

      What platform are you talking about?
      Linux, mostly RHEL 5
      -Paul

      Comment

      • thiagomz
        Member
        • Jan 2010
        • 74

        #4
        In nmon (IBM/Linux) you have this information. It will be welcome in zabbix.

        Comment

        • gpmidi
          Member
          • Aug 2009
          • 62

          #5
          Originally posted by thiagomz
          In nmon (IBM/Linux) you have this information. It will be welcome in zabbix.
          Yes but how do you get the info into Zabbix? I can script it to pull the CPU time out of /proc/<pid> pretty easy. But I was hoping there was a more efficient way that I had missed.
          -Paul

          Comment

          • MrKen
            Senior Member
            • Oct 2008
            • 652

            #6
            Originally posted by gpmidi
            Is there any way to monitor the CPU usage of a process with a given name? Either in % or seconds? I'm just wondering if I missed something in the docs or a way to do it other than a script.
            Actually, I was asked to do the same thing just yesterday, and came across an ancient post from 2005.

            UserParameter=httpd[cpu],ps auxw|grep httpd|grep -v grep| awk '{s+=$3} END {print s}'

            Seems to work ok. Gives the same values that you will see in 'top'.



            MrKen
            Disclaimer: All of the above is pure speculation.

            Comment

            • MrKen
              Senior Member
              • Oct 2008
              • 652

              #7
              Addendum:

              You may see values like 'httpd - 240%', and of course that cannot be correct. To correct this you need to divide by the number of cpu's. For example if the server has 4 cpu's, you will end up with a value of 60%, which is most probably closer to the real value.

              This can be done in the item configuration, Use Multiplier. For 4 cpu's you multiply by 0.25

              MrKen
              Disclaimer: All of the above is pure speculation.

              Comment

              • gpmidi
                Member
                • Aug 2009
                • 62

                #8
                Altiris

                Products such as Altiris have the option of monitoring all processes. Not just pre-selected ones. It's this type of feature that I'd like to see in Zabbix.
                -Paul

                Comment

                • zabbix_zen
                  Senior Member
                  • Jul 2009
                  • 426

                  #9
                  If you have a constructive remark why not filling it into the Request Tracker?

                  Comment

                  Working...