Files
librenms-librenms/scripts/Migration/Standard_Conversion/destwork_no_xml.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2015-05-12 08:54:56 +01:00
# 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 #
2015-05-12 08:54:56 +01:00
# should work if you put the files in the same location. #
###################################################################
############################# CREDITS #############################
# LibreNMS work is done by a great group - https://www.librenms.org #
2015-05-12 08:54:56 +01:00
# 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 SNMP version of all clients in nodelist text file
SNMPVERSION=v2c
2015-05-12 08:54:56 +01:00
# Enter path to nodelist text file
NODELIST=/tmp/nodelist.txt
# Enter user and group of LibreNMS installation
L_USRGRP=librenms
2015-05-12 08:54:56 +01:00
while read line
# Change ownership to LibreNMS user and group
chown -R $L_USRGRP:$L_USRGRP .;
2015-05-12 08:54:56 +01:00
# Add each host from the node list file to LibreNMS
do php $ADDHOST "${line%/*}" $SNMPSTRING $SNMPVERSION;
done < $NODELIST