Thursday, October 27, 2011

Remote Server Monitoring with MobilePCMonitor



While I'm a big fan of systems like Solarwinds and other network/server/device monitoring solutions for larger corporate environments, there are many cases where one simply wants to monitor a few critical servers.  As if anyone needed another reason to buy a smartphone, take a look at MobilePCMonitor.  The beauty of this solution is it's hybrid approach, with an agent residing on the server or PC you wish to monitor, reporting to a hosted service at MPcM's datacenter.  So, while you have an agent to install on your machine(s), there's no server setup in your environment to make this work.  And, it gets better.  MPcM isn't just redlight/greenlight monitoring, you can tag services to monitor, disk space thresholds, cpu utilization, and more.  Should you get an alert on your smartphone (there are iOS, Android and WinPhone7 apps), you can log into your PC from the mobile app and perform a myriad of tasks instead of breaking out the laptop and hoping to get a reliable VPN connection via your cellular modem.  Still not convinced?  It's free to try for up to 3 monitored devices, and for up to 25 devices it's only $181 per year (total, not per device), making it a real bargain.

Key Features:

Monitor:
    * View the status and uptime of all computers
    * View the current CPU usage and usage history chart
    * View the current available memory and usage history chart
    * View the external IP address and the location on the map using GeoIP
    * View ping round trip response time and response time chart
    * View the status and browse the local hard disks
    * View the services status
    * View the network interfaces status and traffic chart
    * View running processes
    * View event logs
    * View the scheduled tasks status
    * View monitored ports status
    * View all logged in users (local and remote)
    * View hardware details like temperatures (system, CPU and HDD) and fan speeds (system and CPU)
    * View the status of web sites and application pools in Internet Information Server
    * Search and view user accounts status in Active Directory
    * View the list of locked user accounts in Active Directory
    * View the list of user groups in Active Directory
    * View performance counters

Send Commands:
    * Start, pause, continue and stop a service
    * Kill a process
    * Start and stop a scheduled task
    * Log off any logged in user (local or remote)
    * Send a message to the logged in users (local or remote)
    * Command prompt support
    * Restart, wake up (Wake on WAN over Internet is supported), shutdown, power off, suspend or send the computer into hibernation
    * Send commands to multiple computers in the same group
    * Start/stop/restart Internet Information Server web sites
    * Start/stop/recycle Internet Information Server application pools
    * Enable, disable, unlock and reset password for user accounts in Active Directory
    * Add and remove groups for a user account in Active Directory
    * Check and install Windows updates
    * Monitor and manage Exchange 2007 and 2010
    * Hyper-V support
    * Printers management
    * Mobile device authorization for system commands - only selected authorized devices on your account can be allowed to send system commands

Get Notified:
    * When a computer goes offline
    * When a computer starts up, shuts down, suspends or resumes
    * When a computer battery level is low
    * When a monitored service stopped unexpectedly
    * When the free memory is below a specified percentage
    * When the processor usage is above a specified percentage for a specified period of time
    * When the free space of a hard disk drive is below a specified percentage
    * When a user logs in or logs out
    * When ping round trip time is above a specified value for a specified period of time
    * When a monitored port is closed
    * When an event log entry is generated and it matches a specified filter
    * When the CPU, system or HDD temperature exceeds a specified threshold
    * When the CPU or system fan speed is below a specified threshold
    * When a web site has stopped on Internet Information Server
    * When an application pool has stopped on Internet Information Server

This is a great solution for smaller environments where you simply need notification in case of a problem, and the ability to quickly resolve the problem remotely via your smartphone.  They also have a dashboard application you can run on your PC to constantly show monitored device status.  For larger environments they offer an Enterprise version that you can run on an internal server instead of relying on their hosted service.
...

Wednesday, October 19, 2011

Clonezilla disk imaging



If you haven't tried it yet, let me highly recommend Clonezilla for simple disk imaging. An indispensable tool for us techies who want to save an existing disk state before effing up someone's server or PC, the fact that you can create a usb bootable version and carry it around with you is priceless.  I can't tell you how many times I've used this utility and the countless number of times it has saved my arse by being able to restore a disk (or just a single partition) to it's previous state.

You can visit the Clonezilla.org website to get the details and I'll outline here the step necessary for creating a bootable USB stick.  You can go here to download the ZIP file you'll need to create the USB bootable install or just let Tuxboot do all the work for you (my preference).  You'll need Tuxboot which you can get here and a USB stick which you'll need to insert and determine the drive letter assigned before we get started.  If not already formatted as FAT32, you can do so in Windows Explorer.  That said, the install is very small (less than 200MB) so an small USB stick will be perfect for this use - surely you have some 256MB or 512MB drive laying around that you thought you had no use for anymore.

Ok, the next steps are pretty easy once you have the Tuxboot file downloaded and USB stick inserted.

1) Run the Tuxboot executable (no install necessary)
2) By default the Clonezilla Live option button is selected at the top left.
3) click the button to the right to get the latest version
4) go to the bottom of the installer screen and select USB Drive (the default)
5) select the USB to install to and click on OK
6) let Tuxboot do it's magic and once done - you have a bootable USB drive with Clonezilla installed

I won't go into the details of using CloneZilla since you can get all the detailed use instructions here directly from the CloneZilla site. For you Windows 7 users, when you exit Clonezilla it will give the an error message, just click on "this program installed correctly" and all will be fine.

I recently used this on a brand new HP Slimline PC I had bought for testing some VMware ESXi v5.0.  I imaged the disk on the PC (first ever boot was to the USB via HP's F11 select boot option) to an external 1TB USB disk drive (whole disk image).  I installed my VMware ESXi 5.0 which proceeded to wipe the internal disk clean and install a multiple partitions and VMFS on the drive and was able to complete my testing.  Once done, I simply rebooted to the Clonezilla USB stick, restored the drive to it's original state and all was well.  Actually, I tested to make sure it worked by booting and making sure the disk came up to the "first boot" screens for HP setup and then shut down and re-imaged.  Not a lack of confidence in the Clonezille restore, just my good ole' "measure twice, cut once" approach.  Oh, and for those older PCs or servers that won't boot from USB, just download the Clonezilla ISO and burn a CD - some greatness available there albeit a little slower.

Thursday, October 13, 2011

Mounting VHD in Win7



Ok, this will be a very short post.  VHD virtual disk files can be mounted from within Windows 7 and used as a disk drive.  While I won't dwell on the many potential uses of this, here's a short overview of a recent desktop PC conversion experience.  Setting: old pentium PC with 40GB internal disk drive, and an external 40Gb USB drive that is slam full of pics and videos, with only a few hundred megabytes free.

First, you can get Disk2VHD from the Microsoft SysInternals website.  Instructions for use are on the download page as well. 

There's a simple GUI interface you can use or there's the command line option
example: disk2vhd * g:\vhd\myoldpc.vhd  - this will copy all volumes (*) to the path on g:, in my case an external USB disk.

Once I converted the internal disk to a VHD file on an external USB drive, I then moved the USB drive to the new PC and copied the VHD file over.  Then, thru the magic of disk manager (Start > right click on Computer >Manage>Storage>Disk Management) there appears on the right hand side of the screen - Disk Management>More Actions - the next menu shows an option to Attach VHD and then the following screen appears:






From there, you can then browse to the VHD file, select, mount and assign a drive letter.  Voila', you can now use the VHD as a native disk (or read only copy should you check the Read-Only box) in Windows 7.






Wednesday, October 5, 2011

TCP Keep Alive in Windows Vista and Server 2008

Most if not all of my posts are borne from the technology equivalent of a bare knuckles cage match in which I am paired with a technology foe heavier, taller and with longer arms... but luckily over the course of my years I've come out bruised and battered but triumphant a greater percentage of the time.  A recent challenge involved telnet sessions from a PC running Vista Business (don't laugh, there are some out there) continuously dropping their connections to a remote AIX host.  So, that's the intro, and in the details to follow you'll see how bruised I became but still ended up with a small victory.

To further set this up, understand that the remote site was previously connected to the home office site via an ATT MPLS circuit (T1), same PCs, and were having no connectivity issues.  A location change brought the opportunity to use a cable modem (16Mbs down/4Mbs up) and a Cisco ASA5505 to create a VPN connection back to corporate - much less expensive than a 3Mbs MPLS circuit and faster install at the new location.  And that's when the trouble started.  The PCs from the old location were moved and the VPN set up (host firewall is an ASA5510 on a remote cable internet circuit).  The reports were that if you left the PC running eTerm32 telnet to the AIX host for over 30 minutes without touching the keyboard, the session would drop.  Very frustrating because if you were in the middle of entering a long order you had to start over.  So, the assumption was it was a cable problem - so we spent days working with the cable company - all clear (yeah, I've heard that story before too).  So, we then moved to thinking maybe it was the 5505/5510 VPN tunnel - after a few calls with Cisco TAC and some minor adustments - still no resolution.

Now it's said that even a blind squirrel can sometimes find an acorn and what happens next may be just that, but here are the next set of tests.  I took an Ubuntu Linux server to the host site, set up with open SSH (yeah, tried SSH on the AIX box and sessions still dropped).  Using Putty on one of the Vista PCs I set up an ssh session to the Linux server and left it running overnight - to my surprise it was still working fine the next day.  Tried it again with eTerm32 to Linux and still, no dropped connections.  At this point we dove into AIX settings with IBM, all systems go, no detectable problems there.  Then, I put a Windows Server 2003 server at the host site running Terminal Services and then ran RDP sessions on the Vista PCs with eTerm32 running in the RDP on the terminal server - while we didn't have any dropped sessions, we did notice some times when you walked away and came back it would take a few mouse clicks or keystrokes, for it to respond.  Now here's where the blind squirrel comes in - the next step was to assume that maybe there was a problem with Vista and that's what led me to the following Microsoft Technet Article about optional TCP parameters in Windows Vista and Server 2008.  After adding these registry entries and rebooting the PCs at the remote site, we were no longer experiencing dropped telnet sessions. 

As you can see in the link, these are Optional registry entries for TCP keep alive - meaning by default they are not there.  There are two primary entries, KeepAliveTime and KeepAliveInterval that will then enable OS-level keep alive packets to a remote system.

So, here's a short set of instructions on adding these keys to the Vista registry.  It seems that Server 2008 and Windows 7 are also devoid of these settings, but I have not had time to test on these yet for the same problem of dropped sessions.

logged in with user having admin privileges
run REGEDIT
navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
right click in right panel - select NEW - DWORD
type: KeepAliveTime  for the description and hit enter (no spaces and observe caps for K, A and T)
right click on KeepAliveTime and select MODIFY
click on the button beside decimal
type: 300000   in the box for value
click OK to save (should show 493e0 for hex after save)
**this sets the value to 5 minutes (300,000 milliseconds); default value per Microsoft technet
right click in right panel - select NEW - DWORD
type: KeepAliveInterval  for the description and hit enter (no spaces and observe caps for K, A and I)
right click on KeepAliveInterval and select MODIFY
click on the button beside decimal
type: 1000   in the box for value 
click OK to save (should show 3e8 for hex after save)
**this sets value to 1 second = 1000 milliseconds; default value per Microsoft technet
file - exit
reboot machine


........



Wednesday, April 20, 2011

Microsoft SyncToy




Microsoft's SyncToy tool is great, but often overlooked or unheard-of little piece of software. Intended to be used for synchronizing directories, this utility can be a great way to initiate backups of laptops, move and sync data to cloud storage, or simply keeping your files sync'd to a USB key for mobility.

You can download the SyncToy tool from the Microsoft webiste here. This link also contains a detailed description of the SyncToy tool and features. SyncToy requires the .NET Framework 2.0 or newer to be installed and now has a 64-bit version.

The major new features and improvements included in previous SyncToy 2.0 release are:


* Dynamic Drive Letter Assignment: Drive letter reassignment will now be detected and updated in the folder pair definition.

* True Folder Sync: Folder creates, renames and deletes are now synchronized for all SyncToy actions.

* Exclusion Filtering Based on Name: File exclusion based on name with exact or fuzzy matching.

* Filtering Based on File Attributes: The ability to exclude files based on one or more file attributes (Read-Only, System, Hidden).

* Unattended Folder Pair Execution: Addressed issues related to running scheduled folder pairs while logged off.

* Folder Pairs With Shared Endpoints: Ability for folder pairs associated with the same or different instances of SyncToy to share end-points.

* Command line enhancements: Added the ability to manage folder pairs via the command line interface.

* Re-Architect Sync Engine: The SyncToy engine has been rearchitected to provide scalability and the ability to add significant enhancements in future releases.

* Sync engine is also more robust insomuch that many single, file level errors are skipped without affecting the entire sync operation.

* Sync Encrypted Files: Sync of Encrypted files works when local folder and files are encrypted, which addresses the common scenario involving sync between local, encrypted laptop PC folder and remote, unencrypted desktop PC folder.

* 64-Bit Support: SyncToy now has a native 64-bit build (x64 only) for 64-bit versions of Windows.

* Folder pair rename

* Sub-folder Exclusion Enhancements: Descendents created under excluded sub-folders are automatically excluded. Usability improvements for the sub-folder exclusion dialog.

* Folder Pair Metadata Moved: Folder pair metadata removed from MyDocuments to resolve any issues with server-based folder pair re-direction setup.

Thursday, February 3, 2011

Compacting Virtualbox VDI files

How to compact an Oracle Virtualbox VDI file

As most of these posts do, this one originated in a problem that required me to stop everything and find a solution. I've been a long time Virtualbox user for running virtual machines on my laptop system for testing and demonstrations as well as application isolation. Well, a few days ago one of my Windows XP virtual machines was refusing to update an installed application; it would just fail. I checked the disk space inside the VM and it showed 12GB total space on C with 4GB free. Then, I dropped back to the host OS (Windows 7 Pro if you must know) and checked the size of the VDI file - it was 11.86GB. So, the solution search began. Here's what I was able to come up with to correct the problem. The steps below are for a Windows guest OS - I'll give Linux guest OS steps in another post.

1. Within the virtual machine's OS (in this case Win XP Pro SP3) I went to Start-Computer-Open-C_drive and right clicked - and went to Properties-Tools and ran a Defrag on the disk. So step one is to Defrag the guest OS.

2. Go to the Microsoft site and download the Windows SysInternals tool called SDELETE into the VM's guest OS. Unzip the file and then go to Start-Run and CMD. Once in a command line window change directory to wherever the SDELETE executable file is located. Run the following command: SDELETE -C This will fill all empty areas of the guest OS virtual disk with zeros.

3. Ok, now for step three. Once SDELETE has finished, then log out and close the VM guest OS. In the host OS, you need to know the path to the VDI file that you are wanting to compact (ex: c:\vms\XPtest\XPtest.VDI). Once noted, then go Start-Run-CMD to open a command line windows and navigate to the directory containing the Virtualbox program (ex: c:\program files\Oracle\Virtualbox). Now, execute the following command:

VBoxManage modifyvdi VDINAME compact

The example in my case would be VBoxManage modifyvdi XPtest.VDI compact Now sit back and let the process run to completion.

By performing these steps I was able to shrink my VDI file size in the host OS to 8.2GB, leaving me nearly 4GB of expansion room in the guest OS.

Yeah, so I know the next logical question - can you expand a VDI file? Nope, although it's a heavily requested feature. My solution - create a new, larger VDI file; attach to the VM that you want to enlarge VDI; boot the VM to an ISO of the UBCD4Win file and use SelfImage to do a byte-level copy of the small VDI to the larger VDI. Shut down the VM, edit the settings to remove the small VDI from the VM and leave the larger VDI - power on the VM. If you have an older OS that does not allow you to enlarge a "C" partition, you can boot one more time to the UBCD4Win ISO file and use the partition management utilities to enlarge the volume before re-booting into the guest OS. Let me know if I need to do a more detailed post on this process and I'll add it to my list.


.