ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-9176

HTTPs service is showing unknown service in Discovery

    Details

      Description

      Hello,

      I am trying to check HTTPs uptime in every 24 hrs using Discovery rule. It is working fine for me using the port number (i.e. 443) but showing Uknown Service in email notification. It shows an error when service is down.
      I have also configured the same Discovery rule for HTTP and it is working fine i.e. it is recognizing the HTTP service in email notification.

      The message body configured in Action for HTTPs is:

      Item values:
      
      1. Customer ID - ABC
      2. Hostname - ABC
      3. Host IP - {DISCOVERY.DEVICE.IPADDRESS}
      4. Application/Service - {DISCOVERY.SERVICE.NAME}
      
      ---------Begin - Uptime details-------------------
      
      Device service name: {DISCOVERY.SERVICE.NAME}
      
      Device service port: {DISCOVERY.SERVICE.PORT}
      
      Device service status: {DISCOVERY.SERVICE.STATUS}
      
      Device service uptime: {DISCOVERY.SERVICE.UPTIME}
      
      ---------End - Uptime details-------------------
      
      Dear Recipient,
      
      According to our monitoring system the ABC {DISCOVERY.SERVICE.NAME} service has been {DISCOVERY.SERVICE.STATUS} total of {DISCOVERY.SERVICE.UPTIME} since last discovery.
      
      
      Best Regards,
      
      xyz Monitoring Team
      Support@xyz.com
      

      ----------------------------------------------------------------------------------------------

      Attached file is the discovery rule i have created.

      ----------------------------------------------------------------------------------------------

      Just have taken a look at the source code (src/libs/zbxserver/expression.c) and HTTPS service is indeed not considered:

      Code:

      const char      *zbx_dservice_type_string(zbx_dservice_type_t service)
      {
              switch (service)
              {
                      case SVC_SSH:
                              return "SSH";
                      case SVC_LDAP:
                              return "LDAP";
                      case SVC_SMTP:
                              return "SMTP";
                      case SVC_FTP:
                              return "FTP";
                      case SVC_HTTP:
                              return "HTTP";
                      case SVC_POP:
                              return "POP";
                      case SVC_NNTP:
                              return "NNTP";
                      case SVC_IMAP:
                              return "IMAP";
                      case SVC_TCP:
                              return "TCP";
                      case SVC_AGENT:
                              return "Zabbix agent";
                      case SVC_SNMPv1:
                              return "SNMPv1 agent";
                      case SVC_SNMPv2c:
                              return "SNMPv2c agent";
                      case SVC_SNMPv3:
                              return "SNMPv3 agent";
                      case SVC_ICMPPING:
                              return "ICMP ping";
                      default:
                              return "unknown";
              }
      }
      

      Since it's already defined (include/common.h):

      Code:

      /* service supported by discoverer */
      typedef enum
      {
              SVC_SSH = 0,
              SVC_LDAP,
              SVC_SMTP,
              SVC_FTP,
              SVC_HTTP,
              SVC_POP,
              SVC_NNTP,
              SVC_IMAP,
              SVC_TCP,
              SVC_AGENT,
              SVC_SNMPv1,
              SVC_SNMPv2c,
              SVC_ICMPPING,
              SVC_SNMPv3,
              SVC_HTTPS,
              SVC_TELNET
      }
      

      Kindly verify and let me know the resolution for these.

      Thanks,
      Jitendra

        Activity

        Hide
        Aleksandrs Saveljevs added a comment -

        Similarly, Telnet service is not considered either.

        Show
        Aleksandrs Saveljevs added a comment - Similarly, Telnet service is not considered either.
        Hide
        Aleksandrs Saveljevs added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9176 .

        Show
        Aleksandrs Saveljevs added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-9176 .
        Hide
        Jitendra Pagare added a comment - - edited

        Sorry, i am newbie in this site. If it is fixed, how can i use this in my system? What should i do now? If this issue is resolved in 2.2.9rc1, when it will be available to implement/install?

        Show
        Jitendra Pagare added a comment - - edited Sorry, i am newbie in this site. If it is fixed, how can i use this in my system? What should i do now? If this issue is resolved in 2.2.9rc1, when it will be available to implement/install?
        Hide
        Aleksandrs Saveljevs added a comment -

        If you are in a hurry or you wish to test, you can check out the above mentioned development branch from our Subversion repository: "svn checkout svn://svn.zabbix.com/branches/dev/ZBX-9176". Alternatively, if you are not in a hurry, you can wait until the fix has been reviewed, tested, and merged into the stable branches. After that it will become available not only in svn, but also on http://www.zabbix.com/download.php and other distribution channels.

        Show
        Aleksandrs Saveljevs added a comment - If you are in a hurry or you wish to test, you can check out the above mentioned development branch from our Subversion repository: "svn checkout svn://svn.zabbix.com/branches/dev/ZBX-9176". Alternatively, if you are not in a hurry, you can wait until the fix has been reviewed, tested, and merged into the stable branches. After that it will become available not only in svn, but also on http://www.zabbix.com/download.php and other distribution channels.
        Hide
        Aleksandrs Saveljevs added a comment - - edited

        You are using 2.2.7, but the development branch is for 2.0. The fix is simple and, insteading of checking out the development branch, you can simply apply the following patch, which is essentially what is implemented in the branch:

        Index: src/libs/zbxcommon/str.c
        ===================================================================
        --- src/libs/zbxcommon/str.c    (revision 51368)
        +++ src/libs/zbxcommon/str.c    (working copy)
        @@ -2531,6 +2531,10 @@
                                return "SNMPv3 agent";
                        case SVC_ICMPPING:
                                return "ICMP ping";
        +               case SVC_HTTPS:
        +                       return "HTTPS";
        +               case SVC_TELNET:
        +                       return "Telnet";
                        default:
                                return "unknown";
                }
        
        Show
        Aleksandrs Saveljevs added a comment - - edited You are using 2.2.7, but the development branch is for 2.0. The fix is simple and, insteading of checking out the development branch, you can simply apply the following patch, which is essentially what is implemented in the branch: Index: src/libs/zbxcommon/str.c =================================================================== --- src/libs/zbxcommon/str.c (revision 51368) +++ src/libs/zbxcommon/str.c (working copy) @@ -2531,6 +2531,10 @@ return "SNMPv3 agent"; case SVC_ICMPPING: return "ICMP ping"; + case SVC_HTTPS: + return "HTTPS"; + case SVC_TELNET: + return "Telnet"; default: return "unknown"; }
        Hide
        Jitendra Pagare added a comment -

        one last question sir, is there any document for applying this patch?

        Show
        Jitendra Pagare added a comment - one last question sir, is there any document for applying this patch?
        Hide
        Aleksandrs Saveljevs added a comment - - edited

        In order to apply the patch, one should put the above patch into file "patch.diff" and then run "patch -p0 -l < patch.diff" in the root of Zabbix source tree.

        Show
        Aleksandrs Saveljevs added a comment - - edited In order to apply the patch, one should put the above patch into file "patch.diff" and then run "patch -p0 -l < patch.diff" in the root of Zabbix source tree.
        Hide
        Aleksandrs Saveljevs added a comment -

        Fixed in pre-2.0.15 r51382, pre-2.2.9 r51383, pre-2.4.4 r51384, and pre-2.5.0 (trunk) r51385.

        Show
        Aleksandrs Saveljevs added a comment - Fixed in pre-2.0.15 r51382, pre-2.2.9 r51383, pre-2.4.4 r51384, and pre-2.5.0 (trunk) r51385.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jitendra Pagare
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: