Copy script to /opt/autoupdate.sh Script content: Assign execution rights to script. schedule update Update logs location: /var/log/ubuntu_update.log To enable zabbix monitoring assign zabbix template in zabbix and modify agent config to include correct values for “ServerActive” & “Hostname” values sample Zabbix template for monitoring updates:
Category: Scripting/Network Automation
Making snapshot on Nutanix from guest VM using Nutanix API
If you prefer full control inside the VM (or you want something more tailored per workload), following approach is to run a pre-snapshot script (quiesce), trigger the snapshot via API, then run a post-snapshot script (resume). 2. Snapshot trigger (API example ) 3. Post-snapshot (example) This route can work well when you want custom quiescing […]
Fault-tolerant cluster with haproxy and keepalived. Also backend sync with glusterfs
Case: build fault tolerant souliton using linux servers and sync data between cluster members with glusterfs. solution: keepalived + HAProxy for VRRP and glusterfs to sync data. Install keepalived + haproxy keepalived.conf configuration example Script to check if haproxy is alive – /etc/keepalived/check_haproxy.sh: Sample of haproxy.cfg: Done. Now let`s configure glusterfs to sync data between […]
Ansible: snapshoting VM on VMWare and cleanup old snapshots.
Solution1. Script to make a snapshoots of listed servers. powershell. store password in separate file (/root/vmware.cred in this case). script itself servers.inv content – just list of servers (how they present at VMWare). like this: Solution2. Cleanup old snapshoots. Just schedule it to run periodically and it will delete all associated to servers snapshoots. Yep, […]
Ansible: update OS on remote server
Combined use of shell script and ansible to update remote servers, divided to 3 groups. shell script: content of update_ubuntu_template.yml content of update_ubuntu.yml content of ansible.cfg content of ansible_servers.inv group_vars/all.yml should have your user password in encoded form. Something like this:
Deploy and/or upgrade splunk forwarder on Ubuntu
Case: customer want simply wat to update splunk forwarder on Ubuntu servers. Solution: script to simplify update process. Solution Create shell script and allow it to run script run script and enjoy easy update done
Simple HTTP proxy: squid
install.sh /opt/squid/conf/quid.conf content example start container done
Catch and forward traffic destined for specific host. Multiple destinations
This example for two destinations (could be more) Install socat Add iptables rules to firewalld (works only with IP – replace hostname with associated IP) check results create systemd template content of template We’ll override example.com per instance using systemctl edit. content of socat@12345 another content of socat@12346 start and enable both services check service […]
Catch and forward traffic destined for specific host
Install socat Create IPtables NAT rules Test socat in foregroud (160.129.8.154 – is IP of redcap.vumc.org) make it permanent/create service content of socat-redcap-proxy.service Enable it enjoy
Autorun script in 5 min after reboot
Create file. Fill it. enable it and reboot server This will start script in 5 min after server reboot as “user” user