GROUNDWORK MONITOR OVERVIEW (Monarch 0.94b Beta)

Contents

A. Program Description

       Prerequisites
       Minimum Requirements
       Product Objectives
       Product Support
       Notes

B. Monarch Overview

       Setup Procedures
       Architectural View of Monarch
       Structure of Monarch Concepts
       Monarch User Interface

C. Monarch How To's

  1. How Do I Import An Existing Nagios Configuration?
  2. How Do I Create A New Host?
  3. How Do I Create A New Service?
  4. How Do I Add Services To A Host?
  5. How Do I Create A Service Profile?
  6. How Do I Create A Host Profile?
  7. How Do I Setup Dependencies?
  8. How Do I Setup Notifications
  9. How Do I Setup Escalations?
  10. How Do I Run Commit/Pre Flight?

A. PROGRAM DESCRIPTION

The GroundWork Monitor Architect (Monarch) is a program for use in the deployment of the Nagios network monitoring component of GroundWork monitoring. The Monarch web interface consists of a set of tools that allow a user to easily configure and maintain the GroundWork Monitoring System. A user can apply templates to the input to generate a set of Nagios configuration files and add or delete configuration options direct from this web interface.

GroundWork Monitor Architect is a component of GroundWork Monitor, GroundWork's open source IT infrastructure monitoring solution. GroundWork Monitor delivers enterprise-class availability and performance for a fraction of the cost of commercial alternatives.
For more information about GroundWork Monitor, please visit http://www.itgroundwork.com/.

Prerequisites

  GroundWork Monitor 3.x or higher,
  Or pre-installed software
    - Nagios 1.2 (Nagios 2.0 supported in future version)
    - MySQL 4.1
    - Perl Modules:
      XML-LibXML-Common-0.13
      XML-NamespaceSupport-1.08
      XML-SAX-0.12
      XML-LibXML-1.58
      CGI.pm-3.07
      DBI-1.48
      DBD-mysql-2.9005
      File::Copy

Minimum Requirements

  Basic set of Nagios files to include:
    - nagios.cfg
    - cgi.cfg
    - resource.cfg

Product Objectives

  Utilize a template oriented configuration thorough extensive use of templates.
  Provide a tool to allow users to easily create and modify GroundWork Monitor/Nagios configuration files.
  Enable all functions accessible via a web browser interface.
  Support most GroundWork Monitor/Nagios configuration options.

Product Support

Monarch was written by Scott Parris of GroundWork Open Source Solutions.
For product support, please email us at: monarch@itgroundwork.com

Notes

  Information on directives outside the scope of this document can be found in the Nagios Documentation.
  To print this document select the Print option in the upper right hand corner using Landscape orientation.

B. MONARCH OVERVIEW

Setup Procedures

  1. Create the database.
  2. Run monarch_setup.pl.
  3. Make sure your web server User is a member of the Nagios Group.
  4. Nagios cfgs need read/write permissions for Groups.
  5. In your browser enter: http://<hostname|address>/cgi-bin/monarch.cgi
  6. Login - User ID: super_user  Password: password
  7. Go to Control>Setup to set the nagios.cfg folder.
  8. Go to Control>Load to load an existing database.

Architectural View of Monarch

Monarch is a set of .cgi scripts written in Perl. The three major functions of Monarch are:

Design which lets you create the configuration files. If you are starting from scratch and in the process of building a new configuration for the GroundWork Monitor you will spend time here creating elements that Monarch uses.

Manage allows you to modify existing configurations.

Control allows you to access administration functions such as managing User IDs. You can control the implementation including the loading of Monarch, running of a Pre Flight Test (a verification of the Nagios configuration) and commit files into your production configuration using the Monarch Commit option.

When you perform a load operation all of the Nagios config files (nagios/etc) get loaded into the MySQL Monarch Database, mirroring your entire configuration in the database. Monarch then operates by manipulating this database.

In addition to the Nagios configuration information there are extra pieces of information that Monarch uses to make modifications, such as; Host and Service Profiles, Escalation Trees, and Monarch Access Rights.

Once finished with modifications you can execute the option of Pre-flight Check which is the equivalent of the nagios -v command that runs the verification. As part of the verification, Monarch will write the updated nagios configuration files into a Workspace Directory. At this point in time your current Nagios configuration has not been affected. You can then use Monarch to create your configuration files and everything will be stored in this Workspace Directory. You can look at the config files and manually manipulate them if you decide to.

Monarch gives you the capability to commit the files into your production configuration if you choose to. Commit will: 1) Take a backup of your old configuration; 2) Put it into a separate backup directory; 3) Copy the updated configuration files back into your production nagios/etc directory; and 4) Perform a nagios restart, so actually implementing.

In summary, Monarch provides you options for controlling your production configuration. If you just want to see the new changes, you can keep the changed files in your Workspace Directory. Alternatively, the Monarch Commit option provides total control and restart your system.

Structure of Monarch Concepts

Hosts and Services

As with Nagios, you can define templates in Monarch. When defining, for example a Host, you would enter the common definitions in a Host Template. To define a specific Host you apply the definition using a Template. This is a method that Nagios uses to reduce the number of redundant definitions. You would define Service Templates the same way; you have specific Service Definitions associated with the Service Template. A Host is a combination of multiple Services consisting of Templates and Definitions. This is the basis of Nagios structures.

Service Names

Monarch introduces a concept called a Service Name, which is a combination of a Service Template and a Service Definition. The Service Name is generic which means we have not yet applied this to a specific Host.

Service Profiles

Once you have a Service Name you can define a Service Profile. A Service Profile is a collection of multiple Service Names. Here is an example:

You have a web server which you will want to monitor CPU, memory, disk, http check, and apache processes. You will have 50 of these web servers. Instead of creating 50 definitions you would create a Service Name for each of the Services (CPU, memory, disk). You can then create a Service Profile called web monitoring and include all of the Service Names in the Service Profile.

Host Profiles

Once you have the Service Profile you can combine this with a Host Template and create a Host Profile. These Profiles are not yet defined for a specific Host. Once you have the Host Profile you can apply this combined definition to each of your 50 specific web servers. This concept will allow you to generically define the different roles of the different devices you are monitoring and easily apply them.

Application of Host Profiles

Once the above steps are complete, say you want to change one of the parameters and apply it to all 50 of your web servers. You can make a change to either the Host Profile, the Service Profile, or in the Service Name, depending on the definition. You can make one modification and which will then be applied to all 50 web servers.

Monarch is using an approach that builds on the template concept to make it easier for you to maintain a large infrastructure by minimizing the text files. All changes are applied through the Monarch web interface.

Monarch's User Interface

Upon entering Monarch you will see the Design, Manage, and Control options. Each of the option's elements are listed below (the Overview tab is where you are now).

DESIGN MANAGE CONTROL
The Design tab is used to define various design elements of Monarch including:
The Manage tab is used to modify the various design elements of Monarch including:
The Control tab is the area for Monarch administration setup. Here an authorized user can define/control:
  Time Periods
  Commands
  Templates
  Escalations
  Host Groups
  Profiles
  Hosts
  Parent/Child
  Time Periods
  Commands
  Templates
  Contacts
  Contact Groups
  Host Dependencies
  Escalations
  Host Groups
  Hosts
  Parent/Child
  Export .cfg Files
  Users
  User Groups
  Setup Options
  Resource Values
  File Associations
  Load Nagios records
  Pre Flight/Commit
  Run External Scripts

C. MONARCH HOW TO's

Monarch How To #1
HOW DO I IMPORT AN EXISTING NAGIOS CONFIGURATION?

This How To walks through the steps to import an existing Nagios configuration. It will show you how to drop all Nagios records from Monarch and load the etc/natios/nagios.cfg file.

Step 1 - Verifying Nagios Directory Definitions
  1. Select Control
  2. Select Setup
  3. In the Setup Options screen, verify the nagios.cfg, resource file, and cgi.cfg directories.
    Note: The initial setup script should have entered the appropriate files here for you. You should not have to make changes.
  4. Select Save to save any changes.
Step 2 - Drop All Nagios Records and Load nagios.cfg
  1. Select Control
  2. Select Load
  3. In the Confirm Drop Records screen, answer Yes to the prompted question: Are you sure you want to drop all Nagios records from Monarch and load etc/nagios/nagios.cfg?
  4. The load status will display, select refresh from your browser to update the status. The import is finished when the load status indicates completed, any error messages will be displayed in red.
  5. Select Continue to return to the main screen.

Monarch How To #2
HOW DO I CREATE A NEW HOST IN MONARCH?

This How To will take you through the steps to create a new Host. You will be required to configure a Host Template, if one doesn't exist, before creating a Host. You will then continue through several steps including defining Host Vitals, Host Attributes 1 and 2, and Selecting Host Services.

Verify Prerequisites
  Host Template (required)
  Host Groups (optional)
  Extended Host Info Template (optional)
  Host Escalation Tree (optional)
  Service Escalation Tree (optional)
  Service Profile (optional)

Step 1 - Configure a Host Template
  1. Select Design
  2. Select Host Templates
  3. Select Copy from an existing Host Template or New Host Template
  4. In the Host Template Properties screen, fill in the properties.
  5. Select Add to add the new Host Template.
Step 2 - Create a New Host - Host Vitals
  1. Select Design
  2. Select Hosts
  3. Select New Host Wizard
  4. In the Host Vitals Screen enter a new Host Name
  5. Enter an Alias
  6. Enter an Address
  7. Enter a Host Profile (optional)
  8. Select Next to go to the Host Attributes 1 screen.
Step 3 - Create a New Host - Host Attributes 1
  1. Select a required Host Template
  2. Add to the Host one or more Parents (optional)
  3. Select a Configuration File; This indicates the configuration file where the Host Definition will be stored after executing a Preflight Check or Commit. You might want to store Hosts of different types in different files, i.e. UNIX Hosts in hosts_unix.cfg, network Hosts in hosts_network.cfg, etc.
  4. Select Next to go to the Host Attributes 2 screen.
Step 4 - Create a New Host - Host Attributes 2
  1. Assign this Host one or more Host Groups; This directive is optional but recommended. Note: You will get a warning message during Commit or Preflight Check if a Host is not a member of any Host Group.
  2. Select an Extended Host Info Template (optional)
  3. Enter map coordinates for 2D and 3D Status Map Coordinates (optional)
  4. Select a Host Escalation Tree; This directive is optional. Select if the escalation of Host notifications is required.
  5. Select a Service Escalation Tree (optional)
  6. Select a Service Profile for this Host (optional)
  7. Select Next to go to the Select Host Services screen.
Step 5 - Create a New Host - Select Host Services
Select Host Services allows you to add specific Services to this Host.
  1. Select the Service Configuration file; This is the location where these Service Definitions will be stored. Note: If you selected a Service Profile in the previous page (Host Attributes 2), the Service Names in that Service Profile will show in the form.
  2. Select Add to List to add Services to this Host; Select the Services to remove by selecting the Discard radio button. Select Services to modify by selecting the Modify radio button. If you selected Modify for any Services, a form with the check command and command line for each selected Service will be displayed for modifying. If you need to change any of these definitions, use Manage>Hosts to select and modify the settings.
  3. Select Next to complete the Host Wizard.
  4. In the Completed screen, select Save as Profile to save this new Host as a Host Profile or select Continue to complete the definition of this Host.


Monarch How To #3
HOW DO I CREATE A NEW SERVICE?

This How To will take you though several steps to create a new Service including; Adding a New Command Line, Creating a Service Template, and Creating a Service Name.

Step 1 - Adding a New Command Line
  1. Select Design
  2. Select Commands
  3. Select Copy an Existing Command or New Command;
    Note: If the command you are creating has a format similar to an existing command, or if it will be calling a plugin program with different parameters, the copy option will be easiest to use.
  4. In the Command Properties screen, enter the Name for the command.
  5. Select a command Type.
    For a Host or Service command, select Check.
  6. Enter the Command Line that will be used to execute the plugin program.
    Note: The command line should also match how it will be executed at a command prompt. You may use Nagios macros here. These are substituted by Nagios before the command is executed. Typical macros include: $HOSTADDRESS$ - the Host's IP Address; $USER1$ - the Nagios plugin directory. See the Nagios documentation for the complete list of macros.
  7. Select Add to create the command.
Step 2 - Creating a Service Template
You will want to create a Service Template if you are going to use common attributes for multiple Services.

Verify Prerequisites
  Time Periods for the Check
  Time Periods for the Notification
  Event Handlers
  Check Command
  Contact Groups (required if notifications are specified)

  1. Select Design
  2. Select Service Templates
  3. You have 3 options: Copy from an Existing Service Template and modify its settings; Create a New Service Template from scratch; Use an Existing Service Template which will be a child template of an existing template. The template will use the Nagios use directive for the existing template. These definitions will override the existing template.
  4. In the Service Template Properties screen, enter the parameters.
  5. Select to add the new Service Template.
Step - 3 Creating a Service Name

Verify Prerequisites
  Time Periods for the Check
  Service Template (required)
  Check Command (required unless defined in the template)
  Service Dependency Template
  Extended Info template
  Service Escalation Trees

  1. Select Design
  2. Select Profiles
  3. Select Design/Manage Service Names
  4. Select Add New Service Name
  5. In the Service Name screen, enter the properties.
    Note: If you check the Use Template Command, the Service will use the command in the Service Template. If you change the Command in the Service Template, this will change the Command for Hosts using this Service Name Profile. If you do not check the Use Template Command, the Command Line defined in this Service Name Profile will be used.
  6. Enter the Command Line that will be used to execute the plugin program.
    Note: Macros are used by the command definition. Here you enter $ARGx$ values separated by
    '!' Ex check_disk!75!90 for $ARG1$ $ARG2$
  7. Select Add to add the new Service Name.

Monarch How To #4
HOW DO I ADD SERVICES TO A HOST?

This How To will take you though several steps to add Services to a Host including; Verifying prerequisites, Applying Services to and Existing Host, Changing a Service by Applying a Different Service Profile, and Changing Services by Modifying the Service Definition for this Host.

Verify Prerequisites
  Create Service Name to add

Step 1 - Applying Services

Applying Services to an Existing Host
Note: You can apply or modify Services for a Host while creating a new Host in the Host Wizard.
  1. Select Manage
  2. Select Hosts
  3. Select the option to find the Host:
    Find by IP address: Enter the full or partial IP address
    Find by Host Group: Select a Host Group then a Host Name
    Find by Host Name: Enter the full or partial Host name
Changing a Service by Applying a Different Service Profile
  1. Select Profile
  2. You may either: Select a Host Profile in which the Service Profile associated with that Host Profile will be applied, or select a Service Profile to be applied.
  3. Select Save
    Note: You will then have the option to select Apply Profile to Host which will apply the newly saved Profile to the Host.
Changing Services by Modifying the Service Definition for this Host
  1. Select Services
  2. Choose a Service and select Add Service(s)
    Note: If you have assigned Service Profiles to Hosts, you can add a Service by updating the Service Profile, then applying it to all Hosts.

Monarch How To #5
HOW DO I CREATE A SERVICE PROFILE?

Verify Prerequisites
  Service Names must be defined
  Service files must be defined

Step 1 - Adding a Service Profile
  1. Select Design
  2. Select Profiles
  3. Select Design/Manage Service Profiles
  4. Select Add New Profile
  5. In the Service Profile screen, enter the following:
    Service Profile Name, Description of the Service Profile, and the Services to include using Add and Remove.
  6. Select Add
    Note: To select multiple Services Names, use the CTRL key while selecting; or to select a range, click on the first item, press the SHIFT key and select the last item.
  7. Select the File where these Service Definitions will be saved
  8. Select Add to create the Service Profile

Monarch How To #6
HOW DO I CREATE A HOST PROFILE?

Verify Prerequisites
  Service Profiles (if used)
  Host Files
  Host Templates (applied to this Host Profile)
  Host Groups (applied to this Host Profile)

Step 1 - Naming the Profile
  1. Select Design
  2. Select Profiles
  3. Select Design/Manage Host Profiles
  4. Select Add New Profile
  5. In the Host Profile screen, enter the name of the new Host Profile
  6. Select Add to add the new Host Profile and continue on to the various Host Profile screens.
Step 2 - Defining the Profile
  1. In the Host Profile screen you can define the following information under each of the displayed tabs:
    Profile: Enter the Extended Host Info Template and the Host file to store the configuration statements.
    Template: Select the Host Template to apply.
    Parents: Add the Parent Hosts.
    Host Groups: Add the Host Groups to this Host Profile.
    Escalations: Enter Host or Service Escalation Trees.
    Services: Enter Service Profile for this Host Profile.
  2. Select Save to create the new Host Profile.

Monarch How To #7
HOW DO I SETUP DEPENDENCIES?

Step 1 - Setting Up Host Dependencies
  1. Select Host Dependencies
  2. In the Host Dependency Properties screen, select the Host
  3. Select the Parent for the Host
  4. Select the Notification Failure Criteria
  5. Select Add to create the dependency.
Step 2 - Setting Up Service Dependencies
  1. Select Service Dependency Templates
  2. Select Copy from an existing Service Dependency Template or New Service Dependency Template
  3. In the Service Dependency Properties screen, select the Service Name (the Service Dependency Template)
  4. Select the Execution and Notification Criteria associated with a Service Name
  5. Select Add to save the setup.

Monarch How To #8
HOW DO I SETUP NOTIFICATIONS?

This How To will review the steps to take to setup Service and Host notifications. Since you cannot create a Service Name without specifying a Template the only place you need to go to modifiy a Notification is the Template. A change to the Notification Criteria in a Template will be carried to all Services which use the specific Template. One might also consider using a Parent Template so that these type of changes are propagated to all Templates using the Parent.

Step 1 - Setting Up Service Notifications
Verify Prerequisites
  Time Periods are defined
  Contacts Groups are defined

Modify the Notification parameters in the Service Template
  1. Select Manage
  2. Select Service Templates
  3. Select the Service Template to modify
  4. Enable the Notifications Enabled checkbox
  5. Set the Notification Interval
  6. Select the Notification Period from the defined Time Periods
  7. Check the desired Notification Options (Unreachable, Critical, Warning and Recovery)
  8. Select Contact Groups to be contacted
Step 2 - Setting Up Host Notifications
Verify Prerequisites
  Time Periods are defined
  Contacts Groups are defined

Modify the Notification parameters in the Host Template
  1. Select Manage
  2. Select Host Templates
  3. Select the Host Template to modify
  4. Enable the Notifications Enabled checkbox
  5. Set the Notification Interval
  6. Select the Notification Period from the defined Time Periods
  7. Check the desired Notification Options (Unreachable, Critical, Warning and Recovery)
Define the Contacts in the Host Group for this Host
  1. Select Manage
  2. Select Host Groups
  3. Select Host Group that contains the Host for the Notification
  4. In the Host Group Properties screen, select the Contact Groups to be used for Notifications
  5. Select Save to save the Host Group Definitions

Monarch How To #9
HOW DO I SETUP ESCALATIONS?

Setting Up Service Escalations
Step 1 - Defining the Service Escalation Template
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Service)
  4. Select Next to go to the Service Escalation Properties screen.
  5. Enter a Name for the Escalation.
  6. Select Contact Groups
  7. Assign a First Notification (a number which identifies the first notification for which this escalation is effective).
  8. Assign a Last Notification (a number which identifies the last notification for which this escalation is effective).
  9. Assign a Notification Interval (indicates the interval in which notifications should be made while this escalation is valid).
  10. Select Add to create the escalation.
Step 2 - Defining the Service Escalation Tree
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Service)
  4. Enter a Name for the Escalation.
  5. Select Next to go to the Design Escalation Tree screen.
  6. Add an Escalation Template to this Escalation Tree.
    Note: You can modify the list of Contact Groups associated with the Escalation by selecting the Modify Groups link.
  7. Select Close
Step 3 - Assigning the Service Escalation Tree (to any of the following)
  1. To a Service Name, then a Service Profile or Host Profile, then assign the Profile to Hosts using the Host Wizard or by modifying an existing Host Definition.
    or
  2. To a Host Profile, then assign the Profile to the Hosts using the Host Wizard or by modifying an Existing Host Definition.
    or
  3. To a Host Group.
Setting Up Host Escalations
Step 1 - Defining the Host Escalation Template
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Host)
  4. Select Next to go to the Host Escalation Properties screen.
  5. Enter a Name for the Escalation.
  6. Select Contact Groups
  7. Assign a First Notification (a number which identifies the first notification for which this escalation is effective).
  8. Assign a Last Notification (a number which identifies the last notification for which this escalation is effective).
  9. Assign a Notification Interval (indicates the interval in which notifications should be made while this escalation is valid).
  10. Select Add to create the escalation.
Step 2 - Defining the Host Escalation Tree
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Host)
  4. Enter a Name for the Escalation.
  5. Select Next to go to the Design Escalation Tree screen.
  6. Add an Escalation Template to this Escalation Tree.
    Note: You can modify the list of Contact Groups associated with the Escalation by selecting the Modify Groups link.
  7. Select Close.
Step 3 - Assigning the Host Escalation Tree
  1. Go to the Host Profile, then assign the Tree, then assign the Profile to Hosts using the Host Wizard or by modifying an existing Host Definition.
Setting Up Host Group Escalations
Step 1 - Defining the Host Group Escalation Template
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Host Group)
  4. Select Next to go to the Host Group Escalation Properties screen.
  5. Enter a Name for the Escalation.
  6. Select Contact Groups
  7. Assign a First Notification (a number which identifies the first notification for which this escalation is effective).
  8. Assign a Last Notification (a number which identifies the last notification for which this escalation is effective).
  9. Assign a Notification Interval (indicates the interval in which notifications should be made while this escalation is valid).
  10. Select Add to create the escalation.
Step 2 - Defining the Host Group Escalation Tree
  1. Select Escalations
  2. Select Escalation Template
  3. Select the Escalation Type (Host Group)
  4. Enter a Name for the Escalation.
  5. Select Next to go to the Design Escalation Tree screen.
  6. Add an Escalation Template to this Escalation Tree.
    Note: You can modify the list of Contact Groups associated with the Escalation by selecting the Modify Groups link.
  7. Select Close.

Monarch How To #10
HOW DO I COMMIT AND RUN A PRE FLIGHT TEST?

Step 1 - Running Commit and the Pre Flight Test
  1. Select Control
  2. Select Commit
    Nagios commit results and success notes will be displayed.