Ad Widget

Collapse

Monitoring CPU usage of Apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carlos.pereira
    Junior Member
    • Jun 2018
    • 5

    #1

    Monitoring CPU usage of Apache

    Hello!
    I'm a beginner to Zabbix. Also, I'm learning English, so... I can make mistakes sometimes.

    I was able to configure Zabbix for monitoring the Apache's status (wheter it's online or not). But I need now that the Zabbix monitors the CPU usage of only the Apache's process (or service) of a Linux server.
    Is there some way of do it?
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by carlos.pereira
    Hello!

    Is there some way of do it?
    Hi,

    Yes, you can use this parameters:
    • proc.num - can monitor the number of processes, based on process name, user, parameters etc
    • proc.mem - can monitor process memory usage (single process or a group of them)
    • proc.cpu.util - can monitor process CPU utilisation (single process or a group of them)
    Full information about parameters and options: https://www.zabbix.com/documentation...s/zabbix_agent

    Comment

    • carlos.pereira
      Junior Member
      • Jun 2018
      • 5

      #3
      For I to define a default parameter, is it enough that I put like this: "proc.cpu.util[apache,<user>,<type>,<cmdline>,<mode>,<zone>]" or must I put the others parameters empty?

      Comment

      • LenR
        Senior Member
        • Sep 2009
        • 1005

        #4
        proc.cpu.util][apache] should be good, I think you must remove the ones in <..> or you will get errors, but you can omit trailing commas. proc.cpu.util[,root] would get CPU for all root processes. (Not useful, just an example of the place holder comma)

        Comment

        • carlos.pereira
          Junior Member
          • Jun 2018
          • 5

          #5
          I put like this: "proc.cpu.util[apache]" but it give me the message: "Unsupported item key" and it don't work. What can it be?

          Comment

          • kernbug
            Senior Member
            • Feb 2013
            • 330

            #6
            Originally posted by carlos.pereira
            I put like this: "proc.cpu.util[apache]" but it give me the message: "Unsupported item key" and it don't work. What can it be?
            Hi,

            Run this command on the server with apache:
            Code:
            sudo -H -u zabbix -s /path/to/your/bash -c 'ps aux|grep -i apache'

            Comment

            • carlos.pereira
              Junior Member
              • Jun 2018
              • 5

              #7
              Originally posted by kernbug

              Hi,

              Run this command on the server with apache:
              Code:
              sudo -H -u zabbix -s /path/to/your/bash -c 'ps aux|grep -i apache'
              I did it and this command showed me all the services with apache that are running.

              Comment

              • kernbug
                Senior Member
                • Feb 2013
                • 330

                #8
                Originally posted by carlos.pereira

                I did it and this command showed me all the services with apache that are running.
                Please, show me the exact output from this command.

                Comment

                • carlos.pereira
                  Junior Member
                  • Jun 2018
                  • 5

                  #9
                  Originally posted by kernbug

                  Please, show me the exact output from this command.
                  Ok. The image is attached.
                  Attached Files

                  Comment


                  • Atsushi
                    Atsushi commented
                    Editing a comment
                    Please try to use "proc.cpu.util[httpd]".

                  • carlos.pereira
                    carlos.pereira commented
                    Editing a comment
                    When I put "proc.cpu.util[httpd]" the zabbix show me this message: "Unsupported item key".
                Working...