Code: Select all
#!/bin/bash
iwlist $1 peers | grep $2 | awk -F\= '{print $3}' | awk '{print $1}'
$1 : the interface I want to monitor
$2 : the mac address of the peer
when I execute the script myself, everything is ok:
Code: Select all
caribou:/usr/share/cacti/scripts# ./test.sh ath1 00:40:96:A1:56:19
-64
Code: Select all
10/27/2005 12:45:06 PM - CMDPHP: Poller[0] Host[2] DS[156] WARNING: Result from CMD not valid. Partial Result:
10/27/2005 12:45:06 PM - CMDPHP: Poller[0] Host[2] DS[156] CMD: sh /usr/share/cacti/scripts/test.sh ath1 00:40:96:A1:56:19, output: U
*** Sorry, I've posted in the wrong section, plz move me