Actually added the doc and contents

This commit is contained in:
laf
2015-05-12 08:54:56 +01:00
parent 39e504541b
commit 5ed95fd1ca
9 changed files with 241 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
## Migrating from Observium to LibreNMS
A LibreNMS user, [Dan](https://twitter.com/thedanbrown), has kindly provided full details and scripts to be able to migrate from Observium to LibreNMS.
See [his](https://vlan50.com/2015/04/17/migrating-from-observium-to-librenms/) blog for full details.
We have mirrored the scripts he's provided with consent, these are available in the `scripts` folder of your installation called LibreNMS.zip.

View File

@@ -0,0 +1,53 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# First we SSH to LibreNMS and create necessary directories with #
# the mkdir script. Then the script enters each Observium RRD dir #
# and SCPs the RRD files to the correct directory on LibreNMS. #
# After that we add all of the devices to LibreNMS using the #
# destwork script. #
###################################################################
########################### DIRECTIONS ############################
# Run as Root from the Observium server #
# #
# Enter values for DEST, L_RRDPATH, O_RRDPATH, MKDIR, DESTSCRIPT, #
# and NODELIST. The defaults should work if you put the files in #
# the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter LibreNMS IP or hostname here
DEST=10.0.253.35
# Enter LibreNMS RRD path here
L_RRDPATH=/opt/librenms/rrd/
# Enter Observium RRD path here
O_RRDPATH=/opt/observium/rrd/
# Enter path to mkdir script here
MKDIR=/tmp/mkdir.sh
# Enter path to destwork script here
DESTSCRIPT=/tmp/destwork.sh
# Enter path to nodelist text file
NODELIST=/tmp/nodelist.txt
# This line SSHs to LibreNMS server and makes directories based on node list text file
ssh root@$DEST 'bash -s' < $MKDIR
# Conversion and transfer loop
while read line;
# Enter RRD Directory
do cd $O_RRDPATH"${line%/*}"
# Transfer RRD files to LibreNMS Server
scp *.rrd root@$DEST:$L_RRDPATH"${line%/*}"/
# Exit to parent dir
cd ..
done < $NODELIST
# This line SSHs to LibreNMS server and runs the destwork script to finish conversion
ssh root@$DEST 'bash -s' < $DESTSCRIPT

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# A simple script to add each host in text file to LibreNMS #
###################################################################
########################### DIRECTIONS ############################
# Enter values for ADDHOST, SNMPSTRING, and NODELIST. The default #
# should work if you put the files in the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter path to LibreNMS addhost module
ADDHOST=/opt/librenms/addhost.php
# Enter your unique SNMP String
SNMPSTRING=cisconetwork
# Enter path to nodelist text file
NODELIST=/tmp/nodelist.txt
while read line
# Add each host from the node list file to LibreNMS
do php $ADDHOST "${line%/*}" $SNMPSTRING v2c;
done < $NODELIST

View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# A simple script to create needed directories on LibreNMS server #
###################################################################
########################### DIRECTIONS ############################
# Enter values for NODELIST, L_RRDPATH. The default should work if#
# you put the files in the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter path to node list text file
NODELIST=/tmp/nodelist.txt
# Enter path to LibreNMS RRD directories
L_RRDPATH=/opt/librenms/rrd/
# This loop enters the RRD folder and creates dir based on contents of node list text file
while read line
do mkdir -p $L_RRDPATH"${line%/*}"
done < $NODELIST

View File

@@ -0,0 +1,3 @@
example1.yourdomain.net
example2.yourdomain.net
example3.yourdomain.net

View File

@@ -0,0 +1,54 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# First we SSH to LibreNMS and create necessary directories with #
# the mkdir script. Then the script enters each Observium RRD dir #
# converts the RRDs to XML and SCPs the XML files to the correct #
# directory on LibreNMS. After that we add all of the devices to #
# to LibreNMS using the destwork script. #
###################################################################
########################### DIRECTIONS ############################
# Run as Root from the Observium server #
# #
# Enter values for DEST, L_RRDPATH, O_RRDPATH, MKDIR, DESTSCRIPT, #
# and NODELIST. The defaults should work if you put the files in #
# the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter LibreNMS IP or hostname here
DEST=10.0.253.35
# Enter LibreNMS RRD path here
L_RRDPATH=/opt/librenms/rrd/
# Enter Observium RRD path here
O_RRDPATH=/opt/observium/rrd/
# Enter path to mkdir script here
MKDIR=/tmp/mkdir.sh
# Enter path to destwork script here
DESTSCRIPT=/tmp/destwork.sh
# Enter path to nodelist text file
NODELIST=/tmp/nodelist.txt
# This line SSHs to LibreNMS server and makes directories based on node list text file
ssh root@$DEST 'bash -s' < $MKDIR
# Conversion and transfer loop
while read line;
# Enter RRD Directory
do cd $O_RRDPATH"${line%/*}"
# Convert each RRD to XML
for f in *.rrd; do rrdtool dump ${f} > ${f}.xml; done
# Transfer XML file to LibreNMS Server
scp *.xml root@$DEST:$L_RRDPATH"${line%/*}"/
# Exit to parent dir
cd ..
done < $NODELIST
# This line SSHs to LibreNMS server and runs the destwork script to finish conversion
ssh root@$DEST 'bash -s' < $DESTSCRIPT

View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# This script converts the XML files from Observium back to RRD #
# files for use with LibreNMS. It then adds the device using the #
# Addhost function of LibreNMS #
###################################################################
########################### DIRECTIONS ############################
# Enter values for L_RRDPATH, ADDHOST, SNMPSTRING, and NODELIST. #
#The default should work if you put the files in the same location#
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter path to LibreNMS RRD directories
L_RRDPATH=/opt/librenms/rrd/
# Enter path to LibreNMS addhost module
ADDHOST=/opt/librenms/addhost.php
# Enter your unique SNMP String
SNMPSTRING=cisconetwork
# Enter path to nodelist text file
NODELIST=/tmp/nodelist.txt
# Loop enters RRD directory and then each folder based on contents of node list text file
while read line
# Enter the directory
do cd $L_RRDPATH"${line%/*}"
# Convert from XML back to RRD
for f in *.xml; do rrdtool restore ${f} `echo ${f} | cut -f1 -d .`.rrd; done;
# Remove leftover XML files
rm *.xml;
# Add the host to LibreNMS
php $ADDHOST "${line%/*}" $SNMPSTRING v2c;
# Change back to parent directory
cd ..;
done < $NODELIST

View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Observium to LibreNMS conversion
####################### SCRIPT DESCRIPTION ########################
# A simple script to create needed directories on LibreNMS server #
###################################################################
########################### DIRECTIONS ############################
# Enter values for NODELIST, L_RRDPATH. The default should work if#
# you put the files in the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - http://librenms.org #
# Script Written by - Dan Brown - http://vlan50.com #
###################################################################
# Enter path to node list text file
NODELIST=/tmp/nodelist.txt
# Enter path to LibreNMS RRD directories
L_RRDPATH=/opt/librenms/rrd/
# This loop enters the RRD folder and creates dir based on contents of node list text file
while read line
do mkdir -p $L_RRDPATH"${line%/*}"
done < $NODELIST

View File

@@ -0,0 +1,3 @@
example1.yourdomain.net
example2.yourdomain.net
example3.yourdomain.net