Skip to content

Instantly share code, notes, and snippets.

View vMarkusK's full-sized avatar

Markus Kraus vMarkusK

View GitHub Profile
@vMarkusK
vMarkusK / HP-3PAR-vSphere-Report_V1.2.ps1
Last active February 16, 2016 16:48
Reports HP 3PAR VVs and vSphere Datstores
#############################################################################
# 3Par Reporting
# Written by Markus Kraus
# Version 1.2
#
# https://mycloudrevolution.wordpress.com/
#
# Changelog:
# 2016.01 ver 1.0 Base Release
# 2016.02 ver 1.1 Added more CPG Details / Changed VV Space Calculation
@vMarkusK
vMarkusK / Get-3parSpace.ps1
Created February 16, 2016 16:47
HP 3PAR PS Toolkit Extend
#############################################################################
# HP 3PAR PS Extend
# Written by Markus Kraus
# Version 1.0
#
# https://mycloudrevolution.wordpress.com/
#
# Changelog:
# 2016.02 ver 1.0 Base Release
#
$ESXiHostList = Get-VMHost
foreach ($ESXiHost in $ESXiHostList)
{
#Configure HP 3PAR SATP/PSP Rule
$SATPesxcli = $ESXiHost | Get-EsxCli
$SATPesxcli.storage.nmp.satp.rule.add($null,"tpgs_on","3PAR custom rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=100","VMW_SATP_ALUA",$null,$null,"3PARdata")
Write-Host $ESXiHost ": HP 3PAR SATP/PSP Rule, configured."
#Disable ATS HB (http://kb.vmware.com/kb/2113956)
@vMarkusK
vMarkusK / HP-iLO-SNMP-SSO.ps1
Last active November 20, 2016 22:32
HP iLO mass Configuration
$ILOs = Import-Csv "C:\ILOs.csv"
$user = "user"
$password = "Passw0rd!"
foreach ($ILO in $ILOs) {
Set-HPiLOSNMPIMSetting -Server $ILO.ILO -Username $user -Password $password -SNMPAddress1 192.168.2.1 -SNMPAddress2 192.168.2.2 `
-SNMPADDRESS1ROCOMMUNITY public -SNMPADDRESS1TRAPCOMMUNITYvalue public -SNMPADDRESS1TRAPCOMMUNITYVERSION v1 -SNMPADDRESS2ROCOMMUNITY public `
-SNMPADDRESS2TRAPCOMMUNITYvalue public -SNMPADDRESS2TRAPCOMMUNITYVERSION v1 -AgentlessManagementEnable Yes
Add-HPiLOSSORecord -Server $ILO.ILO -Username $user -Password $password -SSOInputType "IMPORT_FROM_NETWORK" `
@vMarkusK
vMarkusK / PRTG-Veeam-SessionStats.ps1
Created February 29, 2016 13:43
PRTG Advanced Custom Sensor for VEEAM v9
$user = "yourUser"
$password = "yourPassword"
# POST - Authorization
$Auth = @{uri = "http://yourVEM.fqdn:9399/api/sessionMngr/?v=v1_2";
Method = 'POST'; #(or POST, or whatever)
Headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($user):$($password)"));
} #end headers hash table
} #end $params hash table
@vMarkusK
vMarkusK / VM-DiskReport_IOPS-Limit.ps1
Last active August 10, 2016 14:28
Reports vSphere VM disks related to Datastores and Max IOPs
<#
.NOTES
===========================================================================
Created by: Markus Kraus
Twitter: @vMarkus_K
Private Blog: mycloudrevolution.com
Organization: Vater Operations GmbH
Organization Site: vater-cloud.de
===========================================================================
Changelog:
@vMarkusK
vMarkusK / vCheck VM-DiskReport_IOPS-Limit.ps1
Last active March 6, 2016 10:03
vCheck Plugin to report vSphere VM disks related to Datastores and Max IOPs
# Start of Settings
# Bronze Limit
[int]$B_Limit = "250"
# Silber Limit
[int]$S_Limit = "1000"
# Gold Limit
[int]$G_Limit = "-1"
# VM IOPS Limits, do not report on any VMs who are defined here
$VMTDoNotInclude = "VM01*|VM01*"
# End of Settings
@vMarkusK
vMarkusK / syslog.bat
Last active March 11, 2016 08:43
HP Data Protector Syslog Integration
@ECHO OFF
setlocal
:: global variables
set log=D:\syslog\sessions.log
set maxbytesize=1000
:: cleanup logic
IF NOT EXIST "%log%" GOTO :Write
FOR /F "usebackq" %%A IN ('%log%') DO set size=%%~zA
$LogPath = "C:\inetpub\logs\LogFiles\W3SVC1\*"
$LogFiles = "*.log"
[int] $LogRetention = "-30" # in Days
Get-ChildItem $LogPath -Include $LogFiles -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays($LogRetention)} | Remove-Item
@vMarkusK
vMarkusK / PRTG-VeeamBRStats.ps1
Last active December 12, 2019 01:33
Reports Veeam B&R Statistics via PowerShell for PRTG
<#
.SYNOPSIS
PRTG Veeam Advanced Sensor
.DESCRIPTION
Advanced Sensor will Report Statistics about Backups during last 24 Hours and Actual Repository usage.
.EXAMPLE
PRTG-VeeamBRStats.ps1 -BRHost veeam01.lan.local