aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2006-08-23 21:27:51 +0000
committerPetter Reinholdtsen <pere@hungry.com>2006-08-23 21:27:51 +0000
commitcb43769f6b29e342293d7405d17ea90a60adfeb1 (patch)
tree33c6019c505ba2d67466308705d294f1ba9b100c
downloadsitesummary-cb43769f6b29e342293d7405d17ea90a60adfeb1.tar.gz
sitesummary-cb43769f6b29e342293d7405d17ea90a60adfeb1.tar.bz2
sitesummary-cb43769f6b29e342293d7405d17ea90a60adfeb1.tar.xz
Start on system to track the hosts on a site.
-rw-r--r--Makefile33
-rw-r--r--README69
-rw-r--r--collect.d/system12
-rw-r--r--debian/control20
-rw-r--r--sitesummary-client25
-rw-r--r--sitesummary-collector.cgi1
6 files changed, 160 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d9e8a26
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+DESTDIR =
+
+prefix = /usr/local
+bindir = $(prefix)/bin
+datadir = $(prefix)/share
+cgibindir = $(libdir)/cgi-bin
+libdir = $(prefix)/lib
+collectordir = $(libdir)/sitesummary/collect.d
+
+INSTALL = install
+INSTALL_DATA = $(INSTALL) -m 644
+
+COLLECTORS = collect.d/system
+
+all:
+
+install: install-server install-client
+
+install-server:
+ $(INSTALL) -d $(DESTDIR)$(cgibindir)
+ $(INSTALL) sitesummary-collector.cgi $(DESTDIR)$(cgibindir)
+
+install-client:
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) sitesummary-client $(DESTDIR)$(bindir)
+
+ $(INSTALL) -d $(DESTDIR)$(collectordir)
+ for collector in $(COLLECTORS) ; do \
+ $(INSTALL) $$collector $(DESTDIR)$(collectordir); \
+ done
+
+clean:
+ $(RM) -f *~ */*~
diff --git a/README b/README
new file mode 100644
index 0000000..1d3baef
--- /dev/null
+++ b/README
@@ -0,0 +1,69 @@
+Design draft
+
+sitesummary
+===========
+
+system to collect key info about all the machines on a site, to help
+the sysadmin keep track of a lot of hosts.
+
+Should be capable of handling both thin clients and "real machines"
+
+ - two package, one server sitesummary and one client sitesummary-client
+
+ - the client submits information to the server using HTTP put. It
+ include the list of files it intend to submit, to detect deleted
+ files.
+
+ - the HTTP connection is either using SSL, or the file(s) transfered
+ are GPG encrypted. (figure out key exchange system)
+
+ - the client submit a set of files and output from commands with hw
+ information etc (need plugin system to make it submit more files)
+
+ - lspci
+ - lsusb
+ - dmidecode
+ - uname -s / -m / -r / -v / -o
+ - ifconfig -a
+
+ - public ssh host key
+ - /etc/debian_version
+ - dpkg -l
+ - /etc/apt/sources.list
+ - /etc/fstab
+ - /proc/cpuinfo
+ - /proc/meminfo
+
+ - the server track changes done to the files (some version control
+ system like rcs?) on each host, and make summary report on the
+ number of individual machines reporting to the server
+
+ - how do we identify machines? MAC address could work (ip -s -f link
+ maddr - which when several interfaces?). IP addess will not work
+ for thin clients on private networks behind two different servers.
+ the linux hostid command is only using IP address and is useless.
+ Can not generate random key stored on the file system, as this
+ would give all thin clients on a server the same ID. dmidecode
+ serial number might work for some models, but others have the same
+ serial number on several machines.
+
+ - ideas for use of this info
+
+ - machine count, grouped by os/kernel/etc
+
+ - can generate a list of host keys for distribution to the clients
+
+ - can generate dhcp MAC<->IP mapping
+
+ - can generate lts.conf files for the LTSP clients
+
+The server can either be a CGI script, or listen on some port on its
+own.
+
+The client should be a platform independent script with as few
+dependencies as possible, to make it lightweight and easy to install
+on all machines. (perl, python, /bin/sh?)
+
+Should the client know which files to report, or should the server be
+able to affect it? Can cfengine, nagios or munin be used for this
+instead?
diff --git a/collect.d/system b/collect.d/system
new file mode 100644
index 0000000..4ed132b
--- /dev/null
+++ b/collect.d/system
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+mkdir hardware && cd hardware
+
+dmidecode > dmidecode
+
+lspci > lspci
+lspci -n > lspci-n
+uname -smr > uname-smr
+ifconfig -a > ifconfig-a
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..9a173c6
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: sitesummary
+Section: misc
+Priority: optional
+Maintainer: Debian Edu Developers <debian-edu@lists.debian.org>
+Uploaders: Petter Reinholdtsen <pere@debian.org>
+Build-Depends-Indep: debhelper (>= 4)
+Standards-Version: 3.7.2
+
+Package: sitesummary
+Architecture: all
+Depends:
+Description: Generate site summary of submitting hosts, server package
+ Nice server.
+
+Package: sitesummary-client
+Architecture: all
+Depends: dmidecide, pciutils
+Description: Generate site summary of submitting hosts, client package
+ Nice client.
+
diff --git a/sitesummary-client b/sitesummary-client
new file mode 100644
index 0000000..218d2ab
--- /dev/null
+++ b/sitesummary-client
@@ -0,0 +1,25 @@
+#!/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
+
+serverurl=http://localhost/cgi-bin/sitesummary-collector.cgi
+fragments=/usr/lib/sitesummary/collect.d/
+
+tmpdir=/tmp/sitesummary-$$
+
+mkdir $tmpdir && cd $tmpdir
+
+for frag in $fragments/*; do
+ $frag
+done
+
+tar zcf $tmpdir.tar.gz .
+
+wget --no-check-certificate --post-file $tmpdir.tar.gz $serverurl
+
+# wget --no-check-certificate -O /tmp/lts.conf $MY_CONFIG_SERVER\?mac=$MY_NODE_MAC/ip=$MY_NODE_IP/bootservip=$MY_NFSROOT_IP/code=1 --post-file=/tmp/post_inventory.txt 1>&2
diff --git a/sitesummary-collector.cgi b/sitesummary-collector.cgi
new file mode 100644
index 0000000..4a4794a
--- /dev/null
+++ b/sitesummary-collector.cgi
@@ -0,0 +1 @@
+# Script to collect HW info using HTTP put