
Monitoring a specific date
In this article we will see something different and that we can give it the use we need, and it is nothing more than being able to monitor a day or a specific date and let us know as the day approaches. An ideal and practical example, Well, to have centralized when the licenses or maintenance of each software/hardware that we have acquired expire, For example; or, My birthday, the 12 and congratulate 😉 me
We'll use the script “countdown_to_date.php” that we can download from https://exchange.nagios.org/directory/Plugins/Others/countdown_to_date/details and we'll leave it as usual in the Centreon Scripts folder, at '/usr/lib/centreon/plugins/’ and make it executable with “chmod +x countdown_to_date.php”, If we are bored we can try it from the shell 😉
We should register the Command in Centreon, since “Configuration” > “Commands” > “Add” or cloning an existing one. We give it a name and put this command line:
[SourceCode]$CENTREONPLUGINS$/countdown_to_date.php –give yourself $ARG 1$ –warning $ARG 2$ –critical $ARG$3[/SourceCode]
Use 3 Arguments, the first will be the date we write in YYYY/MM/DD format, then the Plot 2 it will be the days with which it will notify us with Warning and the ARG3 the days in Critical.
After creating the, we can already create as many Services as we need, to make an example, this will be the Expiration for a contract for HP Servers, We indicate the command we just created in “Check Command” and we fill in the arguments with the date chosen and the days we want them to notify us, with 30 days to Warning and 15 for Critical. We save this Service and create the ones we need.
As usual, we record and export the Centreon configuration. After that, We go back to the monitoring view and we will have these dates fully controlled, another ideal to continue centralizing any issue that we must take into account, Let's trust in good monitoring and we will avoid surprises.