Ad Widget

Collapse

Many domain expiration monitor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ernane87
    Junior Member
    • Jul 2019
    • 9

    #1

    Many domain expiration monitor

    I have difficulty monitoring domain expiration.
    Currently I have to monitor the expiration of many domains and have not found a way to do with Zabbix.
    Actually I didn't find one that works

    Can anyone help me? There is a similar question in this forum but no one answered. https://www.zabbix.com/forum/zabbix-...ain-expiration

    Help please.
  • jakiror
    Junior Member
    • Aug 2019
    • 2

    #2
    I wonder the answer
    router 192.168.1.1
    Last edited by jakiror; 20-08-2019, 00:14.

    Comment


    • Ernane87
      Ernane87 commented
      Editing a comment
      I did not understand your question
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #3
    If it is guaranteed that the whois database is up-to-date, you can get it from whois output, but it doesn't seem to be updated. Also, since the format varies depending on the organization that manages the domain, it is necessary to support each format.
    Check the whois output for the domain you are using and prepare a separate script for it.

    Depending on your environment, you may be able to get the remaining days with the following script:
    Code:
    #!/bin/bash
    DOMAIN="$1"
    exdate=`whois $DOMAIN | grep -E 'paid|Expir|Expires' | grep -o -E '[0-9]{4}.[0-9]{2}.[0-9]{2}|[0-9]{2}/[0-9]{2}/[0-9]{4}'`
    expire=$((`date -d "$exdate" '+%s'`))
    today=$((`date '+%s'`))
    leftsec=$(($expire - $today))
    leftdays=$(($leftsec/86400))
    echo $leftdays
    I refer to the information on the link that was in the first post.

    Comment

    • Ernane87
      Junior Member
      • Jul 2019
      • 9

      #4
      Good Morning.

      I would like to share with you how I was able to track the expiration date of various domains.

      Note: Here we monitor over 50 domains from Registro.br, GoDaddy, Localweb and others. It is impossible to monitor via whois without being blocked, besides having to handle many exceptions. So I adapted a simple script where I enter the expiration date in the macro and it calculates with the current date.

      First: I copied the check_dns_whois2.py script to / usr / bin / zabbix / externalscripts / and ran the default chmode for execute permission. The test can be done via manually running example:
      check_dns_whois2.py [{$ SSL_HOST}, {$ YEAR}, {$ MES}, {$ DAY}]

      # check_dns_whois2.py yoursite 2020 01 23

      Second: I imported the "zbx_export_templates.xml template"

      Third: I created a host for each domain and informed the macro as "prints host" attached.


      Click image for larger version

Name:	Prints host.JPG
Views:	7438
Size:	85.6 KB
ID:	386377


      I know it may not be the best option to track the expiration of a domain but for me it worked very well.

      Thanks.

      Comment

      • ogentil
        Junior Member
        • Apr 2020
        • 1

        #5
        Originally posted by Ernane87
        Good Morning.

        I would like to share with you how I was able to track the expiration date of various domains.

        Note: Here we monitor over 50 domains from Registro.br, GoDaddy, Localweb and others. It is impossible to monitor via whois without being blocked, besides having to handle many exceptions. So I adapted a simple script where I enter the expiration date in the macro and it calculates with the current date.

        First: I copied the check_dns_whois2.py script to / usr / bin / zabbix / externalscripts / and ran the default chmode for execute permission. The test can be done via manually running example:
        check_dns_whois2.py [{$ SSL_HOST}, {$ YEAR}, {$ MES}, {$ DAY}]

        # check_dns_whois2.py yoursite 2020 01 23

        Second: I imported the "zbx_export_templates.xml template"

        Third: I created a host for each domain and informed the macro as "prints host" attached.


        Click image for larger version

Name:	Prints host.JPG
Views:	7438
Size:	85.6 KB
ID:	386377


        I know it may not be the best option to track the expiration of a domain but for me it worked very well.

        Thanks.
        Hello!

        Could you kindly share the modified script? The one that you calculate the X days to the expiration date in the future?

        Thanks!

        Comment

        Working...