Rexxer

Some tips for me and other

Zabbix + WakeOnLan script

export MYSQL_PWD=YourPass
echo ***Wake up the host***
SQL_QUERY="select Username, Computer, IPADDRESS, MAC from Computers where IPADDRESS='{HOST.CONN}'"
myrec=`mysql -uzabbix -h "192.168.222.15" -N -D inventory -e "$SQL_QUERY"`
echo $myrec
mymac=`echo $myrec | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
/usr/bin/wakeonlan $mymac
echo ***Done***

Comments are currently closed.