Welcome!

Perl Authors: Jyoti Bansal, Liz McMillan, Mike Hicks, RealWire News Distribution, Bob Gourley

Blog Feed Post

Host that Sorry Page on your BIG-IP!

It's not an uncommon problem trying to figure out where to plant that sorry page in the event your farm is down.  It's also not an uncommon solution to just use your BIG-IP to issue a text-only HTTP::respond.  It works, but it's not, how do you say, visually appealing?  You want to say sorry and mean it.  With pictures.  If you take a stroll through the iRules codeshare, you'll notice several solutions to this problem.  All of them work, with a variety of msorryethods, but user kirkbauer's entry takes it to another level.  Kirk's sorry page irule generator (written in perl) takes all the guess work out of the process for you.  Dump the perl script in /var/tmp, give execute permissions to root, and off you go.  Here's a sample configuration, just taking Google's main page:

[[email protected]:Active] mibs # /var/tmp/sorrygen.pl

Welcome to the F5 Sorry Page iRule Generator

This script will create a sorry page iRule based on an arbitrary web page.

This script can download the sorry page from the specified URL (you may need to use an IP address instead of a hostname if you don't have DNS set up) or it can convert a page (and all includes) already in a local directory.

Enter the prefix pathname (such as 'sorrypage') for a directory that doesn't exist in your app (do not include any slashes):
sorrypage

Please provide the URL (starting with http://) or local directory with the sorry page:
http://www.google.com
Downloading http://www.google.com/
Downloading http://www.google.com//intl/en_ALL/images/logo.gif
Checking included object /index.html: is text.
Checking included object /sorrypage/intl/en_ALL/images/logo.gif: is an image.

Done.
Completed files can be found in /tmp/irulegen-18583/output/.

Do you want to deploy this iRule and associated data groups now?[Y/n]:
Y

The following partitions were found: Common ops1 ops2

Which partition do you want to install this in?:
ops2

** Backing up /config/bigip.conf as /config/bigip.conf.bak
Saving current config.
/config/bigip.conf was renamed to /config/bigip.conf.bak (492 lines).
/config/bigip_local.conf was renamed to /config/bigip_local.conf.bak (3 lines).
/config/bigip_sys.conf was renamed to /config/bigip_sys.conf.bak (32 lines).
Modified bigip.conf
Placed /var/class/sorrypage.index.html.class
Placed /var/class/sorrypage.intl.en_ALL.images.logo.gif.class
Loading new config.
Reading configuration from /defaults/config_base.conf.
Reading configuration from /config/bigip_base.conf.
Reading configuration from /config/bigip_sys.conf.
Reading configuration from /usr/bin/monitors/builtins/base_monitors.conf.
Reading configuration from /config/profile_base.conf.
Reading configuration from /config/daemon.conf.
Reading configuration from /config/bigip.conf.
Reading configuration from /config/bigip_local.conf.
Loading the configuration ...

Rule should be ready to go -- just apply the iRule 'sorry_page_sorrypage' to one or more virtual servers.

Pretty easy, right?  I allowed the script to deploy--here's the iRule:

Sorry Page iRule

rule sorry_page_sorrypage {
   # Auto-generated by sorry_irule.pl
  when HTTP_REQUEST {
    #
    # Service requests for files (URIs) from the maintenance page
    # Note that we always service these pages, even if the http_pool is up
    #
    set uri [HTTP::uri]
    if { $uri equals "/sorrypage" } {
       HTTP::respond 301 "Location" "/sorrypage/"
       return
    }
    if { $uri starts_with "/sorrypage/" } {
       # trim off the maintenance prefix
       set uri [string range $uri 10 end]

       # Return the requested page
       switch $uri {
         "/"              -
         "/index.html"   { HTTP::respond 200 content [lindex $::sorrypage_index_html 0] "Content-Type" "text/html" }
         "/intl/en_ALL/images/logo.gif"   { HTTP::respond 200 content \
		 [b64decode [lindex $::sorrypage_intl_en_ALL_images_logo_gif 0]] "Content-Type" "image/gif" }
         default         { HTTP::respond 404 }
       }
       return
    }

    #
    # If the http_pool is down, redirect to the maintenance page
    #
    if { [active_members [LB::server pool]] < 1 } {
      HTTP::redirect "/sorrypage/index.html"
      return
    }
  }
   partition ops2
}

 

Definitely the way to go if you plan on hosting your sorry page on the BIG-IPClick here for the code.

 

Follow me on Twitter Follow me on LinkedIn Follow me on Facebook Add to Technorati Favorites

 

Read the original blog entry...

More Stories By Jason Rahm

Experienced predominantly in the networking realm over the last dozen or so years, Jason is expanding his horizons towards systems management and even trying his hand at python.

Jason assists in the maintenance duties for http://devcentral.f5.com, contributes frequently in the forums, and writes weekly on some cool geekery in the F5 product lines. When not working, Jason enjoys spending time with his beautiful wife Michelle and his four children. He is active and volunteers network administration duties at his church and if there are any remaining minutes in the week, he enjoys Wii & XBOX, tennis, racquetball, softball, etc. He does not enjoy running, but does (scratch that, thinks about doing) it anyway to recover his youthful appearance.

@ThingsExpo Stories
SYS-CON Events announced today that Peak 10, Inc., a national IT infrastructure and cloud services provider, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Peak 10 provides reliable, tailored data center and network services, cloud and managed services. Its solutions are designed to scale and adapt to customers’ changing business needs, enabling them to lower costs, improve performance and focus intern...
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
Everywhere we turn in our industry we can find strong opinions about the direction, type and nature of cloud’s impact on computing and business. Another word that is used in every context in our industry is “hybrid.” In his session at 20th Cloud Expo, Alvaro Gonzalez, Director of Technical, Partner and Field Marketing at Peak 10, will use a combination of a few conceptual props and some research recently commissioned by Peak 10 to offer a real-world consideration of how the various categories of...
In order to meet the rapidly changing demands of today’s customers, companies are continually forced to redefine their business strategies in order to meet these needs, stay relevant and continue to see profitable growth. IoT deployment and development is integral in this transformation, and today businesses are increasingly seeing the value of investing their resources into IoT deployments. These technologies are able increase ROI through projects such as connecting supply chains or enabling sm...
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will look at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deli...
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Five years ago development was seen as a dead-end career, now it’s anything but – with an explosion in mobile and IoT initiatives increasing the demand for skilled engineers. But apart from having a ready supply of great coders, what constitutes true ‘DevOps Royalty’? It’ll be the ability to craft resilient architectures, supportability, security everywhere across the software lifecycle. In his keynote at @DevOpsSummit at 20th Cloud Expo, Jeffrey Scheaffer, GM and SVP, Continuous Delivery Busine...
SYS-CON Events announced today that delaPlex will exhibit at SYS-CON's @CloudExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
SYS-CON Events announced today that delaPlex will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assis...
SYS-CON Events announced today that Carbonite will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Carbonite protects your entire IT footprint with the right level of protection for each workload, ensuring lower costs and dependable solutions with DoubleTake and Evault.
SYS-CON Events announced today that EARP Integration will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. EARP Integration is a passionate software house. Since its inception in 2009 the company successfully delivers smart solutions for cities and factories that start their digital transformation. EARP provides bespoke solutions like, for example, advanced enterprise portals, business intelligence systems an...
Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
SYS-CON Events announced today that Outscale will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Outscale's technology makes an automated and adaptable Cloud available to businesses, supporting them in the most complex IT projects while controlling their operational aspects. You boost your IT infrastructure's reactivity, with request responses that only take a few seconds.
SYS-CON Events announced today that Progress, a global leader in application development, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Enterprises today are rapidly adopting the cloud, while continuing to retain business-critical/sensitive data inside the firewall. This is creating two separate data silos – one inside the firewall and the other outside the firewall. Cloud ISVs oft...
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...
In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, will motivate why realizing the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insigh...
As cloud adoption continues to transform business, today's global enterprises are challenged with managing a growing amount of information living outside of the data center. The rapid adoption of IoT and increasingly mobile workforce are exacerbating the problem. Ensuring secure data sharing and efficient backup poses capacity and bandwidth considerations as well as policy and regulatory compliance issues.