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
listen stats # Define a listen section called "stats" | |
bind :9000 # Listen on port 9000 | |
mode http | |
stats enable # Enable stats page | |
stats socket /tmp/haproxy.sock group telegraf mode 660 level user | |
stats socket /tmp/haproxy_sensu.sock group sensu mode 660 level user |
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
client_json=/etc/sensu/conf.d/client.json | |
sudo apt install --assume-yes jq && \ | |
sudo cp $client_json $client_json.backup.$(date +"%Y_%m_%d-%H_%M_%S") && \ | |
contents="$(sudo jq '.client.environment = "new environment"' $client_json)" && \ | |
sudo echo "${contents}" | sudo tee $client_json && \ | |
sudo systemctl restart sensu-client.service && \ | |
sudo systemctl status sensu-client.service |
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-Location | |
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition) | |
cd $scriptPath | |
Get-Location | |
$main_pid=C:\Windows\system32\inetsrv\appcmd.exe list wps /apppool.name:"mysite" /text:WP.NAME | |
if (Get-Process procdump -ErrorAction SilentlyContinue) { | |
Write-Output "Exiting since procdump is running." | |
exit | |
} |
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
{ | |
"checks": { | |
"check_iis_http": { | |
"command": "C:/opt/sensu/embedded/bin/ruby C:/opt/sensu/embedded/bin/check-http.rb -u http://localhost/health", | |
"handlers": [ | |
"default", | |
"mailer_detailed" | |
], | |
"standalone": true, | |
"timeout": 15, |
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
C:\Users\myuser\Downloads>set VAULT_ADDR=https://my-vault.instance:1234 | |
C:\Users\myuser\Downloads>vault login -method=cert -client-cert=cert.pem -client-key=cert-key.pem | |
WARNING! The VAULT_TOKEN environment variable is set! This takes precedence | |
over the value set by this command. To use the value set by this command, | |
unset the VAULT_TOKEN environment variable or set it to the token displayed | |
below. |
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
C:\Users\myuser\Downloads>set VAULT_ADDR="https://my-vault.instance:1234" | |
C:\Users\myuser\Downloads>vault login -method=cert -client-cert=cert.pem -client-key=cert-key.pem | |
failed to create client: parse "https://my-vault.instance:1234": first path segment in URL cannot contain colon |
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
{ | |
"checks": | |
{ | |
"check_disk": | |
{ | |
"command": "/etc/sensu/plugins/check-disk.rb -w 3 -c 5 -a 1000 -l //", | |
"handlers": | |
[ | |
"default", | |
"mailer_detailed" |
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
ROBOCOPY C:\inetpub\logs\LogFiles\W3SVC1 C:\log-files-test /mov /minage:14 & ROBOCOPY C:\inetpub\logs\LogFiles\W3SVC2 C:\log-files-test /mov /minage:14 & del C:\log-files-test /q |
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 "-Dlog4j2.formatMsgNoLookups=true" | \ | |
sudo tee -a /etc/elasticsearch/jvm.options && \ | |
sudo cat /etc/elasticsearch/jvm.options && \ | |
sudo systemctl restart elasticsearch && \ | |
ps aux | grep "Dlog4j2.formatMsgNoLookups" |
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
hardening_rule "Open outbound port #{p} in firewall for Isilon at #{node[:server][:ip_range].gsub("/","-")}" do | |
direction :out | |
protocol :udp | |
port p | |
destination "#{node[:server][:ip_range]}" | |
end |