Create prometheus alert for absent metrics
Prerequisites prometheus package installed prometheus-alertmanager package installed node-exporter deployed on target device: this alert is using the node-exporter in order to use node_filesystem_avail_bytes metrics. Create an Alerting Rule in Prometheus PromQL expression to detect missing mountpoints Make sure to test your query on /explore tab. You can use metric node_filesystem_avail_bytes to detect specific mountpoint (e.g. /mnt/data) on specific instance (e.g vm-name:9100): node_filesystem_avail_bytes{instance="vm-name:9100",mountpoint="/mnt/data"} âš Any missing mountpoints for an instance might be due to default regexp value of the argument --collector....
Manage Windows Using Ansible
Setup openssh (prerequisites) Before using ansible to manage windows, make sure that openssh is installed and enabled. If not, you can use this powershell script to do so: $sshServer = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' if ($sshServer.State -ne 'Installed') { Write-Host "Installing OpenSSH Server..." Add-WindowsCapability -Online -Name $sshServer.Name } else { Write-Host "OpenSSH Server is already installed." } # Set default shell to powershell for ansible if (-not (Get-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -ErrorAction SilentlyContinue)) { Write-Host "Set default shell to powershell....
Ansible Utils Commands
NB: As an example, the machines are defined in file inventory.yaml with the following content: # VMs all: hosts: vm01: vm02: vm03: vm04: vm05: vm06: # Groups dev: hosts: vm01: vm02: test: hosts: vm03: vm04: prod: hosts: vm05: vm06: # Parent Groups lan: children: dev: test: wan: children: prod: ⚠If you did not name your inventory file inventory.yaml at root folder, you’ll need to add the argument -i <inventory_filename> to all the commands in the following post....
Play steam games remotely using moonlight/sunshine or steam link and wake-on-lan
General overview Goal My goal here is to be able to play on my PC remotely from a portable device (laptop, tablet or phone) . I used steamlink first to play through the Internet. It worked well and did not need to have additional setup (no vpn or additional port in/out manual setup on my computer or router). I also want my computer to be able to go to sleep to save energy and be able to wake it up remotely....
Troubleshoot Wsl Issues
Change mode/rights of Windows files in WSL Symptoms: By default, if you try to chmod your files hosted on windows in WSL, it won’t change anything e.g. ls -l /mnt/c/userid/.ssh/vault_pass.txt -rwxrwxrwx 1 userid userid 34 Nov 22 14:21 /mnt/c/userid/.ssh/vault_pass.txt chmod 400 /mnt/c/userid/.ssh/vault_pass.txt ls -l /mnt/c/userid/.ssh/vault_pass.txt -rwxrwxrwx 1 userid userid 34 Nov 22 14:21 /mnt/c/userid/.ssh/vault_pass.txt It can be particularly painful for keys since they cannot be too permissive e.g. for a ssh key...