Monitoring public domain expirations with Centreon

No one doubts the importance of public domains, ¿No? You know when they expire? Instead of having it written down there and hopefully seeing it… Why don't we centralize everything in our monitoring tool?? In this document we will see how with Centreon you can monitor any domain and forget about the subject! We will be able to consult any domain, Be .com, .Org, .is, .rho, .fr, .it, .Euss, .co.uk…

 

It will be super simple, We will use Jwhois, a Whois client that allows any query, We install the requirements first and then download the script 'check_domain.sh’ that relying on jwhois and the parameters that we put into it, we will visualize it from Centreon, Start:

[SourceCode]yum install jwhois lynx -y
wget https://github.com/glensc/monitoring-plugin-check_domain/raw/master/check_domain.sh
chmod +x check_domain.sh
./check_domain.sh -D bujarra.com -W 30 -c 10[/SourceCode]

 

List, After proving that everything works, we can leave it in the path of the Centreon or Nagios plugins. Now we are going to Centreon to register the Command that we will use and then the Services that we are interested in depending on as many public domains as we have, Ok? With nougat!

 

GOOD, the first thing of all as always will be to register the Command that we will use, for this “Configuration” > “Commands” > “Add…” and we complete:

  • Comman Name: check_domain.sh (or whatever name we want to use, go).
  • Command Type: Check
  • Command Line: We indicate the command that will execute, We replace the path where the plugin is with variables, and the arguments that we will pass on to you. Add: “$CENTREONPLUGINS$/check_domain.sh -d $ARG 1$ -w $ARG 2$ -c $ARG 3$”

 

Click on “Describe arguments” and we indicate the description of the arguments, that it will be useful for us to understand what each thing is when we create the services. The first argument we know is the domain, the second argument will be the Warning in Days and the third argument will be when I already warned with Critical when there are less than X days left.

 

 

And we will be able to create as many services as there are public domains we have or want to monitor, Let's make an example, since “Configuration” > “Services”, duplicate any service or add a new one and we must take into account the following parameters:

  • Description: It is the name with which we will see this item monitored, something like “Tururú.eso domain” More than descriptive.
  • Linked with Hosts: We will link this service to any Host or server on our network, It doesn't matter which one, We can create a dummy host.
  • Template: Normally we will choose generic-active-service-custom, although in each deployment it may be different, eh!
  • Check Command: Select the Command we created in the previous step, what is 'check_domain.sh'.
  • Arguments: Nothing, as simple as filling in what it asks us to do, for example, to let me know with 60 days before my domain is going to expire with a Warning and if there are less than 30 days then sing with a warning Critical, in addition to obviously completing the domain, in this case the blog.

 

We recorded Centreon's service and setup, We do a reload and let's see if we have it…

 

 

And bam,! If we go to the monitoring part, We search for our service by filtering it and force its check., we will see at once that we have something less to take into account! Something more centralized and controlled, something like the dominance of the company is the most important thing we can lose =) I hope you find it interesting,

 

 

Recommended Posts

Author

nheobug@bujarra.com
Autor del blog Bujarra.com Cualquier necesidad que tengas, Do not hesitate to contact me, I will try to help you whenever I can, Sharing is living ;) . Enjoy documents!!!

Using Citrix Optimizer

26 June de 2018