Topic
  • 6 replies
  • Latest Post - ‏2014-03-22T13:42:07Z by jgstew
SyedIslam
SyedIslam
3 Posts

Pinned topic Creating a maintenace window for the last 'day' of the month

‏2014-02-27T22:58:46Z |

Hi

I'm currently deploying IEM v9 for out patching regime. Unfortunately some of our servers have a maintenance window for the last 'day' of the month. All I have found when creating the windows is 'day' of first week, second week, third week and fourth week.

Am I miising something or is it more complex?

Thanks.

  • jgstew
    jgstew
    47 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-03T01:04:01Z  

    There does not appear to be a built in relevance check for last day of the month. Here is something that is incomplete:

     

    if(current day_of_month as integer < 28) then false else if(current month as integer = 2) then /* check leap year and day */ else if(current day_of_month as integer < 30) then false else /* check months and ending days */

  • SyedIslam
    SyedIslam
    3 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-05T19:59:30Z  
    • jgstew
    • ‏2014-03-03T01:04:01Z

    There does not appear to be a built in relevance check for last day of the month. Here is something that is incomplete:

     

    if(current day_of_month as integer < 28) then false else if(current month as integer = 2) then /* check leap year and day */ else if(current day_of_month as integer < 30) then false else /* check months and ending days */

    Was really after a last day of month in terms of; last Sunday of Month or last Thursday of Month etc?

    Any ideas?

     

    Thanks.

  • jgstew
    jgstew
    47 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-05T20:02:49Z  
    • SyedIslam
    • ‏2014-03-05T19:59:30Z

    Was really after a last day of month in terms of; last Sunday of Month or last Thursday of Month etc?

    Any ideas?

     

    Thanks.

    So you are not looking for the absolute last day, but the last occurrence of a particular day of the week?

  • SyedIslam
    SyedIslam
    3 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-05T20:05:55Z  
    • jgstew
    • ‏2014-03-05T20:02:49Z

    So you are not looking for the absolute last day, but the last occurrence of a particular day of the week?

    The last occurrence of a particular day of the month (rather than week).

  • jgstew
    jgstew
    47 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-10T15:40:32Z  
    • SyedIslam
    • ‏2014-03-05T20:05:55Z

    The last occurrence of a particular day of the month (rather than week).

     

    This is what I came up with, which I think will work:  http://bigfix.me/relevance/details/2998771

     

    (it = first friday of month_and_year of it) of (current date + 7*day)

     

    I am checking if 1 week in the future is the first day_of_week of the next month. If so, then the current date is the last day_of_week of the current month. The example uses "friday" but you can exchange "friday" for any day of the week you desire.

  • jgstew
    jgstew
    47 Posts

    Re: Creating a maintenace window for the last 'day' of the month

    ‏2014-03-22T13:42:07Z  
    • SyedIslam
    • ‏2014-03-05T20:05:55Z

    The last occurrence of a particular day of the month (rather than week).

    Did this work for you?