From: Frank Brehm Date: Tue, 29 Mar 2022 10:18:06 +0000 (+0200) Subject: Adding stuff from old JES servers X-Git-Tag: 0.4.1^2~31^2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=3b1d328d9f50ac4d27fa21601e366f226fde83c5;p=pixelpark%2Fpp-admin-tools.git Adding stuff from old JES servers --- diff --git a/.gitignore b/.gitignore index 47af2be..e5002e1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.egg *-stamp *.bak +*.log* build trace MANIFEST @@ -18,3 +19,4 @@ vendor/ build/ dist/ .egg* +venv diff --git a/jes-old/bin/.gitignore b/jes-old/bin/.gitignore new file mode 100644 index 0000000..f47cb20 --- /dev/null +++ b/jes-old/bin/.gitignore @@ -0,0 +1 @@ +*.out diff --git a/jes-old/bin/add_crm_readwrite_Alle.sh b/jes-old/bin/add_crm_readwrite_Alle.sh new file mode 100755 index 0000000..b2db4a5 --- /dev/null +++ b/jes-old/bin/add_crm_readwrite_Alle.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: add_crm_readwrite_Alle.sh +## Major-Version ....: 1 +## Minor-Version ....: 00 +## Maintained by ....: Thomas Kotschok +## Description ......: Script adding Attribut to ldap +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 23.04.2013 thomas.kotschok initial Version +## +## +################################################################################ + +################################################################################ +## +## Vars +## +################################################################################ +## +## name -> description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(!(|(!(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)))(ppApplicationRight=crm:readwrite)(ppApplicationRight=crm:clientmanager)(ppApplicationRight=crm:controller)(ppApplicationRight=crm:admin)(ppApplicationRight=crm:partner)(&(ou=*Extern))))" +#FILTER="(|(uid=redbull)(uid=justyna.maetzold))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ou=Agentur - Extern)(l=Pixelpark Berlin)(!(ppNoCircularMail=true)))" +##FILTER="(|(uid=david.hanke)(uid=thomas.verse)(uid=sebastian.kachel))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ou=Elephant*Seven*)(!(ppNoCircularMail=true)))" +##FILTER="(|(uid=david.hanke)(uid=thomas.verse)(uid=sebastian.kachel))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(&(inetuserstatus=active)(objectclass=*)(mail=*)(ou=Agentur*)(l=Pixelpark*Koeln)(!(ppNoCircularMail=*)))" +##FILTER="(|(uid=david.hanke)(uid=thomas.verse)(uid=sebastian.kachel))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(!(|(ou=*Extern)(ppNoCircularMail=true)))(|(ou=Agentur*)(ou=Holding*)(ou=Pixelpark Bielefeld)(ou=Pixelpark Nettec)))" +##FILTER="(|(uid=david.hanke)(uid=thomas.verse)(uid=sebastian.kachel))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ + + +SERVER="ds04.pixelpark.com" +PW="3o.o0dlt" +BASEDN="ou=people,o=pixelpark,o=isp" +FILTER="(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ou=Agentur - Extern)(l=Pixelpark Berlin)(!(ppNoCircularMail=true)))" +##FILTER="(|(uid=david.hanke)(uid=thomas.verse)(uid=sebastian.kachel))" +ATTRIBUTE="uid" + +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPADD=/usr/bin/ldapadd + +# ldap Search +UIDS=`$LDAPSEARCH -h $SERVER -D cn=admin -w $PW -b $BASEDN "$FILTER" $ATTRIBUTE | /usr/bin/grep uid: | cut -d: -f 2 | tr -d " "` + +# debug +##echo "$UIDS" + +# +for UID in $UIDS ; do +# debug +##echo "$LDAPADD $uid" + +# create entry +$LDAPADD -v -h $SERVER -D cn=admin -w $PW < description +## +################################################################################ +TMP=/var/tmp/$$ +# db-name: dsconf get-suffix-prop o=isp +# DBNAME=db-name +DBNAME=ispdb2 +BASEPATH=/opt/SUNWdsee/dsee6/bin +LDAPSEARCH=${BASEPATH}/ldapsearch +LDAPMODIFY=${BASEPATH}/ldapmodify +LDAPADD="${BASEPATH}/ldapmodify -a" +SERVER_ARGS='-p 389 -h ds04.pixelpark.com -w 3o.o0dlt' +#SERVER_ARGS='-p 391 -h 217.66.52.19 -D cn=admin -w 3o.o0dlt' + +INDEXES="ipHostNumber uidNumber ipNetworkNumber gidnumber oncrpcnumber automountKey" + +SUFFIX="cn=_DATABASE_,cn=ldbm database,cn=plugins,cn=config" + +################################################################################ +## +## boolean check_index(string $database , string $attribute) +## +################################################################################ +## +## Checking if Index already exists +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $attribute - Attribute to index +## +################################################################################ +## +## Return value: +## +## true/false - false if index exists , otherwise false +## +################################################################################ +check_index() { + DATABASE=$1 + ATTRIBUTE=$2 + shift 2 + + SUFFIX=`echo ${SUFFIX} | sed -e 's/_DATABASE_/'${DATABASE}'/'` + + ${LDAPSEARCH} ${SERVER_ARGS} -b "cn=${ATTRIBUTE},cn=index,${SUFFIX}" -s base "objectclass=*" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo " ${ATTRIBUTE} skipped already exists" + return 0 + fi + return 1 +} + +################################################################################ +## +## ldif ldif_index (string $database , string $attribute, array $index_type) +## +################################################################################ +## +## Genarates a ldfi statement for setting index's in DS5x +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $attribute - Attribute to index +## +## $index_type - list of index types +## +################################################################################ +## +## Return value: +## +## ldif - Genarates an output (stdout) of a ldfi statement for setting +## index's +## +################################################################################ +ldif_index() { + DATABASE=$1 + ATTRIBUTE=$2 + shift 2 + + SUFFIX=`echo ${SUFFIX} | sed -e 's/_DATABASE_/'${DATABASE}'/'` + + echo "dn: cn=${ATTRIBUTE},cn=index,${SUFFIX}" + echo "objectClass: top" + echo "objectClass: nsIndex" + echo "cn: ${ATTRIBUTE}" + echo "nsSystemIndex: false" + + for type in $* ; do + echo "nsindextype: $type" + done + + echo +} + +################################################################################ +## +## void wait_for_index_creation (string $database , string $attribute) +## +################################################################################ +## +## This funktion adds a Task for an index creation to the directory server +## and than waits until the index is created +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $attribute - Attribute to index +## +################################################################################ +wait_for_index_creation() { + DATABASE=$1 + ATTRIBUTE=$2 + + shift 2 + _YR=`date '+%y'` + _MN=`date '+%m'` + _DY=`date '+%d'` + _H=`date '+%H'` + _M=`date '+%M'` + _S=`date '+%S'` + + TASKNAME="${ATTRIBUTE}_${_YR}_${_MN}_${_DY}_${_H}_${_M}_${_S}" + + (cat < $TMP/task_${ATTRIBUTE}_${DATABASE} + + ${LDAPMODIFY} -D cn=admin ${SERVER_ARGS} -f $TMP/task_${ATTRIBUTE}_${DATABASE} + + while : + do + eval "${LDAPSEARCH} ${SERVER_ARGS} -b \"cn=index, cn=tasks, cn=config\" -s sub \"objectclass=*\" > ${TMP}/istask_${ATTRIBUTE} 2>&1" + grep ${TASKNAME} ${TMP}/istask_${ATTRIBUTE} > /dev/null 2>&1 + if [ $? -ne 0 ]; then + break + fi + eval "${LDAPSEARCH} ${SERVER_ARGS} -b \"cn=index,cn=tasks,cn=config\" -s one \"objectclass=*\" nstaskstatus | grep -i nstaskstatus | cut -d\":\" -f2 > ${TMP}/wait_task_${ATTRIBUTE}" + TASK_STATUS=`head -1 ${TMP}/wait_task_${ATTRIBUTE}` + echo " ${ATTRIBUTE} - $TASK_STATUS \r\c" + echo "$TASK_STATUS" | grep "Finished" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + break + fi + sleep 2 + done + echo " " +} + +################################################################################ +## +## void generate_index (string $database , string $attribute, array $index_type) +## +################################################################################ +## +## Main function for genarating index's ... doing all checks, genaration, tasks +## etc. +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $attribute - Attribute to index +## +## $index_type - list of index types +## +################################################################################ +generate_index() { + DATABASE=$1 + ATTRIBUTE=$2 + shift 2 + + check_index ${DATABASE} ${ATTRIBUTE} || { + ldif_index ${DATABASE} ${ATTRIBUTE} "$@" > $TMP/${ATTRIBUTE}_${DATABASE} + ${LDAPMODIFY} -a -D cn=admin ${SERVER_ARGS} -f $TMP/${ATTRIBUTE}_${DATABASE} + wait_for_index_creation ${DATABASE} ${ATTRIBUTE} + } + +} + +################################################################################ +## +## void init_env() +## +################################################################################ +## +## Init Enviroment +## +################################################################################ +init_env() { + [ -d ${TMP} ] && rm -rf ${TMP} + mkdir ${TMP} +} + +################################################################################ +## +## void clear_env() +## +################################################################################ +## +## Clear Enviroment +## +################################################################################ +clear_env() { + cat $TMP/vlv_post.txt + [ -d ${TMP} ] && rm -rf ${TMP} +} + +################################################################################ +## +## void generate_vlv (string $database , string $index_name , +## string search_name , string $searchbase , +## string $filter) +## +################################################################################ +## +## Main function for genarating vlv index's ... doing all checks, genaration, +## tasks etc. +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $index_name - Name of the VLV Index +## +## $search_name - Name of the VLV Search +## +## $searchbase - searchbase of the VLV Search +## +## $filter - filter of the VLV Search +## +################################################################################ +generate_vlv() { + DATABASE="$1" + INDEX_NAME="$2" + SEARCH_NAME="$3" + SEARCHBASE="$4" + FILTER="$5" + shift 5 + + INDEXES_GENERATED="" + + check_vlv "${DATABASE}" "${INDEX_NAME}" "${SEARCH_NAME}" "${SEARCHBASE}" "${FILTER}" || { + ldif_vlv "${DATABASE}" "${INDEX_NAME}" "${SEARCH_NAME}" "${SEARCHBASE}" "${FILTER}" > $TMP/vlv_${INDEX_NAME} + ${LDAPMODIFY} -a -D cn=admin ${SERVER_ARGS} -c -f $TMP/vlv_${INDEX_NAME} + echo ${LDAPMODIFY} -a -D cn=admin ${SERVER_ARGS} -c -f $TMP/vlv_${INDEX_NAME} + INDEXES_GENERATED="$INDEXES_GENERATED ${INDEX_NAME}" + } + + for index in ${INDEXES_GENERATED} ; do + # echo "./vlvindex -n ${DATABASE} -T ${index}" >> $TMP/vlv_post.txt + echo "/opt/SUNWdsee7/bin/dsadm reindex -l -t ${index} /var/opt/SUNWdsee7/ds04 ${SUFFIX}" >> $TMP/vlv_post.txt + done + +} + +################################################################################ +## +## boolean check_vlv (string $database , string $index_name , +## string search_name , string $searchbase , +## string $filter) +## +################################################################################ +## +## Checking if VLV Index already exists +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $index_name - Name of the VLV Index +## +## $search_name - Name of the VLV Search +## +## $searchbase - searchbase of the VLV Search +## +## $filter - filter of the VLV Search +## +################################################################################ +## +## Return value: +## +## true/false - false if index exists , otherwise false +## +################################################################################ +check_vlv() { + DATABASE="$1" + INDEX_NAME="$2" + SEARCH_NAME="$3" + SEARCHBASE="$4" + FILTER="$5" + shift 5 + + SUFFIX=`echo ${SUFFIX} | sed -e 's/_DATABASE_/'${DATABASE}'/'` + + ${LDAPSEARCH} ${SERVER_ARGS} -b "cn=${INDEX_NAME},${SEARCH_NAME},${SUFFIX}" -s base "objectclass=*" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo " ${INDEX_NAME} skipped already exists" + return 0 + fi + return 1 +} + +################################################################################ +## +## void generate_vlv (string $database , string $index_name , +## string search_name , string $searchbase , +## string $filter) +## +################################################################################ +## +## Main function for genarating vlv index's ... doing all checks, genaration, +## tasks etc. +## +################################################################################ +## +## Parameter: +## +## $database - Database to create index in +## +## $index_name - Name of the VLV Index +## +## $search_name - Name of the VLV Search +## +## $searchbase - searchbase of the VLV Search +## +## $filter - filter of the VLV Search +## +################################################################################ +ldif_vlv() { + DATABASE="$1" + INDEX_NAME="$2" + SEARCH_NAME="$3" + SEARCHBASE="$4" + FILTER="$5" + shift 5 + + + echo "dn: cn=${SEARCH_NAME},cn=${DATABASE},cn=ldbm database,cn=plugins,cn=config" + echo "objectClass: top" + echo "objectClass: vlvSearch" + echo "cn: ${SEARCH_NAME}" + echo "vlvbase: ${SEARCHBASE}" + echo "vlvscope: 1" + echo "vlvfilter: (${FILTER})" + echo "aci: (target=\"ldap:///cn=${SEARCH_NAME},cn=${DATABASE},cn=ldbm database,cn=plugins,cn=config\")(targetattr=\"*\")(version 3.0; acl \"Config\";allow(read,search,compare)userdn=\"ldap:///anyone\";)" + + echo + + echo "dn: cn=${INDEX_NAME},cn=${SEARCH_NAME},cn=${DATABASE},cn=ldbm database,cn=plugins,cn=config" + echo "cn: ${INDEX_NAME}" + echo "vlvSort: cn uid" + echo "objectclass: top" + echo "objectclass: vlvIndex" + + echo + +} + + +################################################################################ +## +## Main +## +################################################################################ + +init_env + +#INDEXES="ipHostNumber uidNumber ipNetworkNumber gidnumber oncrpcnumber automountKey memberUid inetUserStatus inetMailGroupStatus icsStatus" +#for index in ${INDEXES}; do +# generate_index userRoot ${index} pres eq +#done +# +#INDEXES="membernisnetgroup nisnetgrouptriple" +#for index in ${INDEXES}; do +# generate_index userRoot ${index} pres eq sub +#done + +SUFFIX="o=pixelpark,o=isp" + +generate_vlv ${DBNAME} pixelpark.com.outlook pixelpark.com_outlook_vlv_index "ou=people,$SUFFIX" "(&(mail=*)(cn=*))" +##generate_vlv ${DBNAME} pixelpark.com.getgrent pixelpark.com_group_vlv_index "ou=group,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=posixGroup" +##generate_vlv ${DBNAME} pixelpark.com.gethostent pixelpark.com_hosts_vlv_index "ou=hosts,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipHost" +##generate_vlv ${DBNAME} pixelpark.com.getnetent pixelpark.com_networks_vlv_index "ou=networks,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipNetwork" +##generate_vlv ${DBNAME} pixelpark.com.getrpcent pixelpark.com_rpc_vlv_index "ou=rpc,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=oncRpc" +##generate_vlv ${DBNAME} pixelpark.com.getpwent pixelpark.com_passwd_vlv_index "ou=people,$SUFFIX" "objectclass=posixAccount" +##generate_vlv ${DBNAME} pixelpark.com.getspent pixelpark.com_shadow_vlv_index "ou=people,$SUFFIX" "objectclass=shadowAccount" +##generate_vlv ${DBNAME} pixelpark.com.crm pixelpark.com_crm_vlv_index "ou=people,$SUFFIX" "&(objectclass=ppPixelAccount)(inetUserStatus=active)" + +#SUFFIX="o=zlu,o=isp" + +# generate_vlv userRoot zlu.de.getgrent pixelpark.com_group_vlv_index "ou=group,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=posixGroup" +# generate_vlv userRoot zlu.de.gethostent pixelpark.com_hosts_vlv_index "ou=hosts,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipHost" +# generate_vlv userRoot zlu.de.getnetent pixelpark.com_networks_vlv_index "ou=networks,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipNetwork" +# generate_vlv userRoot zlu.de.getrpcent pixelpark.com_rpc_vlv_index "ou=rpc,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=oncRpc" +# generate_vlv userRoot zlu.de.getpwent zlu.de_passwd_vlv_index "ou=people,$SUFFIX" "objectclass=posixAccount" +# generate_vlv userRoot zlu.de.getspent zlu.de_shadow_vlv_index "ou=people,$SUFFIX" "objectclass=shadowAccount" + +#SUFFIX="o=visioplant,o=isp" + +# generate_vlv userRoot visioplant.de.getgrent pixelpark.com_group_vlv_index "ou=group,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=posixGroup" +# generate_vlv userRoot visioplant.de.gethostent pixelpark.com_hosts_vlv_index "ou=hosts,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipHost" +# generate_vlv userRoot visioplant.de.getnetent pixelpark.com_networks_vlv_index "ou=networks,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=ipNetwork" +# generate_vlv userRoot visioplant.de.getrpcent pixelpark.com_rpc_vlv_index "ou=rpc,ou=Unix NSS,ou=Applications,$SUFFIX" "objectclass=oncRpc" +# generate_vlv userRoot visioplant.de.getpwent visioplant.de_passwd_vlv_index "ou=people,$SUFFIX" "objectclass=posixAccount" +# generate_vlv userRoot visioplant.de.getspent visioplant.de_shadow_vlv_index "ou=people,$SUFFIX" "objectclass=shadowAccount" + +clear_env + +exit 0 + diff --git a/jes-old/bin/collectCrashData.sh b/jes-old/bin/collectCrashData.sh new file mode 100755 index 0000000..ae5831a --- /dev/null +++ b/jes-old/bin/collectCrashData.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +TIMESTAMP=`/usr/bin/date +%Y%m%d%H%M` + +TMP=/var/tmp/crash.${TIMESTAMP} + +INSTANCE_DIR=/var/opt/SUNWdsee/ds?? + +mkdir ${TMP} + +# Get DS Pid +PID=`/usr/bin/pgrep ns-slapd` + +echo "Collecting DS Data" +echo "generating core file ..." +gcore -o ${TMP}/gcore.out ${PID} +echo "generating pfiles ..." +pfiles ${PID} > ${TMP}/pfiles.out 2>&1 +echo "generating pflags ..." +pflags ${TMP}/gcore.out.${PID} > ${TMP}/pflags.out 2>&1 +echo "generating pmap ..." +pmap ${TMP}/gcore.out.${PID} > ${TMP}/pmap.out 2>&1 +echo "generating pstack ..." +pstack ${TMP}/gcore.out.${PID} > ${TMP}/pstack.out 2>&1 +echo "generating pargs ..." +pargs ${TMP}/gcore.out.${PID} > ${TMP}/pargs.out 2>&1 +echo "copy last access log" +cp ${INSTANCE_DIR}/logs/access ${TMP}/ +echo "copy last error log" +cp ${INSTANCE_DIR}/logs/errors ${TMP}/ + +echo "generating tarball ... (in Background)" +cd ${TMP}/.. +tar cf - crash.${TIMESTAMP} | bzip2 -9 > crash.${TIMESTAMP}.tar.bz2 & diff --git a/jes-old/bin/ds_backup.csh b/jes-old/bin/ds_backup.csh new file mode 100755 index 0000000..5befffe --- /dev/null +++ b/jes-old/bin/ds_backup.csh @@ -0,0 +1,56 @@ +#!/usr/bin/tcsh +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: ds_backup.csh +## Major-Version ....: 1 +## Minor-Version ....: 01 +## Maintained by ....: Axel Apitz +## Description ......: Do LDAP Backup/Dump to File System +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 06.08.2008 a_apitz initial Version +## +################################################################################ + +################################################################################ +## +## Vars +## +################################################################################ +## +## name -> description +## +################################################################################ + +set HOLD=3 + +################################################################################ +## +## Main +## +################################################################################ + +source /opt/PPjes/etc/cshrc.jes + +# Binary Backup +ls -dt ${INSTANCE_DIR}/bak/????_*_*_*_*_* | tail +`echo "${HOLD}" | bc` | xargs rm -rf +dsconf backup ${INSTANCE_DIR}/bak/`date +%Y_%m_%d_%H_%M_%S` + +# LDIF Backup +set SUFFIXES=`dsconf list-suffixes` +foreach suffix ( ${SUFFIXES} ) + ls -t ${INSTANCE_DIR}/ldif/${suffix}_????_*_*_*_*_*.ldif | tail +`echo "${HOLD}" | bc` | xargs rm -f + dsconf export ${suffix} ${INSTANCE_DIR}/ldif/${suffix}_`date +%Y_%m_%d_%H_%M_%S`.ldif +end + +# Config Backup +ls -t ${INSTANCE_DIR}/bak/config_*_*_*_*_* | tail +`echo "${HOLD}" | bc` | xargs rm -rf +cd ${INSTANCE_DIR} +tar cf - config | bzip2 -9 > ${INSTANCE_DIR}/bak/config_`date +%Y_%m_%d_%H_%M_%S`.tar.bz2 +cd - diff --git a/jes-old/bin/ldap-create-confluence-groups.pl b/jes-old/bin/ldap-create-confluence-groups.pl new file mode 100755 index 0000000..5b52588 --- /dev/null +++ b/jes-old/bin/ldap-create-confluence-groups.pl @@ -0,0 +1,406 @@ +#!/www/bin/perl +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: ldap-create-confluence-groups.pl +## Major-Version ....: 1 +## Minor-Version ....: 05 +## Maintained by ....: Axel Apitz +## Description ......: Script to Create and Convert Groups for Confluence +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 15.09.2006 a_apitz initial Version +## +## 02 27.09.2006 a_apitz initial Version +## +## 03 11.11.2006 a_apitz added feature Copy +## +## 04 24.04.2007 a_apitz by Convert, static entries (uniquemember) +## are copied, too +## +## 05 21.08.2008 a_apitz by Convert and Create, be sure dn list is +## unique +## +################################################################################ + +################################################################################ +## +## Modules +## +################################################################################ + +# Standard Modules +use strict; +use Config::IniFiles; +use Getopt::Long; +use Pod::Usage; + +# Logging Modules +use Log::Dispatch; +use Log::Dispatch::Screen; +use Log::Dispatch::FileRotate; +use Date::Manip; + +# LDAP Modules +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Utils; +use Mozilla::LDAP::API qw(ldap_url_parse); + +################################################################################ +## +## Vars +## +################################################################################ +## +## name -> description +## +################################################################################ +use vars qw($VERSION $CFGFILE $CFG %OPTS $LOGGER $LDAP); + +$CFGFILE = "/opt/PPjes/etc/ldap-create-confluence-groups.ini"; + +################################################################################ +## +## string get_version() +## +################################################################################ +## +## Return value: +## +## Version of this Script +## +################################################################################ +sub get_version () { + my $version = `awk '/^## Major-Version ....:/ { majorv=\$4 } + /^## Minor-Version ....:/ { minorv=\$4 } + END { print majorv"."minorv }' $0`; + return $version; +} + +################################################################################ +## +## boolean read_config() +## +################################################################################ +## +## Read Configuration Information +## +################################################################################ +## +## Return value: +## +## True on Success +## +################################################################################ +sub read_config() { + $CFG = new Config::IniFiles( -file => $CFGFILE ); + if ($CFG == undef ) { + foreach (@Config::IniFiles::errors) { + print "ERROR: ",$_; + } + return 0; + } else { + return 1; + } +} + +################################################################################ +## +## boolean read_args() +## +################################################################################ +## +## Parse and read Args +## +################################################################################ +## +## Return value: +## +## True on Success +## +################################################################################ +sub read_args() { + &GetOptions(\%OPTS, + 'help|h|?', + 'man', + 'version|V' => sub {print $VERSION;exit 0;}, + 'config|C=s' => sub {$CFGFILE=@_[1];}, + 'quite|q' + ) or pod2usage({ '-verbose' => 0}); + pod2usage({ '-verbose' => 1}) if $OPTS{'help'}; + pod2usage({ '-verbose' => 2}) if $OPTS{'man'}; + return 1; +} + +################################################################################ +## +## LOGGER create_logger(); +## +################################################################################ +## +## Init the Logger Object +## +################################################################################ +## +## Return value: +## +## Object from type Log::Dispatcher +## +################################################################################ +sub create_logger() { + my $LOGGER = Log::Dispatch->new(); + + $LOGGER->add( + Log::Dispatch::Screen->new( + name => 'screen', + min_level => 'info', + stderr => 0 + ) + ) unless $OPTS{quite} ; + + $LOGGER->add( + Log::Dispatch::FileRotate->new( + name => 'file', + min_level => 'info', + filename => $CFG->val("Config LOG","file"), + mode => 'append', + TZ => Date_TimeZone(), + callbacks => sub { + my %p = @_; + return UnixDate( scalar(localtime()), + "%b %e %H:%M:%S ").$p{message}; + }, + DatePattern => $CFG->val("Config LOG", "DatePattern") + ) + ); + + return $LOGGER; +} + +sub sort_unique() { + my @list = @_; + my %seen = (); + return sort grep { ! $seen{$_} ++ } @list; +} + +sub convert_group() { + my $group_name = shift(); + + my $entry = ''; + my $cn = ''; + my $memberurl = ''; + my @userdns = (); + + # Read LDAP Data of Group to Convert + + $entry = $LDAP->search($CFG->val($group_name,"dn"), + "base", + "(objectclass=*)", + 0, + ("cn","memberurl","uniqueMember")); + $LDAP->printError() if $LDAP->getErrorCode(); + if (!$entry) { + return; + } + $cn = $entry->{"cn"}[0]; + $memberurl = $entry->{"memberurl"}[0]; + + # Copy static Entries + if (defined($entry->{"uniqueMember"})) { + @userdns = @{$entry->{"uniqueMember"}}; + } + + $memberurl =~ s#:///#://ldap/#; # we need a host .. ugly + + $memberurl = ldap_url_parse($memberurl); + + $entry = $LDAP->search($memberurl->{'dn'}, + $memberurl->{'scope'}, + $memberurl->{'filter'}, + 0, + ("dn")); + $LDAP->printError() if $LDAP->getErrorCode(); + + while($entry) { + push(@userdns , $entry->getDN()); + $entry = $LDAP->nextEntry(); + } + + # Make the List Unique + @userdns = &sort_unique(@userdns); + + # Remove Old Group + $LDAP->delete("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + + # Create new Object + + $entry = $LDAP->newEntry(); + $entry->setDN("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + $entry->{objectclass} = [ "top", "groupOfUniqueNames" ]; + $entry->{uniquemember} = [ @userdns ] ; + + $LDAP->add($entry); + +} + +sub create_group() { + my $group_name = shift(); + + my $entry = ''; + my $cn = ''; + my $filter = ''; + my $basedn = ''; + my @userdns = (); + + $cn = $CFG->val($group_name,"cn"); + $filter = $CFG->val($group_name,"filter"); + $basedn = $CFG->val($group_name,"basedn"); + + $entry = $LDAP->search($basedn, + "sub", + $filter, + 0, + ("dn")); + $LDAP->printError() if $LDAP->getErrorCode(); + + while($entry) { + push(@userdns , $entry->getDN()); + $entry = $LDAP->nextEntry(); + } + + # Make the List Unique + @userdns = &sort_unique(@userdns); + + # Remove Old Group + $LDAP->delete("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + + # Create new Object + + $entry = $LDAP->newEntry(); + $entry->setDN("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + $entry->{objectclass} = [ "top", "groupOfUniqueNames" ]; + $entry->{uniquemember} = [ @userdns ] ; + + $LDAP->add($entry); + +} + +sub copy_group() { + my $group_name = shift(); + + my $entry = ''; + my $cn = ''; + my @userdns = (); + + $entry = $LDAP->search($CFG->val($group_name,"dn"), + "base", + "objectclass=*", + 0, + ("dn","cn","uniqueMember")); + $LDAP->printError() if $LDAP->getErrorCode(); + + if (!$entry) { + return; + } + $cn = $entry->{"cn"}[0]; + @userdns = @{$entry->{"uniqueMember"}}; +# use Data::Dumper; +# print Dumper(\@userdns); + + # Remove Old Group + $LDAP->delete("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + + # Create new Object + + $entry = $LDAP->newEntry(); + $entry->setDN("cn=".$cn.",".$CFG->val("Config LDAP","basedn")); + $entry->{objectclass} = [ "top", "groupOfUniqueNames" ]; + $entry->{uniquemember} = [ @userdns ] ; + + $LDAP->add($entry); + +} + +################################################################################ +## +## Main +## +################################################################################ +$VERSION = &get_version(); +&read_args() || exit 1; +&read_config() || exit 1; +$LOGGER = &create_logger(); + +$LDAP = new Mozilla::LDAP::Conn($CFG->val("Config LDAP","host"), + $CFG->val("Config LDAP","port"), + $CFG->val("Config LDAP","user"), + $CFG->val("Config LDAP","pw")); +die "Could't connect to LDAP server ldap" unless $LDAP; + +foreach my $group_name ($CFG->GroupMembers("Convert")) { + #&mail_report($report_name, &make_report($report_name)); + $LOGGER->log( level => 'info', message => "Converting $group_name\n" ); + &convert_group($group_name); +} + +foreach my $group_name ($CFG->GroupMembers("Create")) { + #&mail_report($report_name, &make_report($report_name)); + $LOGGER->log( level => 'info', message => "Creating $group_name\n" ); + &create_group($group_name); +} + +foreach my $group_name ($CFG->GroupMembers("Copy")) { + #&mail_report($report_name, &make_report($report_name)); + $LOGGER->log( level => 'info', message => "Copy $group_name\n" ); + ©_group($group_name); +} + +$LDAP>close(); + +exit 0; + +################################################################################ +## +## Documentation +## +################################################################################ +__END__ + +=head1 ldap-create-confluence-groups.pl + +ldap-create-confluence-groups - Creation of confluence groups + +=head1 SYNOPSIS + +sample [options] [file ...] + + Options: + --help brief help message + --man full documentation + --version program Version + +=head1 OPTIONS + +=over 8 + +=item B<-help> + +Print a brief help message and exits. + +=item B<-man> + +Prints the manual page and exits. + +=back + +=head1 DESCRIPTION + +B will create confluence groups. + +=cut + diff --git a/jes-old/bin/ldap-live2dev.pl b/jes-old/bin/ldap-live2dev.pl new file mode 100755 index 0000000..92967fb --- /dev/null +++ b/jes-old/bin/ldap-live2dev.pl @@ -0,0 +1,441 @@ +#!/www/bin/perl -w +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: ldap-live2dev.pl +## Major-Version ....: 1 +## Minor-Version ....: 02 +## Maintained by ....: Axel Apitz +## Description ......: +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 27.11.2007 a_apitz initial Version +## +## 02 29.11.2007 a_apitz adding parameters for list,all,add, +## addall,deleteall,delete +## +################################################################################ + +################################################################################ +## +## Modules +## +################################################################################ + +# Standard Modules +use strict; +use English qw( -no_match_vars ); +use Config::IniFiles; +use Getopt::Long; +use Pod::Usage; + +# Logging Modules +use Log::Dispatch; +use Log::Dispatch::Screen; +use Log::Dispatch::FileRotate; +use Date::Manip; + +# LDAP Modules +use Mozilla::LDAP::Conn; +use Mozilla::LDAP::Utils; +use Mozilla::LDAP::API qw(ldap_url_parse); + +################################################################################ +## +## Vars +## +################################################################################ +## +## name -> description +## +################################################################################ +use vars qw($VERSION $CFGFILE $CFG %OPTS $LOGGER %LDAP $MODE $USER); + +$CFGFILE = '/opt/PPjes/etc/ldap-live2dev.ini'; +$MODE = ''; + +################################################################################ +## +## string get_version() +## +################################################################################ +## +## Return value: +## +## Version of this Script +## +################################################################################ +sub get_version () { + my $version = `awk '/^## Major-Version ....:/ { majorv=\$4 } + /^## Minor-Version ....:/ { minorv=\$4 } + END { print majorv"."minorv }' $0`; + return $version; +} + +################################################################################ +## +## boolean read_config() +## +################################################################################ +## +## Read Configuration Information +## +################################################################################ +## +## Return value: +## +## True on Success +## +################################################################################ +sub read_config() { + $CFG = new Config::IniFiles( -file => $CFGFILE ); + if (! defined($CFG) ) { + foreach (@Config::IniFiles::errors) { + print "ERROR: ",$_; + } + return 0; + } else { + return 1; + } +} + +################################################################################ +## +## boolean read_args() +## +################################################################################ +## +## Parse and read Args +## +################################################################################ +## +## Return value: +## +## True on Success +## +################################################################################ +sub read_args() { + &GetOptions(\%OPTS, + 'help|h|?', + 'man', + 'version|V' => sub {print $VERSION;exit 0;}, + 'config|C=s' => sub {$CFGFILE=$_[1];}, + 'mode|m=s' => sub {$MODE=$_[1];}, + 'quite|q' + ) or pod2usage({ '-verbose' => 0}); + pod2usage({ '-verbose' => 1}) if $OPTS{'help'}; + pod2usage({ '-verbose' => 2}) if $OPTS{'man'}; + pod2usage({ '-verbose' => 0}) unless $MODE =~m/(all|list|add|delete|addall|deleteall)/; + if ($MODE !~ m/(all|list)/) { + pod2usage({ '-verbose' => 0}) unless $#ARGV == 0; + $USER = $ARGV[0]; + } + return 1; +} + +################################################################################ +## +## LOGGER create_logger(); +## +################################################################################ +## +## Init the Logger Object +## +################################################################################ +## +## Return value: +## +## Object from type Log::Dispatcher +## +################################################################################ +sub create_logger() { + my $LOGGER = Log::Dispatch->new(); + + $LOGGER->add( + Log::Dispatch::Screen->new( + name => 'screen', + min_level => 'info', + stderr => 0 + ) + ) unless $OPTS{quite} ; + + $LOGGER->add( + Log::Dispatch::FileRotate->new( + name => 'file', + min_level => 'info', + max => $CFG->val("Config LOG","MaxFiles"), + filename => $CFG->val("Config LOG","LogFile"), + mode => 'append', + TZ => Date_TimeZone(), + callbacks => sub { + my %p = @_; + my $date = UnixDate( scalar(localtime()), + "[%b %e %H:%M:%S] "); + my @message = map { $date.$p{level}." : ".$_ } + split(/^/m,$p{message}); + return join("",@message); + }, + DatePattern => $CFG->val("Config LOG", "DatePattern") + ) + ) unless $MODE =~ m/list/; + + return $LOGGER; +} + +sub connectLDAP { + my $env = shift; + $LOGGER->log( level => "info", + message => " o Connecting to ".$env."\n"); + $LDAP{$env} = new Mozilla::LDAP::Conn($CFG->val("Config LDAP-".$env,"host"), + $CFG->val("Config LDAP-".$env,"port"), + $CFG->val("Config LDAP-".$env,"user"), + $CFG->val("Config LDAP-".$env,"pw")); + die "Could't connect to LDAP server ldap" unless $LDAP{$env}; + +} +################################################################################ +## +## array in_a_not_in_b(arrayref $a, arrayref $b) +## +################################################################################ +## +## Return all values that are in array a, but not in array b +## +################################################################################ +## +## Return value: +## +## An Array all values that are in array a, but not in array b +## +################################################################################ +sub in_a_not_in_b { + my $a = shift; + my $b = shift; + my %seen; + my @aonly; + + @seen{@$b} = (); + + foreach my $item (@$a) { + push(@aonly, $item) unless exists $seen{$item}; + } + + return @aonly; +} + +sub getUsers { + my $env = shift; + my $entry = ''; + my @userdns = (); + + $LOGGER->log( level => "info", + message => " o Reading Userdatabase for ".$env."\n"); + + $entry = $LDAP{$env}->search($CFG->val('Config LDAP-'.$env,'basedn'), + 'sub', + 'objectclass=ppPixelAccount',0,('dn')); + + $LDAP{$env}->printError() if $LDAP{$env}->getErrorCode(); + + while($entry) { + push(@userdns , Mozilla::LDAP::Utils::normalizeDN( $entry->getDN() )); + $entry = $LDAP{$env}->nextEntry(); + } + return @userdns; +} + +sub ldapCopyByDNs { + my $env_src = shift; + my $env_dst = shift; + my @dns = @_; + my $entry = ''; + + foreach my $dn (@dns) { + $LOGGER->log( level => "info", + message => " o copy: ".$dn."\n"); + $entry = $LDAP{$env_src}->search($dn, + 'base', + 'objectclass=*',0); + $LDAP{$env_src}->printError() if $LDAP{$env_src}->getErrorCode(); + + if ( @{$entry->{'mailhost'}}[0] eq 'mail-brln-store02.pixelpark.com' ) { + @{$entry->{'mailhost'}}[0] = 'dev-mail-brln-store02.pixelpark.com'; + } + @{$entry->{'psRoot'}}[0] =~ s/ldap.pixelpark.com/dev-ldap.pixelpark.com/ if defined($entry->{'psRoot'}); + @{$entry->{'pabURI'}}[0] =~ s/ldap.pixelpark.com/dev-ldap.pixelpark.com/ if defined($entry->{'pabURI'}); + + $LDAP{$env_dst}->add($entry) unless $MODE =~ m/list/; + $LDAP{$env_dst}->printError() if $LDAP{$env_dst}->getErrorCode(); + } +} + +sub ldapDeleteByDNs { + my $env = shift; + my @dns = @_; + + foreach my $dn (@dns) { + $LOGGER->log( level => "info", + message => " o delete: ".$dn."\n"); + $LDAP{$env}->delete($dn) unless $MODE =~ m/(list)/; + } +} + +sub closeLDAP { + my $env = shift; + $LOGGER->log( level => "info", + message => " o Close Connectio to ".$env."\n"); + $LDAP{$env}->close(); +} + +################################################################################ +## +## Main +## +################################################################################ +$VERSION = &get_version(); +&read_args() || exit 1; +&read_config() || exit 1; +$LOGGER = &create_logger(); + +$LOGGER->log( level => "info", + message => "LDAP - Live2Dev\n***************\n"); + +connectLDAP('Live'); +connectLDAP('Dev'); + +my @liveusers = getUsers('Live'); +my @devusers = getUsers('Dev'); + +my @users_to_add = in_a_not_in_b(\@liveusers,\@devusers); +my @ignore_to_add = $CFG->val('Config LDAP-Live','ignore'); +@users_to_add = in_a_not_in_b(\@users_to_add,\@ignore_to_add); +@users_to_add = grep(/$USER/,@users_to_add) if defined($USER); + +my @users_to_delete = in_a_not_in_b(\@devusers,\@liveusers); +my @ignore_to_delete = $CFG->val('Config LDAP-Dev','ignore'); +@users_to_delete = in_a_not_in_b(\@users_to_delete,\@ignore_to_delete); +@users_to_delete = grep(/$USER/,@users_to_delete) if defined($USER); + +ldapCopyByDNs('Live','Dev',@users_to_add) unless $MODE =~ m/delete/; +ldapDeleteByDNs('Dev',@users_to_delete) unless $MODE =~ m/add/; + +closeLDAP('Live'); +closeLDAP('Dev'); + +exit 0; + +################################################################################ +## +## Documentation +## +################################################################################ +__END__ + +=head1 ldap-live2dev.pl + +ldap-live2dev.pl - Syncing Live LDAP to Dev LDAP + +=head1 SYNOPSIS + +ldap-live2dev.pl --mode= [user] + + Mode: + list List all needed Changes to sync Live and Dev Environment + all Do all needed Changes to sync Live and Dev Environment + add Add User from Live to Dev Environment + delete Delete User from Dev Environment, if it has been deleted + in Live + addall Add all Useres that are missing in the Dev Environment + deleteall Delete all Useres in the Dev Environment, which have + been deleted in the Live Environment + + Parameter: + user if all or delete is as mode selected, than there + must be an user specified to sync + + Options: + --help brief help message + --man full documentation + --version program Version + +=head1 OPTIONS + +=over 8 + +=item B<--help> + +Print a brief help message and exits. + +=item B<--man> + +Prints the manual page and exits. + +=item B<--version> + +Prints a version information and exits. + +=back + +=head1 DESCRIPTION + +B will Sync users from the Live LDAP Environment +to the Dev LDAP Environment. + +Only missing Users will be copied to the Dev System. Passwords +or other Data from already existing Users are B synced. + +=head1 MODE + +B can be called in five different modes. + +=over 4 + +=item list + +in this mode, the script will act like in all mode, but actually +will do no chenges to the Dev LDAP. Logging to file is disabled. + +=item all + +all needed changes to synnc the user base will be done. That +means missing users will be added to the Dev LDAP. The password +is copied from the Live Environment. Some Addributes are changed +to reflected the Dev Environment. Also all Useres thar are no +more in the Live System will be deleted. + +=item addall + +see B, only add operations are done + +=item deleteall + +see B, only delete operations are done + +=item add + +see B, only add operations are done and only for the user +that was choosen + +=item delete + +see B, only delete operations are done and only for the user +that was choosen + +=back + +=head1 CAVEATS + +B will not Sync passwords or other +attributes ! + +=head1 AUTHOR + +Axel Apitz + +=cut + diff --git a/jes-old/bin/ldap-solaris-monster.sh b/jes-old/bin/ldap-solaris-monster.sh new file mode 100755 index 0000000..fc6978f --- /dev/null +++ b/jes-old/bin/ldap-solaris-monster.sh @@ -0,0 +1,20 @@ +#!/bin/sh +LOGFILES="$@" + +FIND_SOLARIS_BINDS="uid=Solaris_NSS,ou=Unix NSS,ou=Applications,o=pixelpark,o=isp bound" + +OUT=/var/tmp/solaris-monster-out.$$.sh + +grep "${FIND_SOLARIS_BINDS}" ${LOGFILES} | \ + /www/bin/gawk '{ + a[$12]++; + } + END { + for ( i in a ) + print "echo \"`getent hosts "i" | cut -f2` => "a[i]" \""; + }' | \ + sort -k 9n | \ + sed -e 's/, / /' > $OUT + +sh $OUT +rm $OUT diff --git a/jes-old/bin/ldap-user-purge.sh b/jes-old/bin/ldap-user-purge.sh new file mode 100755 index 0000000..884b4ca --- /dev/null +++ b/jes-old/bin/ldap-user-purge.sh @@ -0,0 +1,75 @@ +#!/bin/sh +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: jes-user-purge.sh +## Major-Version ....: 1 +## Minor-Version ....: 01 +## Maintained by ....: Axel Apitz +## Description ......: Script um die als geloescht makierten +## User zu entfernen. +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 14.05.2009 a_apitz initial Version +## +################################################################################ + +################################################################################ +## +## Main +## +################################################################################ + +LDAPS="/opt/SUNWdsee/dsee6/bin/ldapsearch -h ds04.pixelpark.com -p 389 -D cn=admin -w 3o.o0dlt -T " +LDAPD="/opt/SUNWdsee/dsee6/bin/ldapdelete -h ds04.pixelpark.com -p 389 -D cn=admin -w 3o.o0dlt" +LDAPB="/opt/SUNWdsee/dsee6/bin/ldapsearch -h ds04.pixelpark.com -p 389 -D cn=admin -w 3o.o0dlt" +BACKUPDST="/www/backup/ldap-user-purge" + +DOMAINS=`${LDAPS} -b o=isp -s one "sunPreferredDomain=*" sunPreferredDomain | grep 'dn' | cut -b5- ` + + +for domaindn in ${DOMAINS} ; do + + domain=`${LDAPS} -b ${domaindn} -s base "sunPreferredDomain=*" sunPreferredDomain | grep 'sunPreferredDomain' | cut -b20- ` + ( + echo "Purging User for Domain ${domain}" + + echo " - LDAP Server Account" + ACCOUNTS="`${LDAPS} -b ${domaindn} '(&(inetuserstatus=deleted)(|(&(mailuserstatus=active)(!(mailhost=mail-brln-store01.pixelpark.com))(!(mailhost=mail-brln-store02.pixelpark.com)))(mailuserstatus=removed))(icsstatus=removed))' dn | grep '^dn' | cut -b5-" + OIFS=$IFS + IFS=' +' + for account in ${ACCOUNTS} ; do + ( + IFS=${OIFS} + echo " o backup ${account}" + ${LDAPB} -b "${account}" -s base 'objectclass=*' > "${BACKUPDST}/${account}.ldif" + echo " o deleting ${account}" + ${LDAPD} "${account}" + ) + done + IFS=$OIFS + + ) > /var/tmp/purge.report.$$ 2>&1 + sleep 1 + + ( + echo "From: Mail Quota Report " + echo "To: Accountmanager " + echo "Subject: JES User Purge Report for ${domain} (`date +%d/%m/%Y`) - LDAP Server" + echo + cat /var/tmp/purge.report.$$ + echo "." + ) | /usr/lib/sendmail -t + rm /var/tmp/purge.report.$$ + sleep 1 + +done + + +# ./ldapsearch -p 389 -h ds04.pixelpark.com -D cn=admin -w 3o.o0dlt -b o=isp "(&(inetuserstatus=deleted)(|(&(mailuserstatus=active)(!(mailhost=mail-brln-store01.pixelpark.com)))(mailuserstatus=removed))(icsstatus=removed))" dn diff --git a/jes-old/bin/ldapsearch_test.sh b/jes-old/bin/ldapsearch_test.sh new file mode 100755 index 0000000..c35953b --- /dev/null +++ b/jes-old/bin/ldapsearch_test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo "\n ldapsearch -p 391 -b o=isp ou="Applications" "objectclass=*"" +echo "\n" +/opt/SUNWdsee/dsee6/bin/ldapsearch -p 391 -D cn=admin -j /var/opt/SUNWdsee/ds01/admin.pw -b o=isp ou="Applications" "objectclass=*" +echo "\n" diff --git a/jes-old/doc/dps.txt b/jes-old/doc/dps.txt new file mode 100644 index 0000000..321988c --- /dev/null +++ b/jes-old/doc/dps.txt @@ -0,0 +1,12 @@ + -> Directory Proxy Server + +ldap-proxy-status - Liefert einen Status Report ueber den LDAP Service +ldap-proxy-stop - Beendet den LDAP-Server +ldap-proxy-start - Startet den LDAP-Server +ldap-proxy-restart - Restartet den LDAP-Server +ldap-proxy-log-access - Zeigt das aktuelle Access-Log an +ldap-proxy-log-errors - Zeigt das aktuelle Error-Log an + +dpadm - Admin Utility des DPS +dpconf - Admin Utility des DPS + diff --git a/jes-old/doc/ds.txt b/jes-old/doc/ds.txt new file mode 100644 index 0000000..c5a45a9 --- /dev/null +++ b/jes-old/doc/ds.txt @@ -0,0 +1,19 @@ + -> Directory Server + +ldap-status - Liefert einen Status Report ueber den LDAP Service +ldap-stop - Beendet den LDAP-Server +ldap-start - Startet den LDAP-Server +ldap-restart - Restartet den LDAP-Server +ldap-log-access - Zeigt das aktuelle Access-Log an +ldap-log-errors - Zeigt das aktuelle Error-Log an +ldap-init-cache - Pre-Crawler fuer den LDAP Server + +dsadm - Admin Utility des DS +dsconf - Admin Utility des DS + +ldap-cert-add-ca - Fuegt ein neues Certificate hinzu Param 1 = Alias , Param 2 = Pfad +ldap-cert-list-ca - Listet alles CA Certificates +ldap-cert-renew-own - Renew des eigenen Certificates +ldap-cert-show-own-pem - Anzeigen des eigenen Certificates im PEM Format +ldap-cert-show-own-readable - Anzeigen des eigenen Certificates als Text + diff --git a/jes-old/doc/ds_modifications.txt b/jes-old/doc/ds_modifications.txt new file mode 100644 index 0000000..8dc88d5 --- /dev/null +++ b/jes-old/doc/ds_modifications.txt @@ -0,0 +1,7 @@ + + Xplain - Mailserver + ------------------- + ldapsearch -p ${DIRSERV_PORT} -D ${LDAP_ADMIN_USER} -j ${LDAP_ADMIN_PWF} -b o=pixelpark,o=isp '(&(l=*Agentur*Hamburg*)(ou=*Agentur*)(mailhost=mail*))' dn | \ + awk '/^dn/ {print $0;print "changetype: modify"; print "replace: mailhost"; print "mailhost: [192.168.40.1]"; print ""}' | \ + ldapmodify -p ${DIRSERV_PORT} -D ${LDAP_ADMIN_USER} -j ${LDAP_ADMIN_PWF} -c -f - + diff --git a/jes-old/doc/dscc.txt b/jes-old/doc/dscc.txt new file mode 100644 index 0000000..37fe4ce --- /dev/null +++ b/jes-old/doc/dscc.txt @@ -0,0 +1,12 @@ + -> Directory Server Configuration Center + +dscc-db-status - Liefert einen Status Report ueber den LDAP Service +dscc-db-stop - Beendet den LDAP-Server +dscc-db-start - Startet den LDAP-Server +dscc-db-restart - Restartet den LDAP-Server +dscc-db-log-access - Zeigt das aktuelle Access-Log an +dscc-db-log-errors - Zeigt das aktuelle Error-Log an +dscc-view-repl-agmts - Zeigt den Status alle Replikationen +dscc-view-servers - Zeigt alle dem DSCC bekannten LDAP Server +dscc-view-suffixes - Zeigt alle dem DSCC bekannten Suffixe + diff --git a/jes-old/doc/jes.txt b/jes-old/doc/jes.txt new file mode 100644 index 0000000..668e55f --- /dev/null +++ b/jes-old/doc/jes.txt @@ -0,0 +1,11 @@ + + JES - Admin - Help - Aliases + ---------------------------- + + Beschreibung der Kommandos + + + -> Java Enterprise System + +jes-help - Diese Hilfe + diff --git a/jes-old/etc/.gitignore b/jes-old/etc/.gitignore new file mode 100644 index 0000000..2c70470 --- /dev/null +++ b/jes-old/etc/.gitignore @@ -0,0 +1 @@ +*archive* diff --git a/jes-old/etc/PixelparkAddressAutoCompletion_vlv.ldif b/jes-old/etc/PixelparkAddressAutoCompletion_vlv.ldif new file mode 100644 index 0000000..7a01ea6 --- /dev/null +++ b/jes-old/etc/PixelparkAddressAutoCompletion_vlv.ldif @@ -0,0 +1,67 @@ +dn: cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvSearch +cn: PixelparkAddressAutoCompletion +vlvbase: o=pixelpark,o=isp +vlvscope: 2 +vlvfilter: (&(mail=*)(cn=*)(objectclass=posixAccount)(!(objectclass=ppHideThis))) +aci: (targetattr="*")(version 3.0; acl "VLV for Anonymous"; + allow (read,search,compare) userdn="ldap:///anyone";) + +dn: cn=Sort by cn,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Sort by cn +vlvSort: cn + +dn: cn=Reverse Sort by cn,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Reverse Sort by cn +vlvSort: -cn + +dn: cn=Sort by sn,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Sort by sn +vlvSort: sn + +dn: cn=Reverse Sort by sn,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Reverse Sort by sn +vlvSort: -sn + +dn: cn=Sort by mail,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Sort by mail +vlvSort: mail + +dn: cn=Reverse Sort by mail,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Reverse Sort by mail +vlvSort: -mail + +dn: cn=Sort by givenname,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Sort by givenname +vlvSort: givenname + +dn: cn=Reverse Sort by givenname,cn=PixelparkAddressAutoCompletion,cn=ispdb2,cn=ldbm database,cn=plugins,cn=config +changetype: add +objectClass: top +objectClass: vlvIndex +cn: Reverse Sort by givenname +vlvSort: -givenname + diff --git a/jes-old/etc/crontab b/jes-old/etc/crontab new file mode 100644 index 0000000..a05de97 --- /dev/null +++ b/jes-old/etc/crontab @@ -0,0 +1,24 @@ +# Apache Logfile Rotation: #PPwwwrun +55 23 * * * /www/bin/start-program.sh /www/bin age-logs #PPwwwrun +# +# LDAP Backup +# +10 23 * * * /opt/PPjes/bin/ds_backup.csh > /dev/null 2>&1 +# +# Create Confluence Groups +# +5 3 * * * /opt/PPjes/bin/ldap-create-confluence-groups.pl > /dev/null 2>&1 +15 3 * * * /opt/PPjes/bin/ldap-create-confluence-groups.pl --config /opt/PPjes/etc/ldap-create-confluence-groups-extranet.ini > /dev/null 2>&1 +# +# Send User Report - for invoice +# +#1 9 29 * * /opt/PPjes/bin/ldap-user-report.pl > /dev/null 2>&1 +# +# Restart LDAP-Server am Wochenende jeweils um 22:00 Uhr +# +##0 22 * * 6,0 /opt/SUNWdsee/ds6/bin/dsadm stop /var/opt/SUNWdsee/ds01 && /usr/bin/sleep 40 && /opt/SUNWdsee/ds6/bin/dsadm start /var/opt/SUNWdsee/ds01 > /dev/null 2>&1 +# +# Deleted User Clean Up +# --------------------- +30 0 * * * /opt/PPjes/bin/ldap-user-purge.sh > /dev/null 2>&1 + diff --git a/jes-old/etc/cshrc.jes b/jes-old/etc/cshrc.jes new file mode 100644 index 0000000..f251fdc --- /dev/null +++ b/jes-old/etc/cshrc.jes @@ -0,0 +1,109 @@ +# +# JES 7 - Admin Aliases and Env +# + + +# +# Read Config for this host +# +source /opt/PPjes/etc/cshrc.jes.conf + +# +# set global path +# +set -f path = ( /opt/SUNWdsee7/bin $path ) +set -f path = ( /opt/SUNWdsee/dps6/bin $path ) +set -f path = ( /opt/SUNWdsee/ds6/bin $path ) +set -f path = ( /opt/SUNWdsee/dscc6/bin $path ) +set -f path = ( /opt/SUNWdsee/dsee6/bin $path ) + +# +# set global manpath +# +setenv MANPATH "${MANPATH}:/opt/SUNWdsee7/man" + +set JES_HELP_CALL="cat /opt/PPjes/doc/jes.txt" + +# +# set global alias +# +alias sync-jes-scripts "tar cXf /opt/PPjes/etc/sync-exclude - .cshrc /opt/PPjes | ssh \!* '(cd / ; tar xpf - )'" + +# +# set component specific parameters +# + +# - DPS - +echo "${COMPONENTS}" | grep :dps: >& /dev/null +if ( "$status" == "0" ) then + # Alias + set COMMAND=dpadm + alias ldap-proxy-log-access less ${INSTANCE_DIR}/logs/access + alias ldap-proxy-log-errors less ${INSTANCE_DIR}/logs/errors + alias ldap-proxy-stop ${COMMAND} stop ${INSTANCE_DIR} + alias ldap-proxy-start ${COMMAND} start ${INSTANCE_DIR} + alias ldap-proxy-restart ${COMMAND} restart ${INSTANCE_DIR} + alias ldap-proxy-status ${COMMAND} info ${INSTANCE_DIR} + alias ldap-proxy-cert-show-own-readable ${COMMAND} show-cert -F readable ${INSTANCE_DIR} `basename ${INSTANCE_DIR}`servercert + alias ldap-proxy-cert-show-own-pem ${COMMAND} show-cert -F ascii ${INSTANCE_DIR} `basename ${INSTANCE_DIR}`servercert + alias ldap-proxy-cert-add-ca "${COMMAND} add-cert ${INSTANCE_DIR} \!*" + alias ldap-proxy-cert-list-ca "${COMMAND} list-certs -C ${INSTANCE_DIR}" + alias ldap-proxy-cert-remove "${COMMAND} remove-cert ${INSTANCE_DIR} \!*" + # Env + setenv LDAP_ADMIN_PWF ${INSTANCE_DIR}/admin.pw + # Help + set JES_HELP_CALL="${JES_HELP_CALL} /opt/PPjes/doc/dps.txt" +endif + +# - DS - +echo "${COMPONENTS}" | grep :ds: >& /dev/null +if ( "$status" == "0" ) then + # Env + setenv LDAP_ADMIN_USER cn=admin + ##setenv LDAP_ADMIN_USER cn="directory manager" + setenv DIRSERV_PORT 389 + setenv LDAP_ADMIN_PWF ${INSTANCE_DIR}/admin.pw + # Alias + set COMMAND=dsadm + alias ldap-log-access less ${INSTANCE_DIR}/logs/access + alias ldap-log-errors less ${INSTANCE_DIR}/logs/errors + alias ldap-stop ${COMMAND} stop ${INSTANCE_DIR} + alias ldap-start ${COMMAND} start ${INSTANCE_DIR} + alias ldap-restart ${COMMAND} restart ${INSTANCE_DIR} + alias ldap-status ${COMMAND} info ${INSTANCE_DIR} + alias ldap-init-cache 'ldapsearch -p 389 -D cn="admin" -j ${LDAP_ADMIN_PWF} -b o=isp "objectclass=*" > /dev/null ; ldapsearch -p 389 -D cn="admin" -j ${LDAP_ADMIN_PWF} -b o=pab "objectclass=*" > /dev/null ; ldapsearch -p 389 -D cn="admin" -j ${LDAP_ADMIN_PWF} -b o=pp-customer "objectclass=*" > /dev/null ; ldapsearch -p 389 -D cn="admin" -j ${LDAP_ADMIN_PWF} -b o=comms-config "objectclass=*" > /dev/null' + alias ldap-cert-show-own-readable ${COMMAND} show-cert -F readable ${INSTANCE_DIR} defaultCert + alias ldap-cert-show-own-pem ${COMMAND} show-cert -F ascii ${INSTANCE_DIR} defaultCert + alias ldap-cert-renew-own ${COMMAND} renew-selfsign-cert ${INSTANCE_DIR} defaultCert + alias ldap-cert-remove "${COMMAND} remove-cert ${INSTANCE_DIR} \!*" + alias ldap-cert-add-ca "${COMMAND} add-cert -C ${INSTANCE_DIR} \!*" + alias ldap-cert-list-ca "${COMMAND} list-certs -C ${INSTANCE_DIR}" + # Help + set JES_HELP_CALL="${JES_HELP_CALL} /opt/PPjes/doc/ds.txt" +endif + +# - DSCC - +echo "${COMPONENTS}" | grep :dscc: >& /dev/null +if ( "$status" == "0" ) then + # Alias + set COMMAND=dsadm + alias dscc-db-log-access less ${INSTANCE_DIR}/logs/access + alias dscc-db-log-errors less ${INSTANCE_DIR}/logs/errors + alias dscc-db-stop ${COMMAND} stop ${INSTANCE_DIR} + alias dscc-db-start ${COMMAND} start ${INSTANCE_DIR} + alias dscc-db-restart ${COMMAND} restart ${INSTANCE_DIR} + alias dscc-db-status ${COMMAND} info ${INSTANCE_DIR} + alias dscc-status dsccsetup status + alias dscc-view-repl-agmts dsccmon view-repl-agmts + alias dscc-view-servers dsccmon view-servers + alias dscc-view-suffixes dsccmon view-suffixes + # Env + # Help + set JES_HELP_CALL="${JES_HELP_CALL} /opt/PPjes/doc/dscc.txt" +endif + +alias jes-help "${JES_HELP_CALL}" + +if ( $?prompt ) then + echo " -> get help with jes-help" +endif diff --git a/jes-old/etc/cshrc.jes.conf b/jes-old/etc/cshrc.jes.conf new file mode 100644 index 0000000..67a019c --- /dev/null +++ b/jes-old/etc/cshrc.jes.conf @@ -0,0 +1,16 @@ +# +# Config file for JES Aliases and Env +# + +# +# Which Components are active on this host +# +# ::[:] +set COMPONENTS=":ds:" + +# Path to Instance +# jes6 +#setenv INSTANCE_DIR /var/opt/SUNWdsee/ds04 +# jes7 +setenv INSTANCE_DIR /var/opt/SUNWdsee7/ds04 + diff --git a/jes-old/etc/ldap-create-confluence-groups-extranet.ini b/jes-old/etc/ldap-create-confluence-groups-extranet.ini new file mode 100644 index 0000000..16492d6 --- /dev/null +++ b/jes-old/etc/ldap-create-confluence-groups-extranet.ini @@ -0,0 +1,129 @@ +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: ldap-create-confluence-groups-crm.ini +## Major-Version ....: 1 +## Minor-Version ....: 01 +## Maintained by ....: Axel Apitz +## Description ......: +## +## --------------------------- +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 00.00.2005 a_apitz initial Version +## +## 02 26.08.2005 a_apitz 1. Release Version +## +## 03 02.06.2006 a_apitz Added opfides and cib +## +################################################################################ +## +## +################################################################################ +## +## Config LOG +## +################################################################################ +## +## file -> Path to Logfile +## +## DatePattern -> Pattern for Filerotation (weekly rotate) +## (see: perldoc Log::Dispatch::FileRotate) +## +################################################################################ +[Config LOG] +file=/opt/PPjes/var/log/ldap-create-confluence-groups.log +DatePattern=yyyy-ww +## +## +################################################################################ +## +## Config LDAP +## +################################################################################ +## +## host -> LDAP Server Hostname or IP +## +## port -> Port to Connect +## +## basedn -> Base DN +## +## user -> Login User +## +## pw -> Login Password +## +################################################################################ +[Config LDAP] +host=ds04.pixelpark.com +port=389 +user=cn=admin +pw=3o.o0dlt +basedn=ou=crm-groups,ou=confluence,ou=applications,o=pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle Pixelpark Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Alle Pixelpark Mitarbeiter] +dn=cn=Alle Pixelpark Mitarbeiter,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Pixelpark Monitoring (Intern) +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Copy Pixelpark Monitoring (Intern)] +dn=cn=Pixelpark Monitoring (Intern),ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Create Alle +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create Alle] +cn=Alle +filter=(&(objectclass=inetOrgPerson)(|(o=Pixelpark*)(o=Elephant*)(o=Yellow*Tomato*))) +basedn=o=isp +################################################################################ +## +## Convert Administartoren Pixelpark Berlin +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Administratoren Pixelpark Berlin] +dn=cn=Administratoren Pixelpark Berlin,ou=Groups,o=Pixelpark,o=isp +## +## +[Create confluence-administrators] +cn=confluence-administrators +filter=(|(uid=kuntz)(uid=michael.krause)(uid=gerstenberg)(uid=oliver.boettcher)) +basedn=ou=people,o=pixelpark,o=isp + +[Convert PP Extranet Access] +dn=cn=PP Extranet Access,ou=Groups,o=Pixelpark,o=isp diff --git a/jes-old/etc/ldap-create-confluence-groups.ini b/jes-old/etc/ldap-create-confluence-groups.ini new file mode 100644 index 0000000..4ec2c9c --- /dev/null +++ b/jes-old/etc/ldap-create-confluence-groups.ini @@ -0,0 +1,513 @@ +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: ldap-create-confluence-groups.ini +## Major-Version ....: 1 +## Minor-Version ....: 01 +## Maintained by ....: Axel Apitz +## Description ......: +## +## --------------------------- +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 00.00.2005 a_apitz initial Version +## +## 02 26.08.2005 a_apitz 1. Release Version +## +## 03 02.06.2006 a_apitz Added opfides and cib +## +################################################################################ +## +## +################################################################################ +## +## Config LOG +## +################################################################################ +## +## file -> Path to Logfile +## +## DatePattern -> Pattern for Filerotation (weekly rotate) +## (see: perldoc Log::Dispatch::FileRotate) +## +################################################################################ +[Config LOG] +file=/opt/PPjes/var/log/ldap-create-confluence-groups.log +DatePattern=yyyy-ww +## +## +################################################################################ +## +## Config LDAP +## +################################################################################ +## +## host -> LDAP Server Hostname or IP +## +## port -> Port to Connect +## +## basedn -> Base DN +## +## user -> Login User +## +## pw -> Login Password +## +################################################################################ +[Config LDAP] +host=ds04.pixelpark.com +port=389 +user=cn=admin +pw=3o.o0dlt +basedn=ou=groups,ou=confluence,ou=applications,o=pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle E7 Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert Alle E7 Mitarbeiter] +###dn=cn=Alle E7 Mitarbeiter,ou=Groups,o=Pixelpark,o=isp +################################################################################ +## +## Convert Alle Yellow Tomato Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +### [Convert Alle Yellow Tomato Mitarbeiter] +### dn=cn=Alle Yellow Tomato Mitarbeiter,ou=Groups,o=Pixelpark,o=isp +################################################################################ +## +## Convert Alle MT Digital Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Administratoren Pixelpark Berlin] +dn=cn=Administratoren Pixelpark Berlin,ou=Groups,o=Pixelpark,o=isp +################################################################################ +## +## Convert Developer Pixelpark Berlin +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Developer Pixelpark Berlin] +dn=cn=Developer Pixelpark Berlin,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle Berliner Pixelpark Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Alle Berliner Pixelpark Mitarbeiter] +dn=cn=Alle Berliner Pixelpark Mitarbeiter,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle Berliner Pixelpark Mitarbeiter Confluence +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert Alle Berliner Pixelpark Mitarbeiter Confluence] +dn=cn=Alle Berliner Pixelpark Mitarbeiter Confluence,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle Pixelpark Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert Alle Pixelpark Mitarbeiter] +###dn=cn=Alle Pixelpark Mitarbeiter,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle Pixelpark Solutions Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +## +## Convert PP Agentur +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert PP Agentur] +dn=cn=PP Agentur,ou=Groups,o=Pixelpark,o=isp +################################################################################ +## +## Convert PP Agentur Exterrn +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert PP Agentur Berlin - Extern] +###dn=cn=PP Agentur Berlin - Extern,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert PP Agentur Berlin +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Convert PP Agentur Berlin] +dn=cn=PP Agentur Berlin,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert PP Agentur Hamburg +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert PP Agentur Hamburg] +###dn=cn=PP Agentur Hamburg,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Convert Alle CIB Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert Alle CIB Mitarbeiter] +###dn=cn=Alle CIB Mitarbeiter,ou=Groups,o=CIB,o=isp +## +## +################################################################################ +## +## Convert Alle Opfides Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +###[Convert Alle Opfides Mitarbeiter] +###dn=cn=Alle Opfides Mitarbeiter,ou=Groups,o=Opfides,o=isp +################################################################################ +## +## Copy Pixelpark Monitoring (Intern) +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Copy Pixelpark Monitoring (Intern)] +dn=cn=Pixelpark Monitoring (Intern),ou=Groups,o=Pixelpark,o=isp +################################################################################ +## +## Copy Finazbuchhaltung +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Copy Finanzbuchhaltung] +dn=cn=Finanzbuchhaltung,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Copy Konzeption Berlin +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Copy BuK] +dn=cn=Konzeption Berlin,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Copy Design Berlin +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Copy DB] +dn=cn=Design Berlin,ou=Groups,o=Pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Leiter +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - HR-Leiter] +cn=HR-Tool - HR-Leiter +filter=(ppApplicationRight=jobapplication:hrdirector) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Tool - Assistenz +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - Assistenz] +cn=HR-Tool - Assistenz +filter=(ppApplicationRight=jobapplication:assistance) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Tool - HR-Assistenz +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - HR-Assistenz] +cn=HR-Tool - HR-Assistenz +filter=(ppApplicationRight=jobapplication:hrassistance) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Tool - HR-Referent +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - HR-Referent] +cn=HR-Tool - HR-Referent +filter=(ppApplicationRight=jobapplication:hrreferee) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Tool - Fuehrung Personal +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - Fuehrung Personal] +cn=HR-Tool - Fuehrung Personal +filter=(ppApplicationRight=jobapplication:managerhr) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create HR-Tool - Fuehrung Fachlich +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create HR-Tool - Fuehrung Fachlich] +cn=HR-Tool - Fuehrung Fachlich +filter=(ppApplicationRight=jobapplication:managertech) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create Alle +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create Alle] +cn=Alle +##filter=(&(objectclass=inetOrgPerson)(|(o=Pixelpark*)(o=Elephant*)(o=Yellow*Tomato*))) +filter=(&(objectclass=inetOrgPerson)(objectclass=ppPixelAccount)(|(o=Pixelpark*)(o=Elephant*)(o=Yellow*Tomato*))) +basedn=o=isp +## +## +################################################################################ +## +## Create Alle Pixelpark Mitarbeiter +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create Alle Pixelpark Mitarbeiter] +cn=Alle Pixelpark Mitarbeiter +filter=(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ppApplicationRight=intranet:access)(!(|(ou=*Extern)(ppNoCircularMail=true)))(|(ou=Agentur*)(ou=Holding*)(ou=Pixelpark Bielefeld)(ou=Pixelpark Nettec))) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create Alle Koelner Pixelpark Mitarbeiter +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create Alle Koelner Pixelpark Mitarbeiter] +cn=Alle Koelner Pixelpark Mitarbeiter +#filter=(&(objectclass=ppPixelAccount)(l=Pixelpark*Koeln)) +filter=(&(inetuserstatus=active)(objectclass=*)(mail=*)(ppApplicationRight=intranet:access)(ou=Agentur*)(l=Pixelpark*Koeln)(!(ppNoCircularMail=*))) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create PP Agentur Koeln +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Create PP Agentur Koeln] +cn=PP Agentur Koeln +filter=(&(objectclass=ppPixelAccount)(l=Pixelpark*Koeln)) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create PP Agentur Berlin - Extern +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create PP Agentur Berlin - Extern] +cn=PP Agentur Berlin - Extern +filter=(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ppApplicationRight=intranet:access)(ou=Agentur - Extern)(l=Pixelpark Berlin)(!(ppNoCircularMail=true))) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create Alle E7 Mitarbeiter +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +################################################################################ +[Create Alle E7 Mitarbeiter] +cn=Alle E7 Mitarbeiter +filter=(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ppApplicationRight=intranet:access)(ou=Elephant*Seven*)(!(ppNoCircularMail=true))) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create Alle Performance Mitarbeiter ehemalige Yellow Tomato Mitarbeiter +## +################################################################################ +## +## dn -> DN of Dyn Group to convert +## +################################################################################ +[Create Alle Performance Mitarbeiter] +cn=Alle Performance Mitarbeiter +filter=(&(inetuserstatus=active)(mailuserstatus=active)(objectclass=pppixelaccount)(mail=*)(ou=Yellow*Tomato*)(!(ppNoCircularMail=true))) +basedn=ou=people,o=pixelpark,o=isp +## +## +################################################################################ +## +## Create confluence-administrators +## +################################################################################ +[Create confluence-administrators] +cn=confluence-administrators +filter=(|(uid=kuntz)(uid=michael.krause)(uid=gerstenberg)(uid=oliver.boettcher)(uid=thomas.kotschok)(uid=wildpark_opensearch_admin)) +basedn=ou=people,o=pixelpark,o=isp diff --git a/jes-old/etc/ldap-live2dev.ini b/jes-old/etc/ldap-live2dev.ini new file mode 100644 index 0000000..19729fe --- /dev/null +++ b/jes-old/etc/ldap-live2dev.ini @@ -0,0 +1,95 @@ +################################################################################ +## +## Header details +## +## Copyright ........: Pixelpark AG +## File ........ ....: skeleton.ini +## Major-Version ....: 1 +## Minor-Version ....: 01 +## Maintained by ....: Axel Apitz +## Description ......: +## +## --------------------------- +## +## History ..........: +## +## Vers. Date By Reason +## ----- ----------- ---------------- --------------------------------------- +## 01 00.00.2007 a_apitz initial Version +## +################################################################################ +## +## +################################################################################ +## +## Config LOG +## +################################################################################ +## +## file -> Path to Logfile +## +## DatePattern -> Pattern for Filerotation (weekly rotate at Sun 8:45) +## (see: perldoc Log::Dispatch::FileRotate) +## +################################################################################ +[Config LOG] +LogFile=/opt/PPjes/var/log/ldap-live2dev.log +DatePattern=0:0:1*0:8:45:0 +MaxFiles=10 +# +[Config LDAP-Live] +host=ds04.pixelpark.com +port=389 +user=cn=admin +pw=3o.o0dlt +basedn=ou=people,o=pixelpark,o=isp +ignore=< Path to Logfile +## +## DatePattern -> Pattern for Filerotation (weekly rotate) +## (see: perldoc Log::Dispatch::FileRotate) +## +################################################################################ +[Config LOG] +file=/var/log/skeleteon.log +DatePattern=yyyy-ww +## +## +################################################################################ +## +## Config LDAP +## +################################################################################ +## +## host -> LDAP Server Hostname or IP +## +## port -> Port to Connect +## +## basedn -> Base DN +## +## user -> Login User +## +## pw -> Login Password +## +################################################################################ +[Config LDAP] +host=ds04.pixelpark.com +port=389 +user=cn=admin +pw=3o.o0dlt +## +## +################################################################################ +## +## Report Pixelpark AG - Berlin +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +[Report Pixelpark AG - Berlin] +filter=(&(l=Pixelpark Berlin)(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +basedn=ou=people,o=pixelpark,o=isp +exclude=< +mail_to=Teamassistants +mail_cc=< +EOT +mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report Pixelpark AG - Koeln +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +#[Report Pixelpark AG - Koeln] +#filter=(&(l=Pixelpark Koeln)(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +#basedn=ou=people,o=pixelpark,o=isp +#exclude=< +#mail_to=Teamassistants +#mail_cc=< +#EOT +#mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report Pixelpark Solutions GmbH +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +##[Report Pixelpark Solutions GmbH] +##filter=(&(l=Pixelpark Solutions Hamburg)(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +##basedn=ou=people,o=pixelpark,o=isp +##exclude=< +##mail_to=Teamassistants +##mail_cc=< +##EOT +##mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report Pixelpark Agentur Berlin GmbH +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +[Report Pixelpark Agentur Berlin GmbH] +filter=(&(l=Pixelpark Berlin)(ou=Agentur)(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +basedn=ou=people,o=pixelpark,o=isp +exclude=< +mail_to=Teamassistants +mail_cc=< +EOT +mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report Pixelpark Technology Services Berlin GmbH +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +##[Report Pixelpark Technology Services Berlin GmbH] +##filter=(&(l=Pixelpark Technology Services Berlin)(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +##basedn=ou=people,o=pixelpark,o=isp +##exclude=< +##mail_to=Teamassistants +##mail_cc=< +##EOT +##mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report ZLU +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +###[Report ZLU] +###filter=(&(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +###basedn=ou=people,o=zlu,o=isp +###exclude=< +###mail_to=Teamassistants +###mail_cc=< +###EOT +###mail_subject=_NAME_ - _DATE_ +## +## +################################################################################# +### +### Report Visioplant +### +################################################################################# +### +### filter -> LDAP Filter to use +### +### basedn -> Base DN +### +### exclude -> User List to exclude +### +### include -> User List to include +### +################################################################################# +####[Report Visioplant] +####filter=(&(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +####basedn=ou=people,o=visioplant,o=isp +####exclude=< +####mail_to=Teamassistants +####mail_cc=< +####EOT +####mail_subject=_NAME_ - _DATE_ +### +### +################################################################################ +## +## Report CIB +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +###[Report CIB] +###filter=(&(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +###basedn=ou=people,o=cib,o=isp +###exclude=< +###mail_to=Teamassistants +###mail_cc=< +###EOT +###mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report Opfides +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +###[Report Opfides] +###filter=(&(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +###basedn=ou=people,o=opfides,o=isp +###exclude=< +###mail_to=Teamassistants +###mail_cc=< +###EOT +###mail_subject=_NAME_ - _DATE_ +## +## +################################################################################ +## +## Report BMWA +## +################################################################################ +## +## filter -> LDAP Filter to use +## +## basedn -> Base DN +## +## exclude -> User List to exclude +## +## include -> User List to include +## +################################################################################ +[Report BMWA] +filter=(&(inetUserStatus=Active)(mailhost=mail-brln-store01.pixelpark.com)) +basedn=ou=people,o=bmwa,o=isp +exclude=< +mail_to=Teamassistants +mail_cc=< +EOT +mail_subject=_NAME_ - _DATE_ diff --git a/jes-old/etc/sync-exclude b/jes-old/etc/sync-exclude new file mode 100644 index 0000000..d0e1cc3 --- /dev/null +++ b/jes-old/etc/sync-exclude @@ -0,0 +1 @@ +/opt/PPjes/etc/cshrc.jes.conf diff --git a/jes-old/ldif_template/.gitignore b/jes-old/ldif_template/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/jes-old/ldif_template/.gitignore @@ -0,0 +1 @@ +* diff --git a/jes-old/ldif_template/.gitkeep b/jes-old/ldif_template/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/jes-old/var/log/.gitkeep b/jes-old/var/log/.gitkeep new file mode 100644 index 0000000..e69de29