Category: Scripting/Network Automation

Auto-update OS on Ubuntu + log process for monitoring of process with Zabbix

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:

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, […]

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 […]