Body
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:
- One or more config files that contain the steps necessary for the test
- 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:
- Make an issue/merge request in Git
- Clone puppet repo
- Create a new branch and switch to your branch that you created
- Navigate to /site/profile/files/nagiosxi/webinject
- Move your webinject xml file(s) to the directory
- Commit your changes and push to your branch
- Merge your branch changes to master
- Merge master to test
- 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:
- 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
- Notify Application Operations that you are adding a test — in the event that something goes wrong and your test creates false positives
- Log in to Nagios
- Open the Configure menu
- Go to Core Config Manager (on left)
- 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:
- Click the Add New button
- Enter a Host Name, Description, and Address — either IP or DNS address
- Leave Display Name blank
- On the Check Settings tab, enter Check interval, Retry interval, and Max check attempts to 5, 2 and 5 minutes, respectively
- Select a Check period of 24x7
- Click Save
- Go to Services
- Find the Webinject Template - Sol Del service and click the copy icon under Actions
- On the newly created copy, click on the wrench icon under Actions
- Change the Config Name to the DNS name (hostname) of the app you are testing
- Change the Description to something meaningful, beginning with Webinject
- example, Webinject - <description>
- Change the Display Name to the config name
- Check the Active box
- Change $ARG1$ to the config file name
- Optional: Review the settings on the other tabs
- Click on Manage Hosts
- Locate and click on your host
- Click Add Selected
- Close
- Click Save
- Click Apply Configuration
- If the verification fails, click on Show Error for more information