I am trying to hit a PHP url and post some information about my linux box using a cron job and wget.
*/30 * * * * wget -O /dev/null http://ping.xxx.com/xxx/up.php?mac=`ifconfig eth1 | awk '/HWaddr/ { print $5 }`\&uptime=`uptime`\&ip=`ifconfig eth1 | awk '/inet addr:/ {sub(/addr:/, "", $2); print $2 }`;
on php side i am tryint to get request parameters like mac, uptime and ip but i am only able to record mac. Reason i think is because uptime command has 23:42:10 up 22 min, load average: 0.00, 0.01, 0.04
as output which may be breaking the wget process. I am getting following message when i run wget
wget: not an http or ftp url: 23:42:10
Can someone please tell me how to pass parameters correctly?