WebInject Code Example

Here is an example of XML code for WebInject that will perform several basic checks on a web application node.

Note: To learn more about monitoring, be sure to read: Monitoring Your Jive Environment.
This script is designed to perform the following checks on a web application node: In addition, consider monitoring the time it takes this check to run and set an alert threshold at N seconds to ensure this check succeeds in a timely manner.
<testcases repeat="1">
<testvar varname="BASEURL">http://my-jive-instance.my-domain.com:80</testvar>
<testvar varname="LOGIN">admin</testvar>
<testvar varname="PASSWORD">admin-password\</testvar>

<case
   id="1"
   description1="Hit main page"
   description2="Verify 'SBS' exists on page"
   method="get"
   url="${BASEURL}/admin/login.jsp?url=main.jsp"
   verifypositive="SBS"
/> 

<case
   id="2"
   description1="Log in as admin user"
   description2="Follow redirect"
   method="post"
   url="${BASEURL}/admin/admin_login"
   postbody="url=main.jsp&login=false&username=${LOGIN}&password=${PASSWORD}"
   verifyresponsecode="302"
   parseresponse="Location:|\n"
/>

<case
   id="3"
   description1="Get main.jsp"
   description2="Check for 'System'"
   method="get"
   url="{PARSEDRESULT}"
   verifypositive="System"
/>

<case
   id="4"
   description1="Get index.jspa"
   description2="Check for 'Welcome'"
   method="get"
   url="${BASEURL}/index.jspa"
   verifypositive="Welcome|Location: ${BASEURL}/wizard-step\!input.jspa|Location: .*/terms-and-conditions\!input.jspa"
/>

</testcases>