Ad Widget

Collapse

Nginx: Get stub status page - ERROR when there is data

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dunnsland
    Member
    • Dec 2021
    • 81

    #1

    Nginx: Get stub status page - ERROR when there is data

    I have a situation where I am monitoring nginx on a server, I have a WARNING on the dashboard for nginx
    Click image for larger version

Name:	image.png
Views:	218
Size:	34.3 KB
ID:	499548

    The above warning says that nginx failed to fetch a stub, but if I click on Get stub status page ... I see no errors.

    Click image for larger version

Name:	image.png
Views:	163
Size:	107.8 KB
ID:	499549

    No errors shown below.
    Click image for larger version

Name:	image.png
Views:	167
Size:	149.4 KB
ID:	499550

    I hope that someone can please have some direction for me.
    Thanks
    Lawrence
  • Answer selected by dunnsland at 26-02-2025, 13:49.
    dunnsland
    Member
    • Dec 2021
    • 81

    Hamardaban
    I have figured out what was wrong with the trigger.
    In the previous trigger it was looking for the 301 redirect, but I do not use any redirect for teh nginx_status check. I removed it and used the following trigger instead and this works great.

    nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STAT US.P ATH}","{$NGINX.STUB_STATUS.PORT}"],30m)=1

    Thanks
    Lawrence

    Comment

    • dunnsland
      Member
      • Dec 2021
      • 81

      #2
      I have searched the forum and I see many people with similar issues but there is no clear indication why the alert is showing when the data seems to be there.

      below is my config.
      /etc/nginx/conf.d/nginx_status.conf
      server {
      listen 127.0.0.1:5555;
      location = /nginx_status {
      stub_status on;
      access_log on;
      allow 127.0.0.1;
      # only allow access from 192.168.1.5 #
      allow 192.168.1.31; # Zabbix server access
      deny all;
      }
      }

      # Test on commandline.
      curl http://localhost:5555/nginx_status
      Active connections: 2
      server accepts handled requests
      2376 2376 14399

      All my checks seem good, I have a history of 200 OK results from the URL

      To me there is no issues and the alert should not be presented, but ....

      Each time I clear the alert on the dashboard it reappears..

      Any ideas would be much appreciated
      Thanks
      Larwence

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #3
        You need to look into the trigger settings. Perhaps it is triggered not because of a failed connection, but because there is no data for more than x seconds.

        PS
        Apparently, you have nginx versions up to 1.7.5 . You need to upgrade! The current version is 1.26.3.
        Last edited by Hamardaban; 25-02-2025, 13:43.

        Comment

        • dunnsland
          Member
          • Dec 2021
          • 81

          #4
          Hamardaban Thank you for spotting that. I will go about doing the upgrade and also thanks for the heads up. I will look into the triggers

          Comment

          • dunnsland
            Member
            • Dec 2021
            • 81

            #5
            I have had a look at the trigger and I have no idea what it is trying to do.
            If there is anyone out there that can clarify and help me resolve the issue.

            find(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.P ATH}","{$NGINX.STUB_STATUS.PORT}"],,"like","HTTP/1.1 301")=0 or nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STATUS.P ATH}","{$NGINX.STUB_STATUS.PORT}"],30m)=1

            Hamardaban As for the nxinx version. I am running Ubuntu Noble and there is no release file for that version of Ubuntu yet.

            Lawrence

            Comment

            • dunnsland
              Member
              • Dec 2021
              • 81

              #6
              Hamardaban
              I have figured out what was wrong with the trigger.
              In the previous trigger it was looking for the 301 redirect, but I do not use any redirect for teh nginx_status check. I removed it and used the following trigger instead and this works great.

              nodata(/Nginx by Zabbix agent/web.page.get["{$NGINX.STUB_STATUS.HOST}","{$NGINX.STUB_STAT US.P ATH}","{$NGINX.STUB_STATUS.PORT}"],30m)=1

              Thanks
              Lawrence

              Comment

              Working...