Back to ITRS Internal Only FAQ

Internal documentation only

This page has been marked as draft.

How to setup the rule to alert 90, 60 & 30 days before expiry

Create an alert for component expiry dates (YYYYMMDD HHMM format) in a cell. It should trigger notifications 90, 60, and 30 days prior to the expiry.

Requirement Copied

Need to set up the rule to alert 90, 60 & 30 days before expiry.

Geneos -  How to setup the rule to alert 90, 60 & 30 days before expiry

Solution(s) Copied

Implement a rule to calculate and alert 90, 60, and 30-day pre-expiry dates from a cell containing a YYYYMMDD HHMM-formatted expiry date

Use the following test dataview and was able to create a rule on the ExpiryDate column like below:

Geneos -  How to setup the rule to alert 90, 60 & 30 days before expiry

The idea is to use the parseDate function to convert the date string into Unix epoch time and compare the Unix epoch at the rule run time. To get the remaining days just divide the difference by the number of seconds in a day. So the rule block should look something like this:

set $(diffInDays) (parseDate("%Y%m%d%H%M", value) - now()) / 86400 if $(diffInDays) <= 30 then severity critical elseif $(diffInDays) > 30 and $(diffInDays) <= 60 then severity warning elseif $(diffInDays) > 60 and $(diffInDays) <= 90 then severity ok endif

[Guide: Provide the official documentation links of the related product feature mentioned above and other external references that would further help the user understand the problem/s and solution/s.]

["Geneos"] ["FAQ"]

Was this topic helpful?