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
DeVon_Jarvis's avatar
DeVon_Jarvis
Icon for Altostratus rankAltostratus
Nov 16, 2008
Here is what I found out. The octal concern is not an issue any more, but comparing anything to 0800 (leading zero) seems to do a string compare, which leads to incorrect results.

 

 

What I did was to change the clock format string to:

 

set t_array [split [clock format [clock seconds] -format {%u %k %M}] " "]

 

 

The %k gives you the hours in 24 hour clock without any leading zeros. Yay! Just what we wanted!

 

 

This way, numeric comparisons prevail and we get just what we wanted.

 

 

I also optimized my version to only do these comparisons once each minute, and store the result in a global variable. This saves lots of processing especially on a busy site! No need to check on every request, as the status of the outage window will not change anyway.

 

 

If you want my version of the code, let me know and I will submit it.

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