Support Guide: Nagios / Add a new WebInject Test

Tags Technical

Purpose

  • To provide guidance and instruction on adding a new WebInject Test to Nagios

User

  • Miami University IT Services Sysadmin, Support Analyst, Developer

Environment

  • 10305: Nagios Monitoring Service

Guide

  • Adding a WebInject Test to Nagios requires two pieces:
  1. One or more config files that contain the steps necessary for the test
  2. An entry in Nagios to run to the test

 

Config files

  • Nagios requires one or more config files that contain the steps necessary to perform the test
  • These files are placed on the Nagios server via the Puppet repository
  • Config file naming conventions:
    • There should always be an initial config file that's named {host}_config.xml by convention: example, miamioh_instructure_com_config.xml
    • This config file may import other config files that are generally named {host}_step1.xml{host}_step2.xml, etc. by convention: example, miamioh_instructure_com_step1.xml
    • See the Puppet repository at /site/profile/files/nagiosxi/webinject directory for examples
  • For additional information on Testing Configuration Files locally, see Monitoring Applications using Nagios: https://miamioh.atlassian.net/l/c/uDyhSLT9 

 

Reusable test cases

  • We've started developing frequently used testcases as reusable components
  • Reusable components that currently exist:
    • sso_login_proactnt.xml handles the SSO pieces necessary for most web applications
    • This testcase attempts to log in to the proactnt account within the web application, and manages the usename and password for this account
    • This testcase starts with a request to CAS and makes the following assumptions:
      • The BASEURL tag was defined in your initial config file to contain the root URL for your application
        • e.g., <baseurl>https://miamioh.instructure.com</baseurl>
      • The PARSEDRESULT variable contains the URL to CAS for the web application prior to running this testcase
      • At the end of the testcase, the PARSEDRESULT1 url will contain the URL to connect to your application with a CAS token

 


Move config files to Nagios server

  • Config files are stored on the Nagios server via the Puppet repository
  • To move your files onto the server, follow this procedure:
  1. Make an issue/merge request in Git
  2. Clone puppet repo
  3. Create a new branch and switch to your branch that you created
  4. Navigate to /site/profile/files/nagiosxi/webinject
  5. Move your webinject xml file(s) to the directory
  6. Commit your changes and push to your branch
  7. Merge your branch changes to master
  8. Merge master to test
  9. Merge test to prod

Note: Pushes to production are performed roughly every week. To ensure that your configuration files have made it onto the Nagios server, either wait a week or contact someone in EO to push to production before going to GUI step

 

Create a test entry in Nagios 

  • In order to have the tests run within Nagios, you must create an entry in Nagios for your test
  • To create your test entry in Nagios, follow this procedure:
  1. Make sure that your config files are in place on the server
    • If not, your tests will generate errors that will alert Application Operations and others
  2. Notify Application Operations that you are adding a test — in the event that something goes wrong and your test creates false positives
  3. Log in to Nagios
  4. Open the Configure menu
  5. Go to Core Config Manager (on left)
  6. Go to Hosts and search for an entry for your host — if your host exists, go to step 7
    • If no host exists, create one:
    1. Click the Add New button 
    2. Enter a Host Name, Description, and Address — either IP or DNS address
    3. Leave Display Name blank
    4. On the Check Settings tab, enter Check interval, Retry interval, and Max check attempts to 5, 2 and 5 minutes, respectively
    5. Select a Check period of 24x7
    6. Click Save
  7. Go to Services
  8. Find the Webinject Template - Sol Del service and click the  copy icon under Actions
  9. On the newly created copy, click on the  wrench icon under Actions
  10. Change the Config Name to the DNS name (hostname) of the app you are testing
  11. Change the Description to something meaningful, beginning with Webinject
    • example, Webinject - <description> 
  12. Change the Display Name to the config name
  13. Check the Active box
  14. Change $ARG1$ to the config file name
  15. Optional: Review the settings on the other tabs
  16. Click on Manage Hosts
    1. Locate and click on your host
    2. Click Add Selected
    3. Close
  17. Click Save
  18. Click Apply Configuration
  19. If the verification fails, click on Show Error for more information