Item: url.statuscode[{#DESCRIPTION}] Trigger: {Template App IIS - Site Checks:url.statuscode[{#DESCRIPTION}].last()}<>{#RESPONSE}
This file contains hidden or 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
| $BuildDirs = gci "W:\Jenkins\jobs\" -recurse -filter builds | ?{$_.psiscontainer} | |
| $BuildDirs | %{ | |
| $Builds = $_ | gci | select *,@{L="NameInt";e={[int]$_.name}} | ?{$_.nameint}| sort nameint -Descending | |
| if($builds.Length -gt 30){ | |
| $Builds[30..$($builds.length-1)].fullname | Remove-Item -Force -Recurse -verbose | |
| }else{ | |
| $Builds.Length | |
| } | |
| } |
This file contains hidden or 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
| from subprocess import check_output | |
| from datadog import statsd | |
| from datadog.api.constants import CheckStatus | |
| import requests | |
| import re | |
| zpool_status = check_output(["/sbin/zpool", "status"]) | |
| pattern = re.compile('state: ONLINE') |
This file contains hidden or 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
| from subprocess import check_output | |
| from datadog import statsd | |
| from datadog.api.constants import CheckStatus | |
| import re | |
| zpool_status = check_output(["/sbin/zpool", "status"]) | |
| pattern = re.compile('state: ONLINE') | |
| if pattern.search(zpool_status) : |
This file contains hidden or 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
| Add-Type -AssemblyName System.IO.Compression.FileSystem | |
| function Unzip | |
| { | |
| param([string]$zipfile, [string]$outpath) | |
| [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath) | |
| } | |
| Invoke-WebRequest -Uri https://s3.amazonaws.com/ec2-downloads-windows/EC2Config/EC2Install.zip -UseBasicParsing -OutFile "$env:temp\EC2Install.zip" |
This file contains hidden or 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
| $Uri = "http://192.168.1.1:7878/api/" | |
| $headers = @{ | |
| 'x-api-key' = "" | |
| } | |
| $Movies = Invoke-RestMethod -Uri "$Uri/movie" -Headers $headers -Method Get | |
| $KnownQualities = $Movies.MovieFile.quality.quality | select -Unique id,name |
This file contains hidden or 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
| function Get-AWSAccountLimits { | |
| param( | |
| $region | |
| ) | |
| $ASGAccountLimits = Get-ASAccountLimits -region $region | |
| $MaxNumberOfAutoScalingGroups = @{ | |
| AccountQuotaName="MaxNumberOfAutoScalingGroups"; | |
| Max=$ASGAccountLimits.MaxNumberOfAutoScalingGroups; | |
| Used=$ASGAccountLimits.NumberOfAutoScalingGroups | |
| } |
This file contains hidden or 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
| function New-EphemeraSecret{ | |
| param( | |
| [string]$Secret, | |
| [string]$EphemeraURl = "http://ephemera.sdlsecuritycentre.com" | |
| ) | |
| $EphemeraConfig = Invoke-WebRequest -Uri "$EphemeraURL/js/frontend_config.js" -UseBasicParsing | |
| $EphemeraConfig.Content -match "apiURL = '(.+?)';" | Out-Null | |
| $EphemeraAPIURL = $Matches[1] | |
| $Payload = @{secretText = $Secret} | ConvertTo-Json |
This file contains hidden or 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
| if(!$creds){ | |
| $creds = get-credential | |
| } | |
| $url = "http://zabbix.example.com" | |
| $payload = @{ | |
| jsonrpc = "2.0" | |
| method = "user.login" | |
| params = @{ | |
| user = $creds.UserName |
This file contains hidden or 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
| $zone = gc .\fmlocal.zone | ?{$_ -notmatch '(^;|^-|^\s*$|^@|^\$|^\s+)'} | %{$val = $_ -split '\s+'; new-object psobject -Property @{"Name"=$val[0];"Value"=$val[3] }} | |
| foreach($record in $zone) { | |
| $nslookup = $(nslookup "$($record.name).fmlocal" 2>&1 | out-string) | |
| $matches = @(); | |
| $nslookup -match '(?smi)(?<Name>Name:.*)(Address:\s*)(?<Address>[0-9\.]*)' | Out-Null | |
| if(!$matches){ | |
| $record | select *,@{L="Resolvable";E={$false}}, @{L="Resolved Address";E={$null}} | |
| }else{ | |
| $record | select *,@{L="Resolvable";E={$true}}, @{L="Resolved Address";E={$Matches.Address}} |