nagios https proxy monitoring plugin or Bash website monitoring script

#!/bin/bash

if [ $# -eq 0 ]
  then
    echo "No arguments supplied"
fi

if [ $# -eq 1  ]
then

output=`curl  -x 10.11.10.10:3128 -L $1 -m 10 -o /dev/null || echo "Website_down"`

if [ "$output" == "Website_down" ] ; then

echo "Website is down CRITICAL  "
exit 2

else

echo "Website_up $1  OK"
exit 0
fi

fi

Adding client certificate file using chef data bags

Below is just an example 

logstash_cert_secret = Chef::EncryptedDataBagItem.load_secret("/etc/chef/secrets/logstash_client_key")
logstash_certs = Chef::EncryptedDataBagItem.load("certs", "logstash_client", logstash_cert_secret)


directory "/etc/pki/tls/certs/" do
  action :create
  mode "0755"
  owner "root"
  group "root"
end

file "/etc/pki/tls/certs/logstash_client.crt" do
  action :create
  mode "0644"
  owner "root"
  group "root"
  content logstash_certs["crt"].join("")

  end

Search and replace in all files in a current directory

grep -rl 'pc961' ./|xargs sed -i 's/pc961/pc/g'

Ansible define a basic windows hosts



[windows]
10.10.10.120

[windows:vars]
ansible_connection=winrm
ansible_ssh_user=Administrator

ansible_ssh_pass=AdminPa$$