skip to main content
Monitoring objects Configuration : Managing Objects
   
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 61.
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 Contact templates.
2 Give the contact template a name
3 Change can_submit_commands to yes. 1
4 Click Submit.
5 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 61.
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
Host Wizard
new host option
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 option
To add a new hosts using the new host option - 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 option - 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 hosts using the new host option - Part 1 on page 63 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 option - Part 2 on page 64 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 in log-files, meaning that the history logs for the host is lost.
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 check
Test this check 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 70.
To test a check
1 Pick up the service you like to test as it is done in Modifying a service on page 71.
2 Click Test this check, 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 Hide check 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 63) 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 option on page 63.
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 78.
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 41. But you need to have a contact, described in Contacts on page 39, 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.
Management packs
A management pack is essantially a group of services connected to a hostgroup with the possibility to add custom variables. These are then used by the Host Wizard.
The benefit with using management packs is that the monitoring will be more homogenous.
The picture below shows how management packs integrates into op5 monitor.
Creating management packs
To create a management pack a hostgroup must be created and the services that should be included in the management pack should be added to that hostgroup. See Services on Host groups on page 46 for more information.
After the hostgroup with services has been created the hostgroup can be converted into a management pack.
To create a new management pack from a hostgroup go to Management Packs in the configuration.
1 Enter a name for the management pack.
2 Select whitch hostgroup that should be used for the management pack.
3 Select an icon (a larger icon looks better in the host wizard).
4 Enter a description.
It is also possible to add custom variables, these can be used for information that needs to be entered when using the host wizard. Such as username, password and SNMP community names.
In this example we create a management pack for HP Servers with one custom variable for SNMP community name.
Click on Submit to save the management pack.
Group in Group with Management Packs
It is possible to use the group in group with management packs. This works in the same way as it does for normal hostgroups.
Example
The hostgroup fruits includes the hostgroup ‘apples’.
If a management pack i associatedv with ‘fruits’ will the host be added to the hostgroup ‘fruits’ and it will get all the services that is on the hostgroup ‘fruits’, but it will not be affected by the ‘apples’ hostgroup.
If a management pack is associated with apples the host will be added to the hostgroup apples and get all the services that is in the hostgroup ‘apples’ AND all the services that is in the hostgroup ‘fruits’.
More concrete;
A hostgroup ‘linux’ is created with the check ‘check_ssh_cpu’
A hostgroup ‘generic’ is created with the check ‘check_ping’
Management pack ‘generic server’ is associated with the hostgroup ‘generic’. Hosts that are added with the management pack ‘generic server’ will get the ‘check_ping’ service.
Mangement pack ‘linux servers’ is associated with the hostgroup ‘linux’. Hosts added with the ‘linux servers’ will get both the ‘check_ssh_cpu’ and the ‘check_ping’ checks.
Activate Management Packs
Management packs that is not created by the user, provided by op5 or a third party, needs to be activeted.
To activate a management pack go to Mangement Pack Management in the configuration.
Click on Activate to activate a management pack.
Force Activate will override any management pack with the same name.
Import Management Packs
To import a management pack from a json-file go to Management Pack Management.
Click on Choose File to select the json-file that should be imported.
Click on Upload json file to import the management pack.
Export Management Packs
Export management packs makes it possible to share your management pack with others or upload it to another op5 Monitor server.
Go to Mangement Pack Mangement under configuration.
Click on Export on the management pack to export this to a json-file. The file will be downloaded to you computer.

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.