Updating Network Monitoring After Upgrading the Junos Space Network Management Platform
Overview
After upgrading the Junos Space Network Management Platform,
the Network Monitoring configuration files might not contain the configuration
file changes for the latest version. During the Junos Space Network
Management upgrade process, the Software Install Status window displays
a message if there are any configuration files in conflict. You can
also access the /var/log/install.log
file to view any files that have conflicts. To manually merge files
that contain conflicts, you must perform all of the following steps.
When the upgrade process encounters no files in conflict, the files
are auto-merged and you do not need to perform the following steps.
Step 1: Monitoring the Software Install Status Window for File Conflicts
Check for the following message in the Software Install Status window during the upgrade of the Junos Space Network Management Platform:
Please go to folder /opt/opennms/etc, and merge the *.old.bak files to current running files.
When logged in from the Junos Space Network Management Platform
command-line interface (CLI), you can also check for file conflicts
from the /var/log/install.log
file.
The following example message from the install.log
file shows three files with conflicts that you will need to manually
merge to resolve:
-Xignore-space-change -Xignore-all-space -Xrenormalize opennms-auto-upgrade/pristine:
command returned error: 1 at /usr/lib/perl5/site_perl/5.8.8/Error.pm line 343.
If no files with conflicts are found during the upgrade process, the files are automatically merged, and you do not need to perform any additional steps. Otherwise, you must complete each of the following steps.
Step 2: Identifying Files with Conflicts
If you discovered one or more files with conflicts during the previous step, perform the following steps to identify the files with conflicts:
- Log in to the virtual IP (VIP) fabric node.
- Stop the Network Monitoring service from the Junos Space
Network Management Platform user interface:
- Select Network Management Platform > Administration
> Applications.
The Applications page appears.
- Right-click Network Management Platform and
click Manage Services. (Alternatively, you can select Network Management Platform and click Manage Services from the Actions menu.)
The Manage Services page is displayed.
- Select the Network Monitoring service and click
the Stop Service icon.
The Confirm Stop SNMP Agent dialog box is displayed.
- Click Yes.
A status dialog box with a message indicating that the service has stopped is displayed.
- Click OK.
A dialog box is displayed confirming that the service has successfully stopped.
- Click OK.
You are taken to the Manage Services page.
- Select Network Management Platform > Administration
> Applications.
- From the Junos Space Network Management Platform CLI,
check the status of the Network Monitoring service by executing the
following command:
# su - opennms -c '/sbin/service opennms status'
Junos Space displays the message
opennms is stopped
. To re-merge the Network Monitoring configuration files:
- From the Junos Space CLI, execute the following command:
# /opt/opennms/bin/config-tools/conflict-remerge.pl
Junos Space displays output similar to the following:
conflict-remerge.pl 19: Resetting tree to 'opennms-auto-upgrade/tags/runtime/pre-1.13.0-0.20131227.1' - Navigate to the
/opt/opennms/etc
directory and execute the following command:# git statusMost of the files are auto-merged. If any files remain, the status of each file in conflict is displayed under the section “Unmerged paths” and is marked "both modified", as shown in the following example:
Unmerged paths:# (use "git add/rm ..." as appropriate to mark resolution)# both modified: eventconf.xml# both modified: events/ncs-component.events.xml# both modified: linkd-configuration.xmlFor each remaining conflicted file (listed under Unmerged paths) changes that were made to the file are identified with the opening statement "<<<<<< HEAD" and closing statement ">>>>>>> opennms-auto-upgrade/pristine". For example, in the
ncs-component.events.xml
file shown above, the file changes are marked as follows:<<<<<<< HEAD<alarm-data-reduction key="%uei%:%parm[componentType]%:%parm[componentForeignSource]%
:%parm[componentForeignId]%" alarm-type="2"clear-key="uei.opennms.org/internal/ncs/componentImpacted:%parm[componentType]%
:%parm[componentForeignSource]%:%parm[componentForeignId]%" auto-clean="false"/>======<alarm-data-reduction-key="%uei%:%parm[componentType]%:%parm[componentForeignSource]%
:%parm[componentForeignId]%:%parm[nodeid]%" alarm-type="2"clear-ei.opennms.org/internal/ncs/componentImpacted:%parm[componentType]%
:%parm[componentForeignSource]%:%parm[componentFo]%:%parm[nodeid]%"auto-clean="false"/>>>>>>>> opennms-auto-upgrade/pristine
- From the Junos Space CLI, execute the following command:
Step 3: Merging Files with Conflicts
After identifying the files with conflicts, you must perform the following steps to manually merge each of the files and resolve all conflicts:
- From a VI editor, open the file with conflicts.
- Search for the statement "HEAD".
- Identify the differences between the two configurations
which are contained between the lines <<<<< HEAD and >>>>> opennms-auto-upgrade/pristine.
The configuration for the file before the upgrade is contained between the lines <<<<< HEAD and ========.
The configuration for the file after the upgrade is contained between the lines ======== and >>>>> opennms-auto-upgrade/pristine.
- Save the configuration of the file after the upgrade, and then update it with any user-modified values from the configuration file before the upgrade.
- After manually merging configuration file changes, remove
each of the following lines from the file:<<<<<<< HEAD============>>>>>>> opennms-auto-upgrade/pristine
- Save the configuration file.
- Repeat steps 2 through 6 for each configuration file with conflicts
until all file conflicts in all files are merged.
After all the file conflicts are merged, there should be no occurrence of the following lines:
<<<<<<< HEAD============>>>>>>> opennms-auto-upgrade/pristine
Step 4: Verifying the Manual Merge Status of Configuration Files
From the Junos Space CLI, execute the following commands to verify that the configuration file changes are merged correctly:
If the file changes were merged correctly, Junos Space displays the following message:
Step 5: Final Steps After Upgrading Network Monitoring
Perform the following steps after upgrading Network Monitoring:
- Update permissions of the
/opt/opennms
directory to 774:# chmod -R 774 /opt/opennms - Run the following command to change the ownership of the
/opt/opennms
directory to opennms:space:#chown -R opennms:space /opt/opennms - Verify that the
opennms.conf
file includes the line RUNAS="opennms":# more opennms.confSTART_TIMEOUT=0ADDITIONAL_MANAGER_OPTIONS="-Djava.io.tmpdir=/opt/opennms/tmp -d64 -XX:MaxPermSize=512m -XX:HeapDumpPath=/var/opennms/java_pid <pid>.hprof -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCTimeStamps -XX:+PrintGCDetails"JAVA_HEAP_SIZE=2048RUNAS="opennms" #######Verify that this line exists - The password of the user “postgres” in the
opennms-datasources.xml
file will be empty. Set the password to postgres:<jdbc-data-source name="opennms-admin"database-name="template1"class-name="org.postgresql.Driver"url="jdbc:postgresql://localhost:5432/template1"user-name="postgres"password="postgres" /> #######Password is set here Start the Network Monitoring service from the Junos Space user interface:
- Select Network Management Platform > Administration > Applications.
The Applications page appears.
- Right-click Network Management Platform and select Manage Services or select Network Management Platform and click Manage Services from the Actions menu.
The Manage Services page appears.
- Select the Network Monitoring service and click
the Start Service icon.
The Confirm Start message appears.
- Click YES.
- Select Network Management Platform > Administration > Applications.
- If your fabric is running in a multi-node setup, execute
the following command to verify that all the modified configuration
files are synchronized across the standby node: # /opt/opennms/contrib/failover/scripts/sync.sh