bsdstats v2.0 ... device reporting

This commit is contained in:
Marc G. Fournier 2006-08-07 03:35:39 +00:00
parent 14427e99f6
commit 7d08ae66b0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=169899
5 changed files with 41 additions and 10 deletions

View file

@ -6,8 +6,7 @@
# #
PORTNAME= bsdstats PORTNAME= bsdstats
PORTVERSION= 1.0 PORTVERSION= 2.0
PORTREVISION= 1
CATEGORIES= sysutils CATEGORIES= sysutils
DISTFILES= DISTFILES=

View file

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.2 2006-08-06 14:11:15 scrappy Exp $ # $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.3 2006-08-07 03:35:39 scrappy Exp $
# #
# If there is a global system configuration file, suck it in. # If there is a global system configuration file, suck it in.
@ -20,10 +20,23 @@ case "$monthly_statistics_enable" in
HN=`/bin/hostname` HN=`/bin/hostname`
SYS=`/usr/bin/uname -r` SYS=`/usr/bin/uname -r`
ARCH=`/usr/bin/uname -m` ARCH=`/usr/bin/uname -m`
OS=`/usr/bin/uname -s` /usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH\&opsys=$OS case "$monthly_statistics_report_devices" in
[Yy][Ee][Ss])
IFS="
"
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/clear_devices.php?hn=$HN
for line in `/usr/sbin/pciconf -l | /usr/bin/grep -v none`
do
DRIVER=`echo $line | awk -F\@ '{print $1}'`
VEN=`echo $line | awk '{print $4}' | cut -c12-15`
DEV=`echo $line | awk '{print $4}' | cut -c8-11`
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/report_device.php?driver=$DRIVER\&vendor=$VEN\&device=$DEV\&hn=$HN
done
;;
esac
;; ;;
*) rc=0;;
esac esac
umask $oldmask umask $oldmask

View file

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.2 2006-08-06 14:11:15 scrappy Exp $ # $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.3 2006-08-07 03:35:39 scrappy Exp $
# #
# If there is a global system configuration file, suck it in. # If there is a global system configuration file, suck it in.
@ -20,10 +20,23 @@ case "$monthly_statistics_enable" in
HN=`/bin/hostname` HN=`/bin/hostname`
SYS=`/usr/bin/uname -r` SYS=`/usr/bin/uname -r`
ARCH=`/usr/bin/uname -m` ARCH=`/usr/bin/uname -m`
OS=`/usr/bin/uname -s` /usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH
/usr/bin/fetch -qo /tmp/getid http://bsdstats.hub.org/scripts/getid.php?hn=$HN\&sys=$SYS\&arch=$ARCH\&opsys=$OS case "$monthly_statistics_report_devices" in
[Yy][Ee][Ss])
IFS="
"
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/clear_devices.php?hn=$HN
for line in `/usr/sbin/pciconf -l | /usr/bin/grep -v none`
do
DRIVER=`echo $line | awk -F\@ '{print $1}'`
VEN=`echo $line | awk '{print $4}' | cut -c12-15`
DEV=`echo $line | awk '{print $4}' | cut -c8-11`
/usr/bin/fetch -qo /tmp/result http://bsdstats.hub.org/scripts/report_device.php?driver=$DRIVER\&vendor=$VEN\&device=$DEV\&hn=$HN
done
;;
esac
;; ;;
*) rc=0;;
esac esac
umask $oldmask umask $oldmask

View file

@ -3,6 +3,9 @@
To enable the port, edit or create /etc/periodic.conf and add this line: To enable the port, edit or create /etc/periodic.conf and add this line:
monthly_statistics_enable=yes monthly_statistics_enable=yes
To enable device reporting, add this line:
monthly_statistics_report_devices=yes
To run it manually the first time, just run it as: To run it manually the first time, just run it as:
/usr/local/etc/periodic/monthly/300.statistics /usr/local/etc/periodic/monthly/300.statistics
******************** ********************

View file

@ -3,6 +3,9 @@
To enable the port, edit or create /etc/periodic.conf and add this line: To enable the port, edit or create /etc/periodic.conf and add this line:
monthly_statistics_enable=yes monthly_statistics_enable=yes
To enable device reporting, add this line:
monthly_statistics_report_devices=yes
To run it manually the first time, just run it as: To run it manually the first time, just run it as:
/usr/local/etc/periodic/monthly/300.statistics /usr/local/etc/periodic/monthly/300.statistics
******************** ********************