PowerCLI One Liners

Useful commands for any number of tasks Get number of VM’s per datastore Get-Datastore | Select Name, @{N="NumVM";E={@($_ | Get-VM).Count}} | Sort Name Get ESX version and builds get-view –ViewType …

PowerCLI – Get Host Overview

Sometimes you will be asked for a quick overview of the specs on your hosts. This will give you the proc count, number of cores, CPU speed and the total …

PowerCLI – Get Hardware Serial Numbers

This can be helpful if you are in need to retrieve all serial numbers for your hosts. $vCenter = "vCenter.localdomain" Connect-VIServer $vCenter Get-VMHost | Get-View | Sort-object Name | select …

Setup SNMPv3 on ESX

Use the following to setup SNMPv3 on ESX v5.1 and above Set the authentication type to none, MD5 or SHA1 esxcli system snmp set –authentication MD5 Set the privacy mode …

Image Manipulation

rename all images in the current folder based on creation date exiftool ‘-filename<CreateDate’ -d %y%m%d_%H%M%S%%-c.%%le -r -ext jpg . resize multiple jpg files emogrify -resize "50%" *.jpg

Updating openssl on RedHat 5.3

With the new heartbleed virus we need to update openssl.. and cleanup the un-needed 32bit [root@ora01 ~]# yum list installed|grep openssl This system is registered to Red Hat Subscription Management, …

Random Apache shtuff

[root@xxxxxxx ~]# service httpd restart Stopping httpd: [FAILED] Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory [FAILED] This is due to selinux being enforced. …

ESX 5.1 esxcli commands

view physical nics /etc/vmware # esxcli network nic list view current connections, like using netstat /etc/vmware # esxcli network ip connection list view ip addresses and networks /etc/vmware # esxcfg-vmknic …