Forum Discussion

chandu_naveen's avatar
chandu_naveen
Icon for Nimbostratus rankNimbostratus
Jul 17, 2019

need an iRule Configured to not direct traffic to a server in the pool if Health Monitor rules identifies an issue.

VIP in Load Balancer needs an iRule Configured to not direct traffic to a server in the pool if Health Monitor rules identifies an issue. 

For example if one server on the pool returns 403 errors and a Health rule alert identifies 403 error the iRule should be triggered to stop sending traffic to that server.

Please help on to create Irule

  • You don't need an iRule for this, just a basic HTTP health monitor that accepts 403 as a receive disable string

  • Sajid's avatar
    Sajid
    Icon for Cirrostratus rankCirrostratus

    Try this irule for service-outage

     

    when HTTP_REQUEST {

    # Check and verify that there are Pool Members Available to server the request

    if { [active_members [LB::server pool]] < 1 } {

    # If there are no members available, generate HTML Maintenance Page

    HTTP::respond 200 content "<html><head><meta http-equiv='Content-type' content='text/html;charset=UTF-8'><title>Site Maintenance</title><style type='text/css'>body { color:#555555; font-family:Tahoma, Geneva, sans-serif; font-size:1em; font-weight:normal;text-align: center; padding: 20px; background: #ededed}h1 { font-size: 2em; color: #ED1C24 }body { font: 20px Helvetica, sans-serif; color: #333; }a { color: #dc8100; text-decoration: none; }a:hover { color: #333; text-decoration: none; }#site_maintenance { display: block; text-align: left; max-width: 95%; margin: 0 auto; padding: 0.5em 1em; background: #fff; box-shadow: 0 0 10px 1px #cccccc; -moz-border-radius: 5px; border-radius: 5px; }.arabic { direction: rtl; text-align: right; }.small { font-size: small } @media (min-width: 768px) {body { padding-top: 150px; }}@media (max-width:320px){ body{ font-size:0.9em}     h1 { font-size: 1em; color: #ED1C24 }    }</style></head>

    <body><div id='site_maintenance'> <h1>Site Maintenance!</h1>  

    <div><p>The online Website is not available at the moment due to upgrade/Maintenance. We are sorry for any inconvenience.

     

    <br/>   Thank you for your patience.</p> </div>

    <br/>   </p> </div>  </div></body></html>"

    }

    }