====== Sysinfo Cronjob ====== This script is run by cron and stored on ''/etc/cron.daily/sysinfo'' at piggy.dokuwiki.org. #!/bin/bash WEBPAGE="/var/www/wiki/htdocs/data/pages/teams/serversetup.txt" SCRIPTPAGE="/var/www/wiki/htdocs/data/pages/teams/sysinfo.txt" corecount="$(grep "cpu core" /proc/cpuinfo -m 1 | sed 's/.*\s:\s//')" cpucount="$(grep "cpu core" /proc/cpuinfo -c)" scriptname="$(readlink -f "${0}")" if [ $((${cpucount}/${corecount})) -eq 2 ] then cpu=" * ${corecount} x $(grep -m 1 "model name" /proc/cpuinfo | sed 's/\s\s*/ /g;s/.*\s:\s//g') with Hyperthreading" else cpu=" * ${corecount} x $(grep -m 1 "model name" /proc/cpuinfo | sed 's/\s\s*/ /g;s/.*\s:\s//g') without Hyperthreading" fi read bla total used avail usedperc <<<$(df --total -HlPx tmpfs -x rootfs | tail -1) for vhost in /etc/apache2/sites-enabled/* do domains="$(grep -E "(ServerName)\s*.*dokuwiki.org" "${vhost}" | sed 's#.*\s\([^ ]*\)#[[http://\1|\1]]#g;s/$/ /g' | sort -u | tr '\n' ' ')" desc="$(head -1 "${vhost}" | cut -d'=' -f2)" vhosts+=" * ${domains[@]} -- ${desc} " done echo "====== Dokuwiki.org Server Setup ====== For the [[Infrastructure]] team. This page lists some metrics of the software and hardware used to run dokuwiki.org and releated services. This page is updated by the cronjob [[Sysinfo]] (''${scriptname}''). (Last updated on: $(date)) ===== Network ===== * Hostname: $(hostname -f) * IP: $(LANG=C ip a s dev eth0 scope global | grep inet | cut -d' ' -f6 | sed 's/^/ * /') * [[http://dib.dokuwiki.org/munin/localdomain/localhost.localdomain.html|Munin graphs]] -- Authorization required ===== Hardware ===== See [[http://www.hetzner.de/hosting/produkte_rootserver/eq4]] * a dedicated server rented at [[http://hetzner.de|Hetzner]] ${cpu} * total disk: ${total} * used disk: ${used} * available disk: ${avail} * $(($(grep MemTotal /proc/meminfo | awk '{print $2}')/1000/1000)) GB RAM ===== OS ===== * Debian $( "${WEBPAGE}" echo "====== Sysinfo Cronjob ====== This script is run by cron and stored on ''${scriptname}'' at $(hostname -f). " > "${SCRIPTPAGE}" chown wiki: "${WEBPAGE}" "${SCRIPTPAGE}" cat "${scriptname}" >> "${SCRIPTPAGE}" #