skip to main content
Monitoring objects Configuration
  
Monitoring objects configuration
Introduction
There are two ways of changing the configuration of the op5 Monitor:
Editing the configuration files in /opt/monitor/etc.
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.
 
Step
Description
1
Configure opens and the configuration files are compared to the data in the database.
2
Edit the configuration
3
Save the changes to the Configure database by clicking Submit on the object you just added/changed.
4
When you are done with editing the configuration save the Configure database to the configuration files by clicking Save.
5
A preflight check is made on the configuration before it is exported to the configuration files.
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 configuration 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.
 
 
The undo function will only work as long as you do not have saved the data to the configuration files.
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.
Filter config changes
To filter the configuration changes select Toggle filter bar
Using the filter bar it is possible to filter on
User
Object Name
Time
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
host name
address
notifications
active checks
etc.
In Configure you can
add new objects
modify existing objects
remove existing objects.
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 49.
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 have an address of some kind, IP address or host name.
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.
host_name
address
max_check_attempts
check_period
contacts
contact_groups
notification_interval
notification_period
The table below describes the required directives for the host object
 
Directive
Type
Description
host_name
string
This is the id of the object. I may not contain any space in the value.
alias
string
A more describing name for the object.
address
string
The address the host is reached by, preferably an IP address to make sure the host is reachable even if the DNS is down.
max_check_attempts
integer
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.
check_period
time_period
During this period the host is checked. It can be any time period defined in op5 Monitor.
contacts
contact
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
contact_group
Contact groups used to send notifications to and gives access to this host for users who do not have access to all hosts.
notification_interval
integer
Number of minutes between renotifications. Set this to 0 if you only want to have one notification sent out.
notification_period
time_period
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
must be connected to a host
can check things by tcp, agents, snmp etc.
use a check command (Commands on page 43) to communicate with the plugin (Plugins on page 43) that gets all the data.
Required directives
The following directives are required for a service object.
host_name
service_description
check_command
max_check_attempts
check_interval
retry_interval
check_period
notification_interval
notification_period
contacts
contact_groups
The table below describes the required directives for the host object
Directive
Type
Description
host_name
host_name object
The host the service is connected to.
service_description
string
This is the id of the object. It must be unique on a host but may be reused on other hosts.
check_command
command object
This is the short name of the command that is executed during service checks.
max_check_attempts
integer
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.
check_interval
integer
The number of minutes between normal service checks.
retry_interval
integer
The number of minutes between retry checks when a service has gone into a problem state before the state becomes hard.
check_period
time_period
During this period the service is checked. It can be any time period defined in op5 Monitor.
contacts
contact
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
contact_group
Contact groups used to send notifications to and gives access to this host for users who do not have access to all hosts.
notification_interval
integer
Number of minutes between renotifications. Set this to 0 if you only want to have one notification sent out.
notification_period
time_period
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:
to send notifications to
permissions to view a objects in the monitoring part of op5 Monitor.
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.
contact_name
host_notifications_enabled
service_notifications_enabled
host_notification_period
service_notification_period
host_notification_options
service_notification_options
host_notification_commands
service_notification_commands
The table below describes the required directives for the host object
Directive
Type
Description
contact_name
string
The id of the contact object.
host_notifications_enabled
yes/no
Used to determine whether or not the contact will receive notifications about host problems and recoveries.
service_notifications_enabled
yes/no
Used to determine whether or not the contact will receive notifications about service problems and recoveries.
host_notification_period
time_period object
The time period when the contact will receive any host notifications.
service_notification_period
time_period object
The time period when the contact will receive any service notifications.
host_notification_options
Down, Unreachable, Recovery, Flapping start and stop, Scheduled downtime start and stop
 
Used to set what type of host notifications the contact shall receive.
service_notification_options
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.
host_notification_commands
command object
The command used to send the host notifications
service_notification_commands
command object
The command used to send the service notifications.
notification_period
time_period
During this period the notifications are sent out if any alerts are created. It can be any time period defined in op5 Monitor.
 
Local users
Local users are user accounts that makes it possible to login to the op5 Monitor GUI using the default driver. For more information about drivers see LDAP Integration chapter
Local users does not have any thing to do with notifications or the permissions of viewing objects in op5 Monitor.
Local users can be connected to a contact by giving the username the same name as the id (contact_name) of a contact.
A local user 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.
username
password
The table below describes the required directives for the host object.
Directive
Type
Description
username
string
The username is the id of the access rights and also used as login username.
password
string
The password is used for the login.
Access rights in detail
The table below gives you a description of the settings of an access right object.
 
Directive
Description
authorized_for_system_information
Gives the user access to the system / process information.
authorized_for_configuration_information
Gives the user access to view and change configuration.
authorized_for_system_commands
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.
authorized_for_all_services
Gives the user access to view all services, se Customizing views below for more information.
authorized_for_all_hosts
Gives the user access to view all hosts, se Customizing views below for more information.
authorized_for_all_service_commands
Gives the user access to issue commands for all services, se Customizing views below for more information.
authorized_for_all_host_commands
Gives the user access to issue commands for all hosts, se Customizing views below for more information.
Recommended settings
Recommended settings for
an administrator would be to check all boxes
help desk staff it could be
-authorized_for_system_information
-authorized_for_system_commands so they can acknowledge problems but not change the configuration.
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:
use already defined time periods as excludes
add exceptions based on dates and ranges of days
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.
Directive/option
Description
timeperiod_name
short name of the time period
alias
descriptive name of the time period
Monday to Sunday
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
Exception type
Specify what type of exception you want to use; Date or Day
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.
Directive/option
Description
exclude
Other predefined time period definitions that should be excluded from this time period.
Exception type
Specify what type of exception you want to use; Date or Day
The table below describes exception by Date:
Directive/option
Description
Interval
Choose Single ate or Date range
Date
Choose the date that is supposed to be used in this Exception.
From date
If you chosen date range you will here set the start date To date.
To date
If you chosen date range you will here set the end date.
Frequency
How often the exception is repeated. Valid values are positive integers greater than one. E.g:
Date range "2012-01-01 - 2012-12-31 / 5" means every fifth day of 2012.
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 "2012-06-01 / 14" means every 14th day from first of june 2012. Note that this exception has no end.
Hours
Which time to include for this exception. You can define multiple times by separating them with comma. Example:
00:00-01:00,03:00-06:00
The table below describes exception by Day:
Directive/option
Description
Interval
Choose Single day or a Day range
Weekday
Choose the weekday that is supposed to be used in this Exception.
From weekday
If you chosen Day range you will here set the start day.
To weekday
If you chosen Day range you will here set the end day.
Frequency
How often the exception is repeated. Valid values are positive integers greater than one. E.g:
Date range "2012-01-01 - 2012-12-31 / 5" means every fifth day of 2012.
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 "2012-06-01 / 14" means every 14th day from first of june 2012. Note that this exception has no end.
Hours
Which time to include for this exception. You can define multiple times by separating them with comma.
Example: 00:00-01:00,03:00-06:00
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
service or host check command
notification command
event handler
obsession.
Directives
A command has got only two directives
command_name
command_line
 
Directive
Description
command_name
This is the id of the command and also the name shown in Configure.
command_line
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
contact op5 for a specific development
www.op5.org
exchange.nagios.org
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
host groups
service groups
contact groups
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.
A host can be connected to any number of hosts.
A host group can be connected to an other host group.
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
geographic placements
what company they belongs to
who owns the hosts
who should be able to see the hosts in the group
function or operating system.
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 An email service group
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:
DNS
SMTP
IMAP / POP3
WAN Connection
File Storage
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 Create and edit the file /opt/monitor/op5/ninja/application/config/custom/groups.php with your favorite editor.
2 Put the following into the file:
<?php defined('SYSPATH') OR die('No direct access allowed.');
$config['see_partial_hostgroups'] = true;
3 Save the file.
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:
host templates
service templates
contact templates
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.
Any directive not set in neither a template or directly on the object will have the op5 Monitor default value.
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 51.
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 Give the contact template a name
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 Use the template on call template we created in Adding a contact template on page 51.
3 Type in a contact_name
4 Type in an alias
5 Type in the email address
6 Click Submit.
7 If you want to create access check the “Configure access rights for this contact” box, otherwise save changes
8 When Configuring access right for this contact select the access rights the contact should have, after that save the changes.
Modify a contact
To modify a contact
1 Click Contacts on the main page.
2 Choose the contact you like to modify in the drop down list.
3 Click Go.
4 In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
5 Make your modifications and click Submit.
6 Click Save.
Delete a contact
1 Click Contacts on the main page.
2 Choose the contact you like to modify in the drop down list.
3 Click Go.
4 Click on 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
cloning of a host
using a profile
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 Type in a host_name.
3 Type in an alias.
4 Type in the address to the host, IP address is mostly the best choice.
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 Add 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 Now either click the host or service links or click Save.
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 Fill in the desired network range. We will scan for hosts in the range from 172.27.86.8 - 172.27.86.97.
4 Click Scan Ranges.
5 In this case we found 3 three hosts.
6 Repeat To add a new host using the new host wizard - Part 1 on page 53 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 54 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 On the start page choose the host you like to modify in the drop down list.
2 Click Go.
3 In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
4 Make your modifications and click Submit.
5 Click Save.
 
Deleting a host
To modify a host
1 On the start page choose the host you like to delete in the drop down list.
2 Click Go.
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
scan certain range for new hosts
notify you when new are found
be executed every night by cron on the op5 Monitor server.
 
 
No host will be automatically added. The network autoscan function will only find the hosts for you.
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.
Description
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 Add a host (IP address) in the Host field
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
add service for this host
scan host for network services
scan host for snmp interfaces
scan host for windows services with agent
scan host for windows services using WMI
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 On the start page choose the host you like to add a new service to in the drop down list.
2 Click Go.
3 Click Services for host....under related items menu to the right.
The add new service pages is shown.
4 Type in a service_description.
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 Type in the argument 4.
9 Click Submit.
10 Click the Save icon.
 
 
If the arguments include an exclamation mark (!) this has to be escaped with an back slash (\).
Example: username!crypticpassword\!!warning!critical
This will out put “crypticpassword!”
Modifying a service
To modify a service
1 On the start page choose the host you like to modify a service on in the drop down list.
2 Click Go.
3 Click Services for host ... .
4 Choose the service you like to modify in the drop down list.
5 Click Go.
6 In the view you will get only directives differ from the template will be shown. To change the other directives click Advanced.
7 Make your modifications and click Submit.
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 59.
To test a service
1 Pick up the service you like to test as it is done in Modifying a service on page 61.
2 Click Test this service, at the bottom of the page.
3 The output looks like the one below. If you get any errors it will be shown here in the output
4 Click Test this service again to hide the output.
Deleting a service
To delete a service
1 On the start page choose the host you like to delete a service from in the drop down list.
2 Click Go.
3 Click Services for host ... .
4 Choose the service you like to modify in the drop down list.
5 Click Delete.
6 Click Save.
Scanning host for network services
When you added your host (Hosts on page 53) 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 Select the new services found and click Continue to step 3.
4 Click either the host or service link to go back to the place where you started.
5 Click Save.
Additional information: In a distributed environment 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 Set the SNMP community.
4 Chose SNMP version.
5 Click Scan host.
6 Select the services you like to add.
7 Click either the host or the service link to get back.
8 Click Add selected services.
9 Click Save.
Scanning host for windows services
There are two ways to scan a windows host for services:
Using the windows agent NSclient++
Using WMI, Windows Management Instrumentation
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
have access to the windows server
know the exact name of the windows service
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 Choose which server to preform the scan:
4 Select the Windows Services you like to add as a new service in op5 Monitor.
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:
WMI enabled on the windows server
User account on the windows server with sufficient privileges
 
There are two ways to scan for WMI on a windows host:
When adding a new host
Scanning a existing 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 53.
To scan for WMI counters when adding a new host:
1 Select Configure in the main menu
2 Click on New Hosts
3 Enter the information about the host
4 Select the checkbox Add WMI
5 Enter username and password
6 Press Add Services
7 Select the services you wish to add from the list:
 
8 Press Finish at the end of the page.
The host is added and you can save your configuration.
9 Press Save in the top right corner
10 Review your changes then by clicking on More info press Save objects I have changed
After this the configuration will be saved and i final preflight configuration check has been performed.
 
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 variables can be used as a macro in command arguments and notifications for example.
All custom variables will automatically get a underscore “_” as a prefix to prevent name collisions with the standard variables.
The custom variable will also automatically be converted to upper case.
In order to prevent name collision among custom variables from different object types, Nagios prepends "_HOST", "_SERVICE", or "_CONTACT" to the beginning of custom host, service, or contact variables, respectively, in macro and environment variable names.
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.
Entered Name
Variable name
Macro name
snmp_community
_SNMP_COMMUNITY
$_SNMP_COMMUNITY$
location
_LOCATION
$_LOCATION$
 
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 conversion 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 arguments to a custom variable.
First we create a custom variable on a switch traffic check, see Creating a new custom variable on page 68.
Name the variable: snmp_community (the prefix and upper case conversion 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 argument of the command argument from “qwerty!2!100mbit!70!90” to “$_SERVICESNMP_COMMUNITY$!2!100mbit!70!90
Click on submit and save the configuration.
Dynamic Button
The dynamic button is a customizable button which any script can be added to.
If defined, a link in the service information page will appear under “Service Commands” on the service ext info page.
Configuration
To configure the dynamic button two custom variables has to be created on the service which the button should be added to.
The first one is the command line and the second one is the permissions.
The prefix _OP5 symbolizes that this is a dynamic button variable. If an H is added to the prefix (_OP5H) the custom variables will not be visible in the Service State Information table.
_OP5H__ACTION__NAME
_OP5H__ACCESS__NAME
 
Note that there are two underscores!
Action
The action has the variable name _OP5H__ACTION__NAME
The value of the action is the path to the script that should be executed.
The name of the button is set by replacing “NAME” in the variable name. When using spaces in the name, this should be replaced by one underscore.
Example:
To name the dynamic button “Restart Service” and it will execute the script /opt/plugins/custom/restart_service.sh. The variable name should be:
Variable name:_OP5H__ACTION__RESTART_SERVICE
Value:/opt/plugins/custom/restart_service.sh
Access
The _OP5H__ACCESS__NAME sets who will be able to use the dynamic button. This is set on contact-groups only.
If a user is not in a group that is specified in the access variable the button will not be visible for the user.
The access variable name must have the same name as the action name.
Example
If you want to give access to the “Restart Service” action to the support-group and windowsadmins groups the setup should look like this:
Variable name: _OP5H__ACCESS__RESTART_SERVCE
Value: support-group,windows-admins
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
First notification is sent to the support-group
After 10 minutes the second (the last one) is sent to the sysadmins group.
To add a host escalation
1 On the start page choose the host you like to add an escalation to in the drop down list.
2 Click Go.
3 Click Escalations.
4 Add the escalation number one.
a Choose the contact group that shall have the notification.
b Set the start number in the escalation chain.
c Set the end number in the escalation chain 5.
d Set the notification interval which is the number of minutes to wait to the next notification.
e Choose the time period when this escalation will be in use.
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 Choose Add new host escalation
7 Click Go.
8 Add the escalation number two.
a Choose the contact group that shall have the notification.
b Set the start number in the escalation chain.
c Set the end number in the escalation chain 6.
d Set the notification interval which is the number of minutes to wait to the next notification. 7
e Choose the time period when this escalation will be in use.
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 On the start page choose the host you like to modify an escalation on in the drop down list.
2 Click Go.
3 Click Escalations.
4 Choose the escalation you like to modify.
5 Click Go.
6 Make the modifications you like to do and click Submit.
7 Click Save.
Deleting a host escalation
To delete a host escalation
1 On the start page choose the host you like to delete an escalation from in the drop down list.
2 Click Go.
3 Click Escalations.
4 Choose the escalation you like to modify.
5 Click Go.
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 Local users on page 39. But you need to have a contact, described in Contacts on page 37, 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 Configure a new contact.
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 Configure a user in access rights with the exact same name as the contact you created.
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 On the start page choose the host you like to create a profile of in the drop down list.
2 Click Go.
3 Click the Clone button
4 Select the services you wish to include
5 Select Save as Profile
6 Enter name and description for the profile you are creating
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 From the start page click Profiles
2 Click use next to the profile
3 Select what parts of the profile you want to include
4 Fill in the number of copies and click Continue...
5 Fill out host details for the clones and click Create
Cloning objects
Cloning from an existing Host
To clone a host
Follow the instructions from in Creating a Profile on page 75, 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 Choose the Configure web menu.
2 Choose your host you want to copy from, then click Go
3 Click Services for host... in the ‘RELATED ITEMS’ menu.
4 Select the service (or one of the services) you want to clone then click on Go and then on Clone.
5 Select the service(s) you want to clone.
6 You can chose to clone the service(s) to a list of hosts, a hostgroup or all hosts in a hostgroup.
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:
Hosts
Services
Hostgroups
Servicegroups
Check commands
Contacts
Contactgroups
Templates
Timeperiods
Host Dependencies
Service Dependencies
Host Escalations
Service Escalations
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 Search for a command to copy:
4 Click Copy
5 Make the changes you want. A new name is required. and i.e create a listing of the attached VMFS-storages:
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 On the start page choose the host you like to propagate a directive value from in the drop down list.
2 Click Go.
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 Select the host objects (host or whole host groups) you like to propagate the settings to.
6 Select how you want to propagate your settings.
You can choose the following options
Option
Description
Replace
Replace the destination values.
Append
Append the source values to the destination values.
Subtract
Subtract the source values from the destination values.
7 Click Go.
8 Click Save.
Bulk delete
Bulk delete is powerful tool to remove several host or services at once.
Bulk delete support the following objects:
Hosts
Services
Hostgroups
Servicegroups
Contacts
Contactgroups
Commands
Time Periods
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 Select a host which services you want to delete and click GO
2 Click Services for host in the right menu.
3 Click on Bulk delete objects
4 Select the services that you want to delete and click Delete
5 Click Save submitted 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:
use already defined time periods as excludes
add exceptions based on dates and ranges of days
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 154 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
MACRO
DESCRIPTION
$USER1$
Path to /opt/plugins.
$ARGn$
The nth argument passed to the command
$HOSTNAME$
Short name for the host.
$HOSTADDRESS$
Address of the host.
$HOSTSTATE$
A string indicating the current state of the host ("UP", "DOWN", or "UNREACHABLE").
$SERVICEDISPLAYNAME$
An alternate display name for the service.
$SERVICESTATE$
A string indicating the current state of the service ("OK", "WARNING", "UNKNOWN", or "CRITICAL").
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.
Writeprotected configuration files
By making a file write-protected it cannot be changed by op5 Configuration.
This is equivalent to the nagios function called notouch.
Create the file /opt/monitor/op5/nacoma/custom_config.php
Add the following content:
<?php
$notouch_file_prefix = 'static_';
?>
If a configuration file in is renamed with the static_ prefix op5 configuration will not be able to change this file.
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 Open up a ssh connection to the op5 Monitor server and login as root.
2 Create the following file with an editor of your choice:
/opt/monitor/op5/nacoma/custom_config.php
3 Add the following code to the file you just created:
<?php
$notouch_file_prefix = "_";
?>
4 Create a configuration file with “_” as a prefix to the file name like this:
touch /opt/monitor/etc/_custom_objects.cfg
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.