Forum Discussion

toki_132571's avatar
toki_132571
Icon for Nimbostratus rankNimbostratus
Aug 29, 2013

2日以上の日をまたいでsorryページの起動・停止を設定したい(You want to set the start and stop of the sorry page across the Day: 2 days or more)

題名にある設定を行いたいと考えていますが、以下の設定でできませ​​ん。何が駄目なのか解る方がいらっしゃいましたら宜しくお願いします。

 

私たちは、[ごめん·ページ]を設定するには、2日以上の日付ではなく、次のような構成にしたいと思います。私は、あなたができるようにしたい、それをどこに固定するのですか?

 

時RULE_INIT {セット:: StartTimeの291200セット:: STOPTIME 300200} HTTP_REQUESTは{L [スプリット[クロックフォーマット[クロック秒]形式{%d個の%H%のM}] ""]セットcomptime "[LINDEX $ L 1を設定】【LINDEX $ L 2] "であれば{([LINDEX $ L 0] EQ $ comptime> = $ :: StartTimeの)&&($ comptime <= $ :: STOPTIME)} {HTTP_RESPOND 200"メンテナンス中 "}}

 

7 Replies

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    You can easily model after the following example:

     

    https://devcentral.f5.com/wiki/iRules.Print.aspx?Page=iRules.Time-based-iRule-example

     

  • one dollar sign is missing.

      if {$now > $static::start and $now < $static::end} {
    
    • toki_132571's avatar
      toki_132571
      Icon for Nimbostratus rankNimbostratus
      ありがとうございます。エラーは解消されました。 ただ、どうしてもpoolを指定しないでやるやり方はありますか? 現状は以下の様になっています。 でもそのままメンテナンスページを表示させたいです。 when RULE_INIT { set static::start_date "2013-08-29 14:40" set static::end_date "2013-08-29 14:50" set static::start [clock scan $static::start_date] set static::end [clock scan $static::end_date] } when CLIENT_ACCEPTED { Get the current time in seconds since the Unix epoch of 0-0-1970 set now [clock seconds] Check if the current time is between the start and end times if {$now > $static::start and $now < $static::end} {pool global-http} } when HTTP_REQUEST { HTTP::respond 200 content " メンテナンス中 " }
    • toki_132571's avatar
      toki_132571
      Icon for Nimbostratus rankNimbostratus
      ありがとうございました。 なんとかやりたい事が出来ました。
  • one dollar sign is missing.

      if {$now > $static::start and $now < $static::end} {
    
    • toki_132571's avatar
      toki_132571
      Icon for Nimbostratus rankNimbostratus
      ありがとうございます。エラーは解消されました。 ただ、どうしてもpoolを指定しないでやるやり方はありますか? 現状は以下の様になっています。 でもそのままメンテナンスページを表示させたいです。 when RULE_INIT { set static::start_date "2013-08-29 14:40" set static::end_date "2013-08-29 14:50" set static::start [clock scan $static::start_date] set static::end [clock scan $static::end_date] } when CLIENT_ACCEPTED { Get the current time in seconds since the Unix epoch of 0-0-1970 set now [clock seconds] Check if the current time is between the start and end times if {$now > $static::start and $now < $static::end} {pool global-http} } when HTTP_REQUEST { HTTP::respond 200 content " メンテナンス中 " }
    • toki_132571's avatar
      toki_132571
      Icon for Nimbostratus rankNimbostratus
      ありがとうございました。 なんとかやりたい事が出来ました。