aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-client
blob: 2f053da3cf7499be832a3c5ddc1ce36f643b9c4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
#
# Collect sytem information and pass it on to the sitesummary server
# using HTTP put.

# https://svn.revolutionlinux.com/MILLE/XTERM/trunk/mille-xterm-getltscfg/src/getltscfg.script

set -e

serverurls="http://localhost/cgi-bin/sitesummary-collector.cgi"
fragdirs="/usr/lib/sitesummary/collect.d \
          /etc/sitesummary/collect.d"

# Make sure to store files in a ramfs backed
# storage area on diskless clients, so use /tmp/.
tmpdir=/tmp/sitesummary-$$

# Read the package default          
[ -f /usr/share/sitesummary/config ] && . /usr/share/sitesummary/config
for confdir in \
    /usr/share/sitesummary/config.d \
    /etc/sitesummary/config.d
do
  [ -d $confdir ] || continue
  for config in $confdir/* ; do
      [ -f $conf ] && . $conf
  done
done

mkdir $tmpdir && cd $tmpdir

for fragdir in $fragdirs ; do
    [ -d $fragdir ] || continue 
    for frag in $fragdir/*; do 
	[ -x $frag ] && $frag
    done
done

tar zcf $tmpdir.tar.gz .
for url in $serverurls ; do
#WGETOPTS="--no-check-certificate"
    wget $WGETOPTS --post-file $tmpdir.tar.gz -O $tmpdir.result $url
done