This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell script to check for VM snapshots and send Email report | |
add-pssnapin VMware.VimAutomation.Core | |
Connect-VIServer -Server 'vcenter' -User 'domain\user' -Password 'password' | |
# HTML formatting | |
$a = "<style>" | |
$a = $a + "BODY{background-color:white;}" | |
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}" | |
$a = $a + "TH{border-width: 1px;padding: 5px;border-style: solid;border-color: black;foreground-color: black;background-color: LightBlue}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RP="192.168.100.101" | |
out="./cg_stats.out" | |
groups="./groups.in" | |
#plink -l admin -pw admin $RP "get_groups" | egrep -v "Production|DRSite|Copies|Groups" | sed -e '/^$/d' | awk -F\: '{print $1}' | sed '$d' > $GroupTmp | |
echo "CGName,JournalUsage,JournalLag,ReplicationLag,CurrentProtectionWindow,PredictedProtectionWindow" | |
echo "CGName,JournalUsage,JournalLag,ReplicationLag,CurrentProtectionWindow,PredictedProtectionWindow" > $out | |
for name in `cat $groups`; do | |
#JournalTotal=`plink -l admin -pw admin $RP "get_group_statistics $name" | egrep "Total:" | tail -n1 | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell script to check datastore capacity | |
add-pssnapin VMware.VimAutomation.Core | |
Connect-VIServer -Server 'vcenter' -User 'domain\user' -Password 'password' | |
#HTML formatting | |
$a = "<style>" | |
$a = $a + "BODY{background-color:white;}" | |
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}" | |
$a = $a + "TH{border-width: 1px;padding: 5px;border-style: solid;border-color: black;foreground-color: black;background-color: LightBlue}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VM | Get-Snapshot -Name foo* | Where { $_.Created -lt (Get-Date).AddDays(-2)} | remove-snapshot -confirm:$false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem VNX Snapshot Script | |
rem vnxsnap.bat | |
rem Rich Bocchinfuso 2014-09-09 | |
rem set variables | |
set ver=0.1 | |
set cmd=vnxsnap | |
set spa=10.12.3.17 | |
set spb=10.12.3.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECHO ON | |
@echo off | |
:: DD Report Generator | |
:: 3/12/2014 | |
:: Rich Bocchinfuso | |
::setlocal EnableDelayedExpansion | |
:: ----- Requires ----- | |
:: plink | |
:: blat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECHO ON | |
@echo off | |
:: ghettoVCB Management | |
:: 3/12/2014 | |
:: Rich Bocchinfuso | |
::setlocal EnableDelayedExpansion | |
:: ----- Requires ----- | |
:: plink | |
:: blat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
BEGIN { eval { require bytes; }; } | |
use strict; | |
no strict "vars"; | |
## Switch will be used to test the field value and build the csv file | |
use Switch; | |
use Data::Dumper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/ActivePerl-5.16/bin/perl | |
use XML::Simple; | |
use Data::Dumper; | |
use IO::File; | |
open (OUTFILE, '>parsed_mminfo.csv'); | |
print OUTFILE "filename,client,name,level,sum-size\n"; | |
# create object | |
$xml = new XML::Simple (KeyAttr=>[]); |
OlderNewer