In this section, we offer step-by-step instructions providing you with specific guidance to successfully install the Opsview Monitor Reports software module (see Note). It’s important that you have reviewed section Prerequisites](doc:prerequisites) requisites to ensure that any software and hardware dependencies, along with any limitations are fully understood prior to installation.
Note: We recommend that you use the Automated Installation method to install Opsview Monitor.
In this section, we show you how to create the Opsview Monitor User and Group for your Operating System (OS) distribution. In the examples below we provide commands for each of the supported operating systems:
addgroup --system opsview adduser --system --group --home /var/lib/opsview --shell /bin/bash --quiet opsview
groupadd opsview adduser -g opsview --home-dir /var/lib/opsview --shell /bin/bash opsview
Opsview Module packages are located in the same repository as the Opsview Monitor software. In this section, we provide step-by-step guidance, which assumes that the repository has been correctly set up. The packages primarily depend on MySQL and Java for which an automated installation of the database will occur, along with starting up the server.
Note: Warning messages will alert you to manually set up the database, if the automated process fails.
You can choose to install Opsview Monitor modules individually or together by using the 'm flag in the command line, as shown in the example below. You will be prompted to install each module individually, if you have a subscription for them.
You can choose to install modules using the 'm flag, as below:
curl -L http://install.opsview.com | sudo bash -s -- -m
Or by using wget:
wget -O - http://install.opsview.com | sudo bash 's -- -m
In the example below, we show you the command used to install the 'Reports' module for both a Debian and Ubuntu distribution. You need to run these commands as root.
apt-get install opsview-reporting-module opsview-jasper
In the example below, we show you the command used to install the 'Reports' module for both a Red Hat and CentOS distribution.
yum install opsview-reporting-module opsview-jasper java-1.7.0
Also, You may need to install fonts using the command shown in the example below. Run this command as root.
yum install dejavu-lgc* liberation-fonts xorg-x11-fonts*
In this section, we describe the steps needed to set up and configure your Opsview Reports module ' you must run any commands as the opsview user; switch user by using the command below:
su - opsview
If, during the 'Reports' module installation process, the database was not automatically set up, the below commands show how to do this manually.
First, copy the default configuration file and set the variables accordingly; select a random password, as shown below:
su - opsview cd /opt/opsview/jasper/etc cp jasper.defaults jasper.conf vi jasper.conf # set the password
Next,run the postinstall script to create the databases and populate them with default reports:
/opt/opsview/jasper/installer/postinstall -p <ROOT MYSQL PASSWORD>
Finally, start the JasperServer:
In this section, we describe the steps needed to enable the timezone setting in MySQL.
Firstly, you will need to load MySQL with information about all the different time zone.
If you do not specify a time zone when running a report, then reports that are created will default to the time zone of the Opsview Data Warehouse (ODW) server.
In Linux, FreeBSD, Solaris and Mac OSX the zoneinfo directory is located in /usr/share/zoneinfo by default. However, if your system doesn't have this directory, you will need to download it. In the example below, we show you how to locate the zoneinfo directory.
To load all the available time zones 'tz_files' that corresponds with a time zone 'tz_name,' you will need to invoke mysql_tzinfo_to_sql, as shown below:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
In the example below, we show a warning message that may be seen if a time zone has failed to load into MySQL. Once mysql_tzinfo_to_sql has finished, you will need to restart MySQL (for example, as the root user, running
service mysql restart,
service mysqld restart or
service mariadb restart depending on your OS).
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh87' as time zone. Skipping it.
In the following list we provide sample time zones. In fact, all supported time zones can be found in the MySQL database by running the command as shown below. Note, If an incorrect time zone is specified, then your report will not match any data.
mysql> select Name from mysql.time_zone_name;
You may receive a Java error implying that 'The time zone is not uniquely determined'. For example, if you have set the ODW server to be in Australia/Melbourne, that is, Eastern Standard Time (EST) then this can easily be confused with an American time zone. As such, useLegacyDatetimeCode=false in the ODW connection parameters should be removed.
You will need to ensure that there is no typo in the report parameter and that the report uses a valid time zone, as shown below:
mysql> SELECT CONVERT_TZ(NOW(), @@session.time_zone, 'Europe/Athens') AS time_in_athens FROM dual; +---------------------+ | time_in_athens | +---------------------+ | 2013-03-22 18:27:13 | +---------------------+
In the example below,
we show an instance where an invalid timezone has been defined:
mysql> SELECT CONVERT_TZ(NOW(), @@session.time_zone, 'Europe/Atens') AS misspelled_athens FROM dual; +-------------------+ |misspelled_athens | +-------------------+ |NULL | +-------------------+
Opsview can use a ‘single sign-on’ method and, as such, a correctly authenticated user with the REPORTUSER access will be created in JasperServer. If the user also has REPORTADMIN, then they will receive additional privileges, specifically ROLE_ADMINISTRATOR in JasperServer.
A user that previously had ROLE_ADMINISTRATOR privileges will still retain that role even if REPORTADMIN is removed from them since the user databases are not synchronised. In this instance, a JasperServer administrative user will have to manually remove the role if required.
In this section, the following steps describe how you can configure the ODW database connection in the Reports module.
You will need the password for the ODW database from when it was first created. You may be able to obtain the password from
/usr/local/nagios/etc/opsview.conf depending on whether the password entry has been encrypted. If you do not know or cannot find out the password for the configured user, you can create new credentials by connecting into the database as root and running the following:
mysql> GRANT SELECT ON odw.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD'; mysql> FLUSH PRIVILEGES;
Amend the USERNAME and PASSWORD in the above commands to be your own preferred values. You will also need to amend 'localhost' to the IP address of your Opsview Monitor Master server if you are using a remote database.
Next, login to the Opsview Monitor UI with an account that has REPORTADMIN privileges, select 'Menu => Monitoring => Reports' and click 'View =>; Repository'.
Finally, In the Folders section on the left, as shown in the screenshot below, click the Data Sources folder (if you do not see 'ODW' then check the "Manually Setting Up The Database" section of the manual):
Next, right click on 'ODW' and click 'Edit' which will load the configuration window for the ODW data source. This is how the reports module can retrieve and report on the historical data that is stored within the Opsview Data Warehouse. In order to allow the Reports module to connect, you need to provide it with valid credentials - therefore here you should enter the password you retrieved in step one (opsview.conf):.
After entering your password into the'Password:' field, click 'Test Connection'. If all it configured correctly, you should see the message 'Connection passed', as above. Finally, click Save to continue.
Emails are sent via the local machine (where the Reports module is installed) by default and you should verify with mailx that the current email system works.
date | /usr/bin/Mail -s 'test email for Opsview Reports' firstname.lastname@example.org
The email server configuration is stored in the file
If you change this file, then you will need to restart JasperServer.
If you experience any issues, you should review the logs that is located in