statistiky
Cejka Rudolf
cejkar at fit.vutbr.cz
Wed Jul 3 16:54:20 CEST 2002
Hubert Polacek wrote (2002/07/03):
> Ahojte, potreboval by som si robit statistiku (nieco ako webalizer)
> mnozstva prenesenych dat cez len sietovku, ktore je pripojena do internetu
> (nedoverujem providerovi). Mozete mi doporucit vhodny nastroj ?
Na www.FreeBSD.cz mam mrtg s timto konverznim skriptem:
--
#!/bin/sh
HOSTNAME=/bin/hostname
UPTIME=/usr/bin/uptime
SED=/usr/bin/sed
NETSTAT=/usr/bin/netstat
PRINTF=/usr/bin/printf
HOSTNAME=`${HOSTNAME}`
UPTIME=`${UPTIME} | ${SED} -e 's/^.*up *\([^,]*\),.*$/\1/'`
COUNT=`${NETSTAT} -bI$1 \
| awk '$1 == "'$1'" && $4 == "'$2'" { print $7; print $10; }'`
${PRINTF} -- "${COUNT}\n${UPTIME}\n${HOSTNAME}\n"
--
Rudolf Cejka <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66 Brno, Czech Republic
More information about the Users-l
mailing list