Data recovery of BTRFS Soft RAID

Data Recovery of Software RAID5 with BTRFS At Computer Assistance we are used to doing advanced data recovery jobs but this one brought to us by an anxious client deserves writing about. The client brought us a Netgear NAS with 4 disks configured in RAID 5. The Netgear was showing the raid as ‘Failed’ - very help. Read on to see how we fixed the issue and ended up with a very happy client and complete data recovery. [Read More]

Boost your VMXNET3 for Maximum Performance

Boosting the performance of VMXNET3 on Windows Server 2012 R2 We have hade a numerous issues with slugish network performacen, or high netowrk latenancy on our MS SQL vm. If you have had such bad luck, especially with MS SQL Server and async_network_io, then you know how “easy” is to track down the issue. Although there are loads of people, saying that “If you run e1000 you will be OK, and you won’t have those problems” this adapter is quite old and depricated and it’s no longer supported on Server 2012 . [Read More]

Create an image your disk using DD

Create disk image Boot from a live media. Make sure no partitions are mounted from the source hard drive. Mount the external HDD Backup the drive. dd if=/dev/sdX conv=sync,noerror bs=64K | gzip -c > /path/to/backup.img.gz If necessary (e.g. when the format of the external HD is FAT32) split the disk image in volumes (see also the split man pages). dd if=/dev/sdX conv=sync,noerror bs=64K | gzip -c | split -a3 -b2G - /path/to/backup. [Read More]

Exchange 2013 import multiple pst’s

Here is a simple loop with which you can go through you all mailboxes you have and restore/import a pst.

1 `foreach ($i in (Get-Mailbox)) { New-MailboxImportRequest -Mailbox $i -FilePath "\\Server\share\$($i.Name).pst"; -baditemlimit 50 -acceptlargedataloss ;while ((Get-MailboxImportRequest -mailbox $i | ? {$\_.Status -eq "Queued"; -or $\_.Status -eq "InProgress"})) { sleep 120 } }` 

#PST files must be named accordingly - Mailbox name e.g. John.Doe - John.Doe.pst

Monitoring Office 365 Mailbox size

############################################## #### Check Mailbox size Offce 365 ############ ############################################## $MailUser = $args[0] $MailPWD = $args[1] $SecureMailPWD = Convertto-SecureString –String $MailPWD –AsPlainText –force $mailCred = New-object System.Management.Automation.PSCredential $MailUser, $SecureMailPWD $To="your@email" $From="server123" $SMTPServer=$args[2] ############################################# #### Login Details for Office 365 ########### ############################################# $username = $args[3] $pwd = $args[4] $SecurePassword=Convertto-SecureString –String $pwd –AsPlainText –force $MyCredentials=New-object System.Management.Automation.PSCredential $username,$SecurePassword $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $MyCredentials -Authentication Basic -AllowRedirection ############################################# Import-PSSession $Session -DisableNameChecking | Out-Null $query = (Get-Mailbox -ResultSize Unlimited | where {$_. [Read More]

Check for Veeam Endpoint Backup

################################################################################################## ##### Icinga check for Veeam Enedpoint Backup. It does check of the last backup date. ##### ##### Accepted arguments are: BackupJobName and period of days for backup e.g a > b = fail:) ##### ################################################################################################## ################################################################################################## ##### Icinga check for Veeam Enedpoint Backup. It does check of the last backup date. ##### ##### Accepted arguments are: BackupJobName and period of days for backup e.g a > b = fail:) ##### ################################################################################################## asnp VeeamPSSnapin $name = $args[0] $period = $args[1] $job = Get-VBRBackup -Name $name $name = "'" + $name + "'" $status = $job. [Read More]

Postfix - queue cleaner

If you run a postfix mail server with multiple domains and you want to delete from the queue all messages sent from a certain domain:

mailq | awk '$7 ~ /@domain.tld$/ { print $1 }' | tr -d '*!' | postsuper -d

Install Webacula

I came across this tool as I had to setup a GUI interface for the non-GUI people in my company. This is probably most powerfull tool for managing bacula-director. It is a bit tricky to make it work but once it’s running nothing can stop it (even sometimes you can’t) I have used Webacula v7.0.0, but it might worth cheching the latest relese wget http://downloads.sourceforge.net/project/webacula/webacula/7.0.0/webacula-7.0.0.tar.gz If you have already LAMP stack, you can skip this step [Read More]

Nagios check_datastore

Check esxi datastore free space #!/usr/bin/python from pysphere import VIServer, VIProperty import sys ok = 160000 warn_value = 150000 crit_value = 100000 status = { 'OK' : 0 , 'WARNING' : 1, 'CRITICAL' : 2 , 'UNKNOWN' : 3} server = sys.argv[1] user = sys.argv[2] pwd = sys.argv[3] warn = False crit = False lowestFreeSpace = None s = VIServer() s.connect(server, user, pwd) for ds, name in s.get_datastores().items(): props = VIProperty(s, ds) freeSpace = props. [Read More]

Nagios check_esxi_snapshots

This script is using pySphere api for esxi and do loop through all vms and checks for snapshots. #!/usr/bin/python from pysphere import VIServer import sys ok = 0 warn = 1 crit = 2 status = { 'OK' : 0 , 'WARNING' : 1, 'CRITICAL' : 2 , 'UNKNOWN' : 3} server = sys.argv[1] user = sys.argv[2] pwd = sys.argv[3] s = VIServer() s.connect(server, user, pwd) names = "" result = s. [Read More]