migration and cleanup from legacy repos

This commit is contained in:
2017-12-09 12:48:51 -06:00
parent 4be209af11
commit 5f1be2380c
67 changed files with 6481 additions and 1 deletions

29
CMDB/snmp/.svn/all-wcprops Executable file
View File

@@ -0,0 +1,29 @@
K 25
svn:wc:ra_dav:version-url
V 57
/rg0103/pdesubversion-tpqaslack/!svn/ver/366/scripts/snmp
END
debian-default-snmpd
K 25
svn:wc:ra_dav:version-url
V 78
/rg0103/pdesubversion-tpqaslack/!svn/ver/315/scripts/snmp/debian-default-snmpd
END
centos-snmpd.options
K 25
svn:wc:ra_dav:version-url
V 78
/rg0103/pdesubversion-tpqaslack/!svn/ver/359/scripts/snmp/centos-snmpd.options
END
setup-snmp.sh
K 25
svn:wc:ra_dav:version-url
V 71
/rg0103/pdesubversion-tpqaslack/!svn/ver/366/scripts/snmp/setup-snmp.sh
END
snmpd.conf
K 25
svn:wc:ra_dav:version-url
V 68
/rg0103/pdesubversion-tpqaslack/!svn/ver/276/scripts/snmp/snmpd.conf
END

164
CMDB/snmp/.svn/entries Executable file
View File

@@ -0,0 +1,164 @@
10
dir
440
https://svn01.atlanta.hp.com/rg0103/pdesubversion-tpqaslack/scripts/snmp
https://svn01.atlanta.hp.com/rg0103/pdesubversion-tpqaslack
2013-10-30T20:33:11.769859Z
366
wyble@hp.com
92b00a8e-620f-4ac7-abd2-c9ef5b6c269b
debian-default-snmpd
file
2013-12-10T21:18:03.480402Z
536542d8470261eb1971bd3bb35adf68
2013-10-02T16:57:28.319476Z
315
wyble@hp.com
723
centos-snmpd.options
file
2013-12-10T21:18:03.487402Z
40233436f1b04129a231dba3a5225762
2013-10-25T19:11:31.312453Z
359
wyble@hp.com
has-props
135
setup-snmp.sh
file
2013-12-10T21:18:03.492402Z
dde4ae53ae1e316b551dbc386ac30e9b
2013-10-30T20:33:11.769859Z
366
wyble@hp.com
1350
snmpd.conf
file
2013-12-10T21:18:03.496402Z
88b7c51014dbd12d784982d41c3ae7e7
2013-09-17T18:44:43.972099Z
276
wyble@hp.com
474

View File

@@ -0,0 +1,5 @@
K 14
svn:executable
V 1
*
END

View File

@@ -0,0 +1,3 @@
# snmpd command line options
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"
#OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

View File

@@ -0,0 +1,22 @@
# This file controls the activity of snmpd and snmptrapd
# Don't load any MIBs by default.
# You might comment this lines once you have the MIBs downloaded.
export MIBS=
# snmpd control (yes means start daemon).
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run. See snmpd.conf(5) for how to do this.
TRAPDRUN=no
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes

View File

@@ -0,0 +1,62 @@
#!/bin/bash
#A script to setup snmp on redhat/debian systems
centos_snmp()
#Install SNMP on a cent box
{
#Fix yum.conf
wget -O /etc/yum/yum.conf http://slack-master.tplab.tippingpoint.com/yum.conf
#Install snmpd
yum -y install net-snmp
#Install observium bits
wget -O /usr/bin/distro http://www.observium.org/svn/observer/trunk/scripts/distro
chmod 755 /usr/bin/distro
#Pull down snmpd configuration files
wget -O /etc/snmp/snmpd.conf http://slack-master.tplab.tippingpoint.com/snmp/snmpd.conf
wget -O /etc/sysconfig/snmpd.options http://slack-master.tplab.tippingpoint.com/snmp/centos-snmpd.options
#Restart snmpd
/etc/init.d/snmpd restart
chkconfig snmpd on
}
debian_snmp()
#Install snmp on a debian box
{
#Install snmpd
apt-get -y install snmpd
#Install observium bits
wget -O /usr/bin/distro http://www.observium.org/svn/observer/trunk/scripts/distro
chmod 755 /usr/bin/distro
#Pull down snmpd configuration files
wget -O /etc/default/snmpd http://slack-master.tplab.tippingpoint.com/snmp/debian-default-snmpd.conf
wget -O /etc/snmp/snmpd.conf http://slack-master.tplab.tippingpoint.com/snmp/snmpd.conf
#Restart snmpd
/etc/init.d/snmpd restart
chkconfig snmpd on
}
DIST=$(lsb_release -d)
if [ $(echo $DIST | grep Ubuntu -c) -eq 1 ];
then
debian_snmp
fi
if [ $(echo $DIST | grep Centos -c) -eq 1 ];
then
centos_snmp
fi

View File

@@ -0,0 +1,10 @@
com2sec readonly default mng-actua1
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none
syslocation Austin TX USA
syscontact esplabsupport@hp.com
#This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

3
CMDB/snmp/centos-snmpd.options Executable file
View File

@@ -0,0 +1,3 @@
# snmpd command line options
OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid"
#OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"

22
CMDB/snmp/debian-default-snmpd Executable file
View File

@@ -0,0 +1,22 @@
# This file controls the activity of snmpd and snmptrapd
# Don't load any MIBs by default.
# You might comment this lines once you have the MIBs downloaded.
export MIBS=
# snmpd control (yes means start daemon).
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-LS4d -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run. See snmpd.conf(5) for how to do this.
TRAPDRUN=no
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes

70
CMDB/snmp/distro Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
if [ "${OS}" = "SunOS" ] ; then
OS=Solaris
ARCH=`uname -p`
OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
elif [ "${OS}" = "AIX" ] ; then
OSSTR="${OS} `oslevel` (`oslevel -r`)"
elif [ "${OS}" = "Linux" ] ; then
KERNEL=`uname -r`
if [ -f /etc/redhat-release ] ; then
DIST=$(cat /etc/redhat-release | awk '{print $1}')
if [ "${DIST}" = "CentOS" ]; then
DIST="CentOS"
elif [ "${DIST}" = "Mandriva" ]; then
DIST="Mandriva"
PSEUDONAME=`cat /etc/mandriva-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandriva-release | sed s/.*release\ // | sed s/\ .*//`
elif [ "${DIST}" = "Fedora" ]; then
DIST="Fedora"
else
DIST="RedHat"
fi
PSEUDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SuSE-release ] ; then
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ] ; then
DIST='Mandrake'
PSEUDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ] ; then
if [ -f /etc/mailcleaner/etc/mailcleaner/version.def ] ; then
DIST="MailCleaner"
REV=`cat /etc/mailcleaner/etc/mailcleaner/version.def`
else
DIST="Debian `cat /etc/debian_version`"
REV=""
fi
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
fi
if [ -f /etc/lsb-release ] ; then
LSB_DIST="`cat /etc/lsb-release | grep DISTRIB_ID | cut -d "=" -f2`"
LSB_REV="`cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2`"
if [ "$LSB_DIST" != "" ] ; then
DIST=$LSB_DIST
REV=$LSB_REV
fi
fi
# OSSTR="${OS} ${DIST} ${REV}(${PSEUDONAME} ${KERNEL} ${MACH})"
OSSTR="${DIST} ${REV}"
elif [ "${OS}" = "Darwin" ] ; then
if [ -f /usr/bin/sw_vers ] ; then
OSSTR=`/usr/bin/sw_vers|grep -v Build|sed 's/^.*:.//'| tr "\n" ' '`
fi
fi
echo ${OSSTR}

32
CMDB/snmp/setup-snmp.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
#Install script for snmp on all Linux systems
if [ -f /etc/apt/sources.list ];
then
#Install observium bits
chmod 755 /usr/bin/distro
#Pull down snmpd configuration files
wget -O /etc/default/snmpd http://txn04-slack-master.tplab.tippingpoint.com/sysmgmt/snmp/debian-default-snmpd
wget -O /etc/snmp/snmpd.conf http://txn04-slack-master.tplab.tippingpoint.com/sysmgmt/snmp/snmpd.conf
#Restart snmpd
/etc/init.d/snmpd restart
elif [ -f /etc/yum.conf ];
then
#Fix yum.conf
wget -O /etc/yum/yum.conf http://fezzik.tplab.tippingpoint.com/yum.conf
#Install snmpd
yum -y install net-snmp
#Install observium bits
curl --silent http://txn04-slack-master.tplab.tippingpoint.com/sysmgmt/snmp/distro > /usr/bin/distro
chmod 755 /usr/bin/distro
#Pull down snmpd configuration files
wget -O /etc/snmp/snmpd.conf http://txn04-slack-master.tplab.tippingpoint.com/sysmgmt/snmp/snmpd.conf
wget -O /etc/sysconfig/snmpd.options http://txn04-slack-master.tplab.tippingpoint.com/sysmgmt/snmp/centos-snmpd.options
#Restart snmpd
/etc/init.d/snmpd restart
chkconfig snmpd on
fi

10
CMDB/snmp/snmpd.conf Executable file
View File

@@ -0,0 +1,10 @@
com2sec readonly default mng-actua1
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none
syslocation Austin TX USA
syscontact techops-alerts@turnsys.com
#This line allows Observium to detect the host OS if the distro script is installed
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

35
CMDB/subnets Executable file
View File

@@ -0,0 +1,35 @@
10.253.0.0/24
10.253.1.0/24
10.253.2.0/24
10.253.3.0/24
10.253.4.0/24
10.253.5.0/24
10.253.6.0/24
10.253.7.0/24
10.253.8.0/24
10.253.9.0/24
10.251.0.0/24
10.251.1.0/24
10.251.2.0/24
10.251.3.0/24
10.251.4.0/24
10.251.5.0/24
10.251.6.0/24
10.251.7.0/24
10.251.8.0/24
10.251.9.0/24
10.251.10.0/24
10.251.11.0/24
10.251.12.0/24
10.251.13.0/24
10.251.30.0/24
10.251.31.0/24
10.251.32.0/24
10.251.33.0/24
10.251.34.0/24
10.251.35.0/24
10.251.36.0/24
10.251.37.0/24
10.251.38.0/24
10.251.39.0/24
10.251.40.0/24

5
CMDB/zenossScan.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
for subnet in $(cat subnets); do
zendisc run --now --monitor localhost --deviceclass /Discovered --parallel 8 --net $subnet
done