[ZBX-9176] HTTPs service is showing unknown service in Discovery Created: 2014 Dec 30  Updated: 2017 May 30  Resolved: 2015 Jan 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.7
Fix Version/s: 2.0.15rc1, 2.2.9rc1, 2.4.4rc1, 2.5.0

Type: Incident report Priority: Major
Reporter: Jitendra Pagare Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: notifications
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 6.5 (Final), Microsoft Azure VM


Attachments: JPEG File Discovery rule.JPG    

 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
[email protected]

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

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



 Comments   
Comment by Aleksandrs Saveljevs [ 2014 Dec 30 ]

Similarly, Telnet service is not considered either.

Comment by Aleksandrs Saveljevs [ 2015 Jan 05 ]

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

Comment by Jitendra Pagare [ 2015 Jan 05 ]

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?

Comment by Aleksandrs Saveljevs [ 2015 Jan 05 ]

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.

Comment by Aleksandrs Saveljevs [ 2015 Jan 05 ]

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";
        }
Comment by Jitendra Pagare [ 2015 Jan 05 ]

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

Comment by Aleksandrs Saveljevs [ 2015 Jan 05 ]

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.

Comment by Aleksandrs Saveljevs [ 2015 Jan 05 ]

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

Generated at Tue Apr 23 12:38:23 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.