skip to main content

Monitoring objects configuration

Monitoring objects configuration
About Monitoring objects configuration
This chapter covers the following topics:
Introduction
There are two ways of changing the configuration of the op5 Monitor:
*
*
Using the web UI op5 Monitor configuration tool.
In this chapter we will take a look at how the op5 Monitor Configuration tool, from now on called only Configure, is used.
Workflow
All configuration in op5 Monitor is saved in configuration files (text files) in /opt/monitor/etc/. The Configure works with a database and this makes it possible to do any changes in the configuration without saving it before you are satisfied.
The table below describes the workflow.
 
Save the changes to the Configure database by clicking Submit on the object you just added/changed.
When you are done with editing the configuration save the Configure database to the configuration files by clicking Save.
The basics
In The basics section we will take a look at the basic step you need to know about when working with Configure.
Start working
There are many ways to jump in to Configure and start working with the configuration of op5 Monitor.
To start working in Configure
Click Configure in the main menu
This will take you to the main menu of Configure.
or
Click the Configure icon on any object in the monitoring part of op5 Monitor
This will take you directly to the configuration part for the object you clicked on.
 
Submitting changes
When you have made any changes to an object you have to submit it to the Configure database.
To submit the new configuration to the database
Click Submit at the bottom of the page
As soon as the data has been saved you will get the following warning telling you there is unsaved data in the Configure database.
Continue work until your work is done for this time.
Save the changes
When you have finished working and consider your new configuration is ready to be used by op5 monitor you need to save the changes in the Configure database to the configuration files.
This will also make op5 Monitor start using the new configuration.
To save the changes and reload op5 Monitor
Click save icon at the top of the page.
Before the configuration is saved to disk, you have the opportunity to review the changes.
To view what changes that will be written to disk click on More info.
If you are another users is doing changes on the same objects that you have access to you will save the other users changes as well. The other users changes will be shown under ‘More info’ as well.
In the screenshot below you will see an example where we created a new host group and jsmith at the same time added a new host.
When done click Yes, save to write all the changes to disk.
Now the preflight check is preformed and the data is saved to the configuration files.
 
Note: if two users with the same permissions are editing the same host all configuration regarding the host or service will be saved.
Undo changes
Sometimes it might be handy to reset the configuration to the state it was in where you started to work in Configure. The only thing you have to do then is to undo your changes.
 
To undo the configuration changes.
Click undo icon at the top of the Configure page.
This will revert the your changes since the last successful preflight check.
To undo all users changes click on complete reimport. This will re-read the configuration files and all changes will be reverted. If any changes were made directly into the configurations files these changes will now be loaded in to the web configuration
 
Historical Configuration Changes
Historical configuration changes can be used to track changes in the configuration. In the log you will find all changes in the configuration on objects that you have access to.
To access the historical configuration changes log, go to Configure and click on the Historical configuration changes icon in the upper right corner.
Limited users will only see changes that are made to the hosts and services they are contacts for.
Full access users will see all changes.
 
Main objects
The configuration is based on objects. There are several types of objects, each one defining different things in the monitoring process.
Each object consists of a object name and a couple of variables that needs to be configured.
For example on a host object you configure
*
*
*
*
*
In Configure you can
*
*
*
A lot of objects can be cross referenced in the configuration and Configure helps you with this to.
In most of the listings you will find a small text field called Filter by regular expression. Use this to filter out the content you are interested in when viewing the different lists.
Required directives
All objects have a list of directives that are required when adding a new object. The other directives can be left out. They will then get the op5 Monitor defaults value.
This does not mean you have to set every directive for every object. One solution is called templates. They make it a lot easier to manage a large set of objects. Read more about templates in Using templates on page 45.
Hosts
Hosts are one of the central objects in the monitoring logic. Important attributes of hosts are as follows:
*
Hosts are usually physical or virtual devices on your network (servers, workstations, routers, switches, printers, etc) but it could be practically anything you can reach and monitor from the op5 Monitor server.
*
*
Hosts does not need a service directly associated to them, the services can be inherited from a hostgroup. A host can also exist without services.
*
Hosts can have parent/child relationships with other hosts, often representing real-world network connections, which is used in the network reachability logic.
Required directives
The following directives are required for a host object.
*
*
*
*
*
*
*
*
*
The table below describes the required directives for the host object
 
This is the id of the object. I may not contain any space in the value.
The address the host is reached by, preferably an IP address to make sure the host is reachable even if the DNS is down.
Is used to define the number of times op5 Monitor will retry checking the host if it returns any kind of problem state. Setting this value to 1 will cause op5 Monitor alert directly without any retry.
During this period the host is checked. It can be any time period defined in op5 Monitor.
Single contacts used to send notifications to and gives access to this host for users who do not have access to all hosts.
Contact groups used to send notifications to and gives access to this host for users who do not have access to all hosts.
Number of minutes between renotifications. Set this to 0 if you only want to have one notification sent out.
During this period the notifications are sent out if any alerts are created. It can be any time period defined in op5 Monitor.
Services
A service can be practically any thing that you can measure and monitor on a host. It is almost only your imagination and programming skills that sets the limit for what you can monitor with a service.
A service
*
*
*
use a check command (Commands on page 40) to communicate with the plugin (Plugins on page 40) that gets all the data.
Required directives
The following directives are required for a service object.
*
*
*
*
*
*
*
*
*
*
*
The table below describes the required directives for the host object
This is the id of the object. It must be unique on a host but may be reused on other hosts.
command object
This is the short name of the command that is executed during service checks.
Is used to define the number of times op5 Monitor will retry checking the host if it returns any kind of problem state. Setting this value to 1 will cause op5 Monitor alert directly without any retry.
The number of minutes between normal service checks.
The number of minutes between retry checks when a service has gone into a problem state before the state becomes hard.
During this period the service is checked. It can be any time period defined in op5 Monitor.
Single contacts used to send notifications to and gives access to this host for users who do not have access to all hosts.
Contact groups used to send notifications to and gives access to this host for users who do not have access to all hosts.
Number of minutes between renotifications. Set this to 0 if you only want to have one notification sent out.
During this period the notifications are sent out if any alerts are created. It can be any time period defined in op5 Monitor.
 
Contacts
A contact is used for two purposes:
*
*
A contact is not the same as the login account given access rights to the system.
Required directives
The following directives are required for a service object.
*
*
*
*
*
*
*
*
*
The table below describes the required directives for the host object
Used to determine whether or not the contact will receive notifications about host problems and recoveries.
Used to determine whether or not the contact will receive notifications about service problems and recoveries.
The time period when the contact will receive any host notifications.
The time period when the contact will receive any service notifications.
Down, Unreachable, Recovery, Flapping start and stop, Scheduled downtime start and stop
Used to set what type of host notifications the contact shall receive.
Critical, Warning, Unknown, Recovery, Flapping start and stop, Scheduled downtime start and stop
Used to set what type of service notifications the contact shall receive.
command object
command object
The command used to send the service notifications.
During this period the notifications are sent out if any alerts are created. It can be any time period defined in op5 Monitor.
 
Access rights
Access rights is actually user accounts that makes it possible to login to the op5 Monitor GUI.
The access rights does not have any thing to do with notifications or the permissions of viewing objects in op5 Monitor.
Access rights can be connected to a contact by giving the username the same name as the id (contact_name) of a contact.
A access right can also be created by checking the box “Configure access rights for this contact” when creating a contact.
Required directives
The following directives are required for a access rights object.
*
*
The table below describes the required directives for the host object.
The username is the id of the access rights and also used as login username.
Access rights in detail
The table below gives you a description of the settings of an access right object.
 
Gives the user access to issuing commands in the web gui. With commands you can control certain functions in op5 Monitor, for example: enable/disable notifications, scheduled downtime, acknowledge problems etc.
Gives the user access to view all services, se Customizing views below for more information.
Gives the user access to view all hosts, se Customizing views below for more information.
Gives the user access to issue commands for all services, se Customizing views below for more information.
Gives the user access to issue commands for all hosts, se Customizing views below for more information.
Recommended settings
Recommended settings for
*
*
*-
*-
Admin Roles
Admin roles make it possible to create a role with more fine-grained permissions than with Access Rights
 
When combining several different permissions, the role's members will only get access to the objects that are allowed according to all of the permissions.
If at least one permission is selected, and none of the permissions is either "Allow all" or "Disallow all", then an "Allow all" will be implied. That is, if you choose only "Disallow creating new objects", that gives the role permission to edit all existing objects.
Leaving a permission empty means it will fall back to the permission in the "default" role, and that grants full access.
The option "Only contacts can access" roughly means that whatever is visible in op5 Monitor will be visible in the configuration.
A role can be used to limit access to the following configuration objects.
These permissions have no effect if a user is ‘authorized_for_all_hosts’ under Access Rights.
Admin Role Example
In this example we will create a user that has the ability to see all hosts in the assigned hostgroup, and can edit services in this hostgroup, in this case Mysql-srv1.
Prerequisites:
You have a contact that we call jsmith that is member of contact group "Database"
that is assigned to a number of hosts in a hostgroup.
1
 
 
2
This contact has the access rights: authorized_for_system_information, authorized_for_configuration_information and authorized_for_system_commands.

3
Click Submit button
4
Then go to Configure
5
Click Admin roles
Fill out the configuration options in all fields.
Note: If you leave a field empty, "Full Access" will be implied.
 
When combining several different permissions, the role's members will only get access to the objects that are allowed according to all of the permissions.
If at least one permission is selected, and none of the permissions is either "Allow all" or "Disallow all", then an "Allow all" will be implied.
That is, if you choose only "Disallow creating new objects", that gives the role permission to edit all existing objects.
Leaving a permission empty means it will fall back to the permission in the "default" role.
"Only contacts can access" roughly means that whatever is visible in Ninja will be visible here.
These permissions have no effect if a user is authorized_for_all_hosts in "Access Rights".
Example
In this case we will create a role called DB-Admin that only will have access to the hostgroup "Databases".
This role can edit services on hosts in this hostgroup, add new services to the hosts in this hostgroup and create and edit services, but not create new hosts or se other hosts than “jsmith” is assigned to.
Select the following options:
Then you logout as admin and login with the user "jsmith".
Now "jsmith" can only access his hostgroup and change the services associated in the hostgroup "Databases".
Time periods
Time periods is time defining objects that span over a week. You can define included time for each day of the week in the time period definition.
You can also:
*
*
The time period objects are used at many places in the configuration. Most noticeably are in the contact objects where the time periods defines when notifications should be sent out.
You can also use time periods to define when a service or a host should be monitored or when you are creating availability reports.
A time period in detail
The following tables describes the directives of a time period and how to use them.
The table below describes the first part of directives of a time period.
which time to include for each day. you can define multiple times by separating them with comma. Example 00:00-01:00,03:00-06:00
Depending on what kind of exception type you have chosen you will get different settings choices. The two lists below describes them all.
The table below describes the exception part of a time period.
Other predefined time period definitions that should be excluded from this time period.
The table below describes exception by Date:
How often the exception is repeated. Valid values are positive integers greater than one. E.g:
*
Date range "2008-01-01 - 2008-12-31 / 5" means every fifth day of 2008.
*
Day range "1 monday march - 3 sunday may / 3" means every third day between the first monday and the third sunday every month.
*
Date range "2008-06-01 / 14" means every 14th day from first of june 2008. Note that this exception has no end.
Which time to include for this exception. You can define multiple times by separating them with comma. Example:
The table below describes exception by Day:
How often the exception is repeated. Valid values are positive integers greater than one. E.g:
*
Date range "2008-01-01 - 2008-12-31 / 5" means every fifth day of 2008.
*
Day range "1 monday march - 3 sunday may / 3" means every third day between the first monday and the third sunday every month.
*
Date range "2008-06-01 / 14" means every 14th day from first of june 2008. Note that this exception has no end.
Which time to include for this exception. You can define multiple times by separating them with comma.
Commands
A command is exactly what it sounds like. It can use macros and arguments. Mostly they are used with services but they can actually be used as
*
*
*
*
Directives
A command has got only two directives
*
*
 
is the actual command line used by the services, notifications, event handlers and obsession.
 
Plugins
Plugins are compiled executable or scripts that can be run from a command line to check the status or a host or service.
There are many plugins included in the op5 Monitor software. A list of the plugins can be found in the list-of-plugins at the support section at www.op5.com.
If you are looking for a plugin not found in op5 Monitor by default there are a bunch of other places to look
*
*
*
You can use any plugin written for Nagios but you might need to modify them a bit before they work in the op5 Monitor environment.
Groups
The groups in op5 Monitor is used to group objects of the same type. There are three types of groups in op5 Monitor
*
*
*
They are all good to use to get things a bit more organized and they have also special functions op5 Monitor.
The following subsections will give you a brief description about how they can be used.
 
You may not have any empty groups in op5 Monitor so when you create a new group, no matter what type it is, you should have at least one object to add to the group.
Host groups
Host groups can be used group hosts together in any way you like.
*
*
There are a few host groups included in the initial setup of op5 Monitor but you can create your own matching your own needs.
There are a infinite ways of using host groups and here are a couple of examples.
Grouping hosts by
*
*
*
*
*
The list can be long.
Services on Host groups
A host group can contain service checks. These service checks will be inherited on all hosts connected to the host group.
A service on a host group work in the same way as a service for a host.
To add a service to a host group go to ‘Configure’ and ‘Host Groups’. Choose the host group you want to add services to then select ‘Services for hostgroup’
For example a windows servers host group could contain the checks that are common for all windows servers. By doing this you will only need to change command arguments on the service in the host group instead of changing the arguments on all windows host.
If you add new checks to the service group all hosts in the host group will get the new service once you save your configuration.
If a host group service and a host service should get the same name, the host group service will be used, the host service will still be visible in the configuration and if the host is lifted out from the host group the host service will become active.
Nested host groups
Host groups can be connected to each other.
When nesting host groups together the services on host groups also will inherited to the nested host group. This only work one way.
For example:
Host group A has service X and host 1 is a member of host group A
Host group B has service Y and host 2 is a member of host group B
If host group B is added as a member of host group A then host 1 will get service Y but host 2 will not get service X.
A good way to use this feature is to have i.e a Windows host group and then a MSSQL host group. When adding the Windows host group as a member to the MSSQL host group the hosts added to MSSQL will get both the service checks that are standard for all Windows host and the default MSSQL service checks.
Service groups
The service groups are used to group services together in the same way as for host groups. On the other hand there is almost no useful at all to for example group service groups by geographic placements.
One good way to use service groups is to create groups containing services needed for a service you deliver to your customers.
Example 1
Let us take a simplified email service and show how the service groups can be used.
To be able to deliver an email service to our customers the following services need to be working:
*
*
*
*
*
We take al those services and place them in a service group called Customer email.
If we get a problem with any of the services in the Customer email group we can easily see that the whole email service has got a problem.
 
The service group in the example above is perfect to use in Service Level Agreement reports (SLA in the op5 Monitor user manual) to make sure we deliver the service as we promised.
Contact groups
Contact groups are mainly used to setup where to send service and host notifications. It can also be used to setup permissions about who should be able to see what object in the op5 Monitor GUI.
The members of a contact group associated with a certain host and/or service are the one that will get all notifications for that object.
A Contact group can be populated with a contact or another contact group.
Permission to host and services
If a user does not has the access rights to see all hosts that user need to have a contact connected to the contact group associated with the host or service the user should be able to see.
Show partial hostgroups
If an unprivileged user is not a contact for all hosts in a hostgroup, he will not be able to see the host group in the "Hostgroup summary/overview/grid" views.
To enable viewing of partial host group edit follow these steps logged in as root:
1
2
<?php defined('SYSPATH') OR die('No direct access allowed.');
$config['see_partial_hostgroups'] = true;
3
Using templates
Even though Configure makes it easy for you to add and change the configuration of op5 Monitor it is still a lot of things to edit and tweak. To make the software even more easy to use templates have been built in.
There are three types of templates to use:
*
*
*
op5 Monitor comes with a couple of predefined templates for each object type described above. They are just there to be examples and you should really create your own.
How they work
*
Any directive set in a template will be used in the objects using the template. But if you set a directive explicit on an object that value will override the templates.
*
*
If you change any value on a directive in a template it will only be valid on the objects where the same directive is not set explicit.
Managing objects
Now let us be a bit more hands on. In this section we will take a look at how to add/edit/delete objects using the Configure.
There are sometimes many ways to do things in op5 Monitor but we will only show a few examples.
In the subsections to Managing objects we will assume that you start from the main page of Configure.
Before you start
Add new
Every time you comes to a page where you can handle an object you will have the Add new... dialog ready for you to add a new object.
Configuration files
Every object is placed in a configuration file. You may change what file the object is placed in at the bottom of every configuration page. This is normally not necessary and only used in special cases.
Help
In the guides we will only describe the directive that are differ from the default value. Click the help icon
Templates
Because handling templates is the same for all kind of templates, only the directives differ, we will only add a template in Contacts on page 47.
Contacts
Adding a contact template
Before we start to add any new contacts we will create a contact template to use with the contact in the next section. In this guide we only describes the directive we will not use the default value in.
To add a contact template
1
Click Templates on the main page.
2
Click Contact templates.
3
4
Change can_submit_commands to yes. 1
5
Click Submit.
6
Click Save.
Adding a contact
To add a contact
1
Click Contacts on the main page.
2
3
4
5
6
Click Submit.
7
8
9
Modify a contact
To modify a contact
1
Click Contacts on the main page.
2
3
4
In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
5
6
Click Save.
Delete a contact
1
Click Contacts on the main page.
2
3
4
Click Delete.
5
Click Save.
Hosts
There are many ways to add a host. A host can be added by
*
the new host wizard
*
a network scan
*
*
In this guide we only describes the directive we will not use the default value in.
Adding a host with new host wizard
To add a new host using the new host wizard - Part 1
1
Click New host on the main page.
2
3
4
5
We assume this is a Microsoft windows server and that NSClient++ has been installed. Check for the following service checks.
When using WMI a administrators account must be selected. It is also possible to create a user with less privileges, see how-to’s on www.op5.com
6
Click host logo to set the icon that will be displayed for this host in lists and maps.
A list looking like this will be displayed. Click the icon you like to use.
7
Click Scan hosts for services.
To add a new host using the new host wizard - Part 2
1
Leave the initial settings 2 as it is and scroll down to the services.
2
The scan has found out that NSClient++ is installed plus two other services that can be added to this host. Check Select All to add all services found or select the one you like to add for this host.
3
Click Continue to step 3.
4
Adding hosts with network scan
Network ranges can be specified in a very free form. Each of the four parts of the IP-address may contain any combination of comma-separated numbers, 'from-to' ranges and single numbers, as such: 10.1,2.0,4-10.1-50.
You can specify multiple ranges, separated by spaces, if you like.
To add hosts with network scan
1
Click New host on the main page.
2
Click Network scan.
3
4
Click Scan Ranges.
5
6
Repeat To add a new host using the new host wizard - Part 1 on page 49 for each host, except for the last step. If here is one or more host you do not like to add choose No in Add this host?
When you are finished click Scan hosts for services.
7
Repeat To add a new host using the new host wizard - Part 2 on page 50 for each host, except for the last step.
When you are finished click Continue to step 3
8
Click Save.
Modifying a host
To modify a host
1
2
3
In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
4
5
Click Save.
 
Deleting a host
To modify a host
1
2
3
Click Delete.
4
Click Delete all affected objects.
5
Click Save.
Renaming a host
When renaming a host in the web GUI it will only rename the host and will not rename the host name.
To rename the host name in log-files as well a script has to be run manually. The script will rename the host in log-files. If this is not done the host will lose all it’s alert history.
To run the script logon to the op5 monitor via SSH as root user and execute the following command:
# mon stop; /opt/monitor/op5/merlin/rename --rename-all; mon start
If there is a lot of history this script can take a while to execute and during this time the op5 monitor service will not be running.
Note that this does not yet work on schedule downtime objects. If a host is renamed that has a scheduled downtime the scheduled downtime will be lost.
Network autoscan
It might get handy to let op5 Monitor scan and notify you if there are any new hosts on a particular network range.
The network autoscan function will
*
*
*
 
Adding a new autoscan configuration
You may add as many autoscan configuration as you wish. When adding a your network range you may use the same syntax as when you manually scans a network from the Add new host wizard.
To add a new autoscan configuration
1
Click Configure in the main menu.
2
Click Network Autoscan.
3
Fill in the New scan form
*
Name: The identifier of this autoscan configuration
*
IP Range: In this case a complete C net.
*
*
Activate: Make this autoscan configuration active and in use.
4
Click Save.
Adding a host to blacklist
In certain ranges you are scanning with the network autoscan there might be hosts you do not want to include in the result. Then you should add that host or hosts to the blacklist.
To add a host to the blacklist
1
Click Configure in the main menu.
2
Click Network Autoscan.
3
4
Click Add.
The result
After the networks scan has been executed a small result will be shown in the upper left corner of the op5 Monitor GUI
To add the hosts that has been found you only need to click on the text to the right of the icon. You will then come to the Add new host wizard the same as when you have done a manual network scan.
Services
 
Services can be added in a few different ways in Configure. You may add a service by using
*
*
*
*
*
We will take a look at the add service for this host.
In this guide we only describes the directive we will not use the default value in.
The default service template will used.
Adding a service
To add a service using add service for this host
1
2
3
Click Services for host....
The add new service pages is shown.
4
5
We will use the check_nt_cpuload command for this service.
Type in as many chars you need in the filter by regular expression field until the command shows up.
6
Click Syntax help to see what arguments are needed for this command.
You can see that we have a macro called $ARG1$. This is the first, and in this case the only, argument we need to give to this command.
7
Click Syntax help again to hide the help text.
8
9
Click Submit.
10
Click Save.
Modifying a service
To modify a service
1
2
3
Click Services for host ... .
4
5
6
In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
7
8
Click Save.
Test this service
Test this service makes it possible for you to test the service you added or modified before you save the new configuration and reload monitor. This is a nice way to make sure the service works as it is supposed to.
In the guide below we will work with the service created in Adding a service on page 56.
To test a service
1
2
Click Test this service, at the bottom of the page.
3
4
Click Test this service again to hide the output.
Deleting a service
To delete a service
1
2
3
Click Services for host ... .
4
5
Click Delete.
6
Click Save.
Scanning host for network services
When you added your host (Hosts on page 49) you had the opportunity to add services found during the scan for network services. This scan function can also be reached afterwords.
To scan a host for network services
1
Open up the host, in Configure, you like to add new services on.
2
Click Scan host for network services.
3
4
5
Click Save.
Additional information: In a distributed enviorment a selectbox will appear when hovering over the menu item “Scan host for network services” where you can select from which op5 Monitor system that should preform the scan.
Scanning a host for snmp interfaces
In many times when you are about to monitor a switch or a router you need to setup a lot of services. It is hard work and takes a lot of time to add them one by one.
Instead of adding all interface services one by one you should use the scan for snmp interfaces function.
To add snmp interfaces
1
Open up the host, in Configure, you like to add new services on.
2
Click Scan host for SNMP interfaces.
3
4
5
Click Scan host.
6
7
8
Click Add selected services.
9
Click Save.
Scanning host for windows services
There are two ways to scan a windows host for services:
*
*
The following sections will describe how to accomplish this using the different techniques.
Scan for services using agent
Adding a service that checks a windows services is many times harder than you think. You need to
*
*
With op5 Monitor you do not need to do anything more than make sure the latest agent (NSClient++) is installed and follow the next few steps.
To add windows services
1
Open up the host, in Configure, you like to add new services on.
2
Click Scan host for Windows Services.
3
4
5
Give the new service a Service description.
6
Click Add Selected Services.
7
Click either the service link or the Scan for more service button.
8
Click Save.
Scan for service using WMI
Scan for services using Windows Management Instrumentation has a number of dependencies to be able to work:
*
*
 
There are two ways to scan for WMI on a windows host:
*
*
Scanning for WMI when adding a new host
To scan a host for WMI-counters and services upon adding the host to your op5 Monitor configuration as partly described in: Adding a host with new host wizard on page 49.
To scan for WMI counters when adding a new host:
1
Select Configure in the main menu
2
Click on New Hosts
3
4
5
6
Press Add Services
7
 
8
Press Finish at the end of the page.
The host is added and you can save your configuration.
9
10
After you have pressed “Yes, save”, this information will be displayed
 
Your configuration is saved and the host and its services are ready to be monitored.
 
Custom Variables
Custom variables can be used to store custom information for hosts, services and contacts in the configuration. These varibles can be used as a macro in command arguments and notifications for example.
All custom variables will automaticly get a underscore “_” as a prefix to prevent name collisions with the standard variables.
The custom variable will also automaticilly be converted to upper case.
These variables can be used as macros in same way as the standards macros in op5 Monitor.
When using a custom variable as a macro a “$”-sign is always used before and after the variable name.
Creating a new custom variable
Go to the configuration for a host, service or contact and click on add custom variable.
Enter a variable name and the value of the variable. Note that the prefix underscore and convertion to upper case is done automatically.
Click on submit and save the configuration.
Example
Instead of using the SNMP community name hardcoded in the check command or in the command arguments in the service check we will create a custom variable that we will use as a macro in the command arguments.
In this example we will move the SNMP community name on a traffic check on a switch port from being in the command arugments to a custom variable.
First we create a custom variable on a switch traffic check, see Creating a new custom variable on page 64.
Name the variable: snmp_community (the prefix and upper case convertion will be done automatically).
Enter the name of your SNMP community as a value. Let’s say for this example that the community name is “qwerty”
Change the command arugment of the command arugment from qwerty!5!100mbit!70!90” to “$_SNMP_COMMUNITY$!5!100mbit!70!90
Click on submit and save the configuration.
Escalations
Escalations let you configure escalation of notifications for this host. The idea is that if you have a really important host you can send the first notification to the default contact group in order for them to solve the problem. If the problem is not solved in lets say 30 minutes you can send the notification to a broader range of contacts.
Host and service escalations works exactly in the same way so we will only take a look at host escalations from now on.
Adding a host escalation
In this guide we will add a small escalation chain that does the following
*
*
To add a host escalation
1
2
3
Click Escalations.
4
a
b
c
d
e
f
Choose what states this escalation will be valid for.
In this case we do not use the escalation for unreachable or recovery which means that unreachable and recovery notifications will be sent to the contact group set on the host.
5
Click Submit.
6
7
8
a
b
c
d
e
f
Choose what states this escalation will be valid for.
In this case we do not use the escalation for unreachable or recovery which means that unreachable and recovery notifications will be sent to the contact group set on the host.
9
Click Submit.
10
Click Save.
Modifying a host escalation
To modify a host escalation
1
2
3
Click Escalations.
4
5
6
7
Click Save.
Deleting a host escalation
To delete a host escalation
1
2
3
Click Escalations.
4
5
6
Click Delete.
7
Click Save.
Access rights and contacts
To be able to login to op5 Monitor you need to have a user, described in Access rights on page 31. But you need to have a contact, described in Contacts on page 29, to be able to receive notifications and in some cases even be able to see any hosts or services.
By connecting access rights to a contact you will be able to login and get notifications with the user created in access rights.
So basically what you need to do is to configure a new contact. Add the contact to an existing contact group or create a new contact group specific for the new contact. If you created a new contact group make sure to add the contact group for the hosts and services that you want to make available in the customized view.
Add new access rights and connect it to the contact you created earlier.
Connecting access rights to contacts
To connect access rights to a contact
1
2
Add the contact to an existing contactgroup or create a new contactgroup specific for the new contact.
If you created a new contactgroup make sure to add the contact group for the hosts and services that you want to make available in the customized view.
3
4
Set the options for the new access right.
When selecting options do not use the last four options, authorized for all. By doing this the new user will only see the hosts and services that uses the contactgroup that he is a member of.
Make things easy
Profiles
Creating a Profile
To create a profile
1
2
3
Click the Clone button
4
5
Select Save as Profile
6
7
Click Clone
You are then presented with the option of creating clones based on this new profile. If you do not wish to do this now, you can simply use the left hand web menu to return to Configure or another part of op5 Monitor.
Using a Profile
To use a profile
1
2
Click use next to the profile
3
4
5
Cloning objects
Cloning from an existing Host
To clone a host
Follow the instructions from in Creating a Profile on page 70, except do not click Save as Profile.
Cloning services
If you want to create the same service check on multiple host first create the service check on the host, then clone the service check to one or more hosts.
It is also possible to clone multiple services to one or more hosts or hostgroups.
To clone a service to an other host
1
2
3
Click Services for host... in the ‘RELATED ITEMS’ menu.
4
5
6
7
Click Clone.
Copy objects
There are a number of objects that can be copied in the configuration tool and make a exact copy of the object, besides the name that must be unique.
These are the objects that is possible to make a copy of:
*
*
*
*
*
*
*
*
*
*
*
*
*
The copy will inherit all the values set on a object except the name.
 
To illustrate this let us make a copy of a check command and modify it slightly:
 
1
Click on Configure in the main menu:
2
Select Commands in the configuration menu
3
4
Click Copy
5
6
Click Submit
This approach should apply to the most objects that are possible to copy.
Propagate settings
To change the same directive on many objects of the same type can be a really time consuming work. This is where the propagate function in op5 Monitor is very handy.
With the propagate function you can copy the value of a directive from one object to one or many other objects of the same type.
In the guide below we will use the propagate function to copy the parents from one host to a couple of other hosts.
To propagate a value of a directive
1
2
3
Click Propagate.
Now you will see a check box in front of every directive like this.
4
Check the check box for parents and click Propagate selected settings.
5
6
Select how you want to propagate your settings.
You can choose the following options
7
8
Click Save.
Bulk delete
Bulk delete is powerful tool to remove several host or services at once.
Bulk delete support the following objects:
*
*
*
*
*
*
*
*
As an example, we will delete two services "Ping" on two different hosts, but the process is similar on all objects listed above.
To delete multiple services this is preformed trough Configure
1
2
Click Services for host in the right menu.
3
Click on Bulk delete objects
4
5
And click Save applied changes
Time periods
Add a time period
Time periods is time defining objects that span over a week. You can define included time for each day of the week in the time period definition.
You can also:
*
*
The time period objects are used at many places in the configuration. Most noticeably are in the contact objects where the time periods defines when notifications should be sent out.
You can also use time periods to define when a service or a host should be monitored or when you are creating availability reports.
Macros
Macros can be used to a lot of things. It can for example be used for paths, passwords and retrieving information from op5 monitor.
You can read more about notification commands in Notification macros on page 144 in the Notifications chapter.
Pre-defined macros
By default op5 monitor has a number pre-defined macros. All from path to plugin folder to retrieving information about the last state of service check.
Below is a list of some macros a complete lite of macros can be found at nagios home page: http://nagios.sourceforge.net/docs/3_0/macrolist.html
Custom macros
It is possible to create your own macros. This can be used to store passwords or user names for example.
All custom macros should be put in the file /opt/monitor/etc/resource.cfg
A custom macro should use the $USERn$ macro.
To define a password for a check, first add the macro in resource.cfg
# Password for vmware user
$USER10$=secretpassw0rd
After that add the macro to check command, in this example we use the check_esx3_host_cpu_usage check command.
command_name=check_esx3_host_cpu_usage
command_line=$USER1$/check_esx3 -H $HOSTADDRESS$ -u $ARG1$ -p $USER10$ -l cpu -s usage -w $ARG2 -c $ARG3$
This check will use the following macros:
$HOSTADDRESS$ - Will get the address of the host from the configuration
$ARG1$ - Use the fist argument from the check command.
$USER10$ - Use the argument specified in resources.cfg with the same name.
$ARG2$ - Use the second argument from the check command.
$ARG3$ - Use the third argument from the check command.
 
Features not supported by Configure
Even though some features are not supported by the op5 Monitor configuration tool you can still use them.
The hostgroup_name is one of them.
What you have to do is to add a separate configuration file not read by the import function in Configure. Then you add your other configuration tricks into that file.
To add a configuration file not read by Configure
1
2
Create the following file with an editor of your choice:
/opt/monitor/op5/nacoma/custom_config.php
3
4
5
Add the file to the /opt/monitor/etc/nagios.cfg with by adding the following line below the other cfg_file variables in nagios.cfg:
cfg_file=/opt/monitor/etc/_custom_objects.cfg
6
Restart op5 Monitor.
service monitor restart
Now you may add your objects to the new configuration file and they will not be loaded into Configure. But you can still see the objects using View config as it is described in the op5 Monitor user manual.
 

1
This gives this the user connected to this contact the possibility to execute commands like acknowledge problems etc.

2
All new services will inherit the Initial Service Settings. If you choose not to enter a value for one or more required variable, those variables must be set in the selected template.

3
Only hosts that aren't previously configured will be listed

4
If more than one the shall be separated by a ! like this: argone!argtwo.

5
If the start number is 1 and the end number is two it means that the first and the second notification will be handled by this escalation.

6
We have set the first notification and the last notification to 2 because this escalation will only be used once.

7
The escalation interval is set to 0 because there will be no more escalations when this one is done.


Feedback on documentation Feedback on documentation