Skip to main content

Posts

Showing posts from February, 2012

Backup OpenLDAP Ubuntu

The default database location is /usr/lib/ldap It is recommended to backup to LDIF so it is transportable. Use slapcat to export. slapcat -v -l /backups/ldapbackup.ldif To restore use slapadd. cd /usr/lib/ldap rm * slapadd -l ldapbackup.ldif -v is verbose output -l specifies the ldif format

Delete Files Older Than x Days

Applies to FreeBSD and Linux. /mnt       /backup1                    /server1                               /folder1                               /folder2                               /backup1.tar.gz                            /server2                    /server3 find /mnt/backup1 -maxdepth 2 -name '*.gz' -mtime +7 -exec rm {} \; This will find and remove files that are 7 days old. It will search 2 folders deep from /mnt/backup1. It will not search folder1 or folder2. The single quotes around the name search string are required at least on FreeBSD.

HP SNMP agents and Ubuntu

This will allow you to monitor HP hardware, i.e. RAID controller, degraded disk etc. This was done on Ubuntu 10.04 wget http://downloads.linux.hp.com/SDR/downloads/bootstrap.sh chmod +x bootstrap.sh ./bootstrap.sh -r ProLiantSupportPack (this adds the HP repo to apt's sources) wget http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/GPG-KEY-ProLiantSupportPack apt-key add GPG-KEY-ProLiantSupportPack aptitude update apt-get install  hp-snmp-agents apt-get install net-snmp (or apt-get install snmp for later versions ) /sbin/hpsnmpconfig - Follow the prompts nano /etc/default/snmpd # modify this line, replacing x.x.x.x with your public facing IP if needed SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1 x.x.x.x' ########################################## Restart snmp /etc/init.d/snmpd restart Start the agents! /etc/init.d/hp-snmp-agents start Test with snmpwalk -v 1 -c rocom loc