Forum Discussion

vg's avatar
vg
Icon for Nimbostratus rankNimbostratus
Sep 17, 2020

irule to get the maintainance page data from third party portal

This is my first ever irule work I have come across.

Problem Statement: We want to display the maintenance page during maintenance window. It is a static Unavailable.html page uploaded as ifile. We need to replace time( for maintenance window) and message for our users in that static html file. We also use third party product(which has got developers api) where we update the maintenance time and message. We want to pull that information and update the static html page with this information. Any approach or irule reference that I use will be good.

 

Please call out if this is not clear

1 Reply

  • Hi vg,

    Can you try adding variables in iFile (Unavailable.html)?

    Example iFile:

    <html>
    <head>
        <title>We will back soon</title>
    </head>
    <body>
    	Sorry, bla bla... $message <br><br>
    	Planned Maintenance Hours: $hours
    </body>
    </html>

    Example iRule:

    when HTTP_REQUEST {
    	set message "your message"
    	set hours "00:01 - 02:00"
    	HTTP::respond 200 content [subst [ifile get "Unavailable.html"]]
    }

    Output: