F5 Sites
  • F5.com
  • LearnF5
  • NGINX
  • MyF5
  • Partner Central
Contact
  • Under Attack?
  • F5 Support
  • DevCentral Support
  • F5 Sales
  • NGINX Sales
  • F5 Professional Services
Skip to contentBrand Logo
Forums
CrowdSRC
Articles
Groups
EventsSuggestionsHow Do I...?
RegisterSign In
  1. DevCentral
  2. Articles
  3. Technical Articles

iRule Maintenance Windows

A fun, but not well known, feature on BIG-IP is the Statistics Profile. This tech tip is the second in a series on how the Statistics Profile and iRules, when working together, can save time, product...
Published Apr 10, 2007
Version 1.0
automation
BIG-IP
dev
management
monitoring
news
tech tip
virtualization
Joe_Pruitt's avatar
Joe_Pruitt
Joined September 22, 2004
View Profile
Joe_Pruitt's avatar
Joe_Pruitt
Joined September 22, 2004
View Profile
ASAT_6562's avatar
ASAT_6562
Icon for Nimbostratus rankNimbostratus
May 24, 2010
I have had trouble getting this to work correctly. Even when the Octal number issue is resolved, the evaluation of current_time fails when the time real current time is between ));24 and 00:59. Using set cur_time [clock format [clock scan now] -format %H:%M] solved the issue for us and this is now happy in our production environment and works as expected.

 

 

My code from /check

 

 

"/check" {

 

Return the current time and the current settings for the maintenance window

 

set day [STATS::get $PROFILE_NAME "day"]

 

if { ($day < 1) } {

 

set day "No day set"

 

}

 

set start_time [clock format [clock scan [STATS::get $PROFILE_NAME "start_time"]] -format %H:%M]

 

set end_time [clock format [clock scan [STATS::get $PROFILE_NAME "end_time"]] -format %H:%M]

 

scan [clock format [clock seconds] -format {%A %k %M}] {%s %s %s} cur_day cur_hour cur_minute

 

set cur_time [clock format [clock scan now] -format %H:%M]

 

log local0. "\$cur_day: $cur_day, \$cur_hour: $cur_hour, \$cur_minute: $cur_minute, \$cur_time: $cur_time"

 

HTTP::respond 200 content [subst $::window_check_response]

 

}

 

 

 

ABOUT DEVCENTRAL

DevCentral NewsTechnical ForumTechnical ArticlesTechnical CrowdSRCCommunity GuidelinesDevCentral EULAGet a Developer Lab LicenseBecome a DevCentral MVP

RESOURCES

Product DocumentationWhite PapersGlossaryCustomer StoriesWebinarsFree Online CoursesF5 CertificationLearnF5 Training

SUPPORT

Manage SubscriptionsProfessional ServicesProfessional ServicesCreate a Service RequestSoftware DownloadsSupport Portal

PARTNERS

Find a Reseller PartnerTechnology AlliancesBecome an F5 PartnerLogin to Partner Central

F5 logo©2024 F5, Inc. All rights reserved.
TrademarksPoliciesPrivacyCalifornia PrivacyDo Not Sell My Personal Information