Ad Widget

Collapse

How we can monitor Nginx service using Zabbix?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tek Chand
    Member
    • Mar 2019
    • 57

    #1

    How we can monitor Nginx service using Zabbix?

    Hello Team,

    I am pretty new in Zabbix and our organisation want to use zabbix to monitor the resources. I have Zabbix and its up and running fine and currently i am monitoring some resources of our servers using Zabbix.
    But now we want to monitor some other services as well using the Zabbix like Nginx, Sidekiq, apache. Can you please help me how we can monitor them?
    Any help will be appreciated.

    Thanks in adavance.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    It is possible to check whether or not the process is started and the status of the port used in the service. Also, if you are using nginx or Apache HTTP Server, modules for obtaining various metrics are prepared. I am using it by acquiring its output and converting it to a format that can be handled by Zabbix.

    As a setting example, please check what is shared by Zabbix Share.

    Module ngx_http_stub_status_module :

    Apache Module mod_status :

    Zabbix Share :
    The Zabbix Team has collected all official Zabbix monitoring templates and integrations.

    Comment

    • Tek Chand
      Member
      • Mar 2019
      • 57

      #3
      Hello Atsushi,

      Thank you for your response.

      I have read the article but didn't get too much. Its may be due to lack of knowledge right now about Zabbix.

      I do some google and come to know that we can monitor the services using key as shown below:

      net.tcp.service[service,<ip>,<port>]

      But i don't know how we can set these setting in Zabbix dashboard for a host.

      Can you please help me to understand this with some example like a screenshot of setting in Zabbix dashboard.

      Thanks.

      Comment

      • Tek Chand
        Member
        • Mar 2019
        • 57

        #4
        Hello Atsushi,

        I am trying to monitor the apache2 service using zabbix. I have used the below key:

        proc.num[apache2,,,]

        And application is zabbix agent selected during item creation. But its not working and didn't show anything over dashboard.

        Can you please help me how we can create item to monitor such services like apache, nginx etc. Its become roadblock for me to complete my project.

        Any suggestion we be helpful. Thanks in advance.

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          Zabbix needs to understand the terms item and trigger.
          An item is used to get the value of metrics such as CPU utilization and number of processes. Since the item itself does not have a threshold setting, it can not be determined whether it is a failure even if only the item is set.

          In order to determine whether the value acquired for the item is normal or abnormal, set a trigger. Specify a conditional expression such as numeric comparison or string matching, and make settings such that it is regarded as a failure if the condition is met.

          For example, to check if the web server is in the LISTEN state with port number 80, create an item with the key net.tcp.listen [].

          Code:
          Name: Web server port status
          Type: Zabbix agent
          Key: net.tcp.listen[80]
          Type of information: Numeric (unsigned)
          If this value is 0, Web server is not in the LISTEN state.
          If this value is 1, it indicates that it is in the LISTEN state.

          Since the trigger should be regarded as a failure if the value of net.tcp.listen [80] is not 1, set the following as a trigger.

          Code:
          Name: Web server port status failed
          Severity: High
          Expression: {<Host or Template name>:net.tcp.listen[80].last()}<>1
          If you want to check by process number, create the following items.

          Code:
          Name: Number of processes for Web server
          Type: Zabbix agent
          Key: proc.num[apache2]
          Type of information: Numeric (unsigned)
          As a trigger, if it is a failure if the process is not started, the following settings will be considered.

          Code:
          Name: Web server not running
          Severity: High
          Expression: {<Host or Template name>:proc.num[apache2].last()}=0
          Use the settings of the existing template as a guide to customize what you want to monitor.

          Comment

          • Tek Chand
            Member
            • Mar 2019
            • 57

            #6
            Hello Atsushi,

            Thank you for your response.

            Earlier i have set only item not trigger. Now i have set both and its giving notification when service is stopped.

            But its not showing anything in problems on dashboard when service is stopped, so we can check there if someone missed the mail. Is it possible to show the services in problem so we can identify easily which service is not working on which server?

            Thanks.

            Comment


            • Tek Chand
              Tek Chand commented
              Editing a comment
              This issue has been resolved.
          Working...