LiquidObject

Messagetracking log compilation

If you ever needed to quickly all external messages sent to your organization but have the problem of multiple transport servers, the below script should help give some insight into the messages recently received.

$myminutes = 1
$myservers = "cashub-1","cashub-2","cashub-3"
$mydomain = "testdomain.local"

cls
$mystart = (Get-Date).addminutes(-$myminutes)
foreach($myserver in $myservers)
	{
		Write-host "------------------- start " $myserver "-------------------"
		Get-MessageTrackingLog -Start $mystart -server $myserver | where {($_.Sender -notlike "*$mydomain") -and ($_.Source -eq "SMTP")}
		Write-host "-------------------   end " $myserver "-------------------`n"
	}
, ,
July 30, 2012 at 3:54 am Comments (0)

Slow snapshots with VMware

Within vSphere one of the common features available is the ability to take snapshots. For a couple of years now taking snapshots had an option called “Snapshot the virtual machine’s memory” which would snapshot the target VM with a perfect run time state snapshot.

This feature comes at a price time. Recently I’ve been going after some of the larger servers in my environment, in this particular test case some new Exchange CAS/HUB servers. When taking a snapshot normally it would complete within 5 seconds. However, with the given VM’s running 4vCPU and 8GB ram each taking a snapshot of the VM’s memory was taking over 21 minutes on creation. The issue only shows itself during creation when merging snapshots back together there is no unusual delay.

Now there is a way to enhance the perform, however it requires manually editing the vmx config file by hand, via powercli, or via the vSphere client.

Here’s how with the vSphere client.

With the given VM powered off, edit it and select the options tab.

Select Configuration Parameters and then “Add Row” twice then insert the following:

Name: mainMem.ioBlockPages
Value: 2048

Name: mainMem.iowait
Value: 2

Then select “Ok” twice and power back on the VM to test it again.

With the same VM the second time around it took just under 2 minutes and 20 seconds, saving myself almost 20 minutes per snapshot.

As with anything please test this yourself, I would assume your mileage would vary depending upon your configuration. When looking to implement this on a large scale of dozens, hundreds, ect VM’s you would need to leverage PowerCLI. To shutdown, edit, and power back on each VM.

, , , ,
July 27, 2012 at 3:13 pm Comments (0)

Simple CSR generation for Apache/Tomcat on Windows

Under the KISS method generating Apache/Tomcat certificate requests (CSRs) under Windows can be a pain if you don’t do it that often. Below is a sample batch script to automatically generate the certificates for you.

echo off
REM building up the variables

set myFQDN=%COMPUTERNAME%.liquidobject.com
set myFileBase=%COMPUTERNAME%_liquidobject.com
set myJavaPath=C:\jdk1.6.0_14\bin\
set myOutputPath=C:\ssl_keys\
set myKeySize=2048
set myOrganization=OU=My Department, O=My Business, L=My City, ST=My State, C=us

REM variables set
cls
echo.
echo.
echo Generating a certificate for %myFQDN%, please wait...
echo.
echo.
echo Please supply a password for the keystore file
echo.
%myJavaPath%keytool -genkey -alias server -keyalg RSA -keysize %myKeySize% -keystore %myOutputPath%%myFileBase%.jks -dname "CN=%myFQDN%, %myOrganization%"
%myJavaPath%keytool -certreq -alias server -file %myOutputPath%%myFileBase%.csr -keystore %myOutputPath%%myFileBase%.jks
echo.
echo.
echo Your certificate signing request is in %myFileBase%.csr.
echo Your keystore file is %myFileBase%.jks.
echo.
echo.
echo CSR output below:
echo.
more %myOutputPath%%myFileBase%.csr
echo on
, , ,
July 12, 2012 at 3:10 am Comments (0)