DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

teams:sysinfo

Sysinfo Cronjob

This script is run by cron and stored on /etc/cron.daily/sysinfo at piggy.dokuwiki.org.

/etc/cron.daily/sysinfo
#!/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 $(</etc/*_version)
  * Architecture: $(uname -m)
 
===== Virtual Hosts =====
 
The following vhosts are setup at the server.
${vhosts}
 
===== Statistics =====
 
These statistics are a rough estimation during common operations for all processes regarding Dokuwiki. 
 
  * Avg. Load: ~0.5 (increased by one for each process in state D)
  * Avg. Used memory: ~2GB + buffers
  * Avg. Used Cpu: ~50% (of 200% available with both cores)
  * Avg. Webhits/Month ((as reported through Google Analytics)):
    * Wiki:
      * 141.748 Visits
      * 604.312 Pageviews
    * Forum:
      * 23,306 Visits
      * 53,932 Pageviews
 
===== Non-distribution packages =====
 
  * since upgrade to wheezy there are none
 
===== Packages =====
 
$(dpkg -l | grep ^ii | sed 's/^[^ ]*\s*\([^ ]*\)\s*\([^ ]*\).*/\1 \2/g;s/^/  * /g')
" > "${WEBPAGE}"
 
echo "====== Sysinfo Cronjob ======
 
This script is run by cron and stored on ''${scriptname}'' at $(hostname -f).
 
<file bash ${scriptname}>" > "${SCRIPTPAGE}"
chown wiki: "${WEBPAGE}" "${SCRIPTPAGE}"
cat "${scriptname}" >> "${SCRIPTPAGE}"
# 
teams/sysinfo.txt · Last modified: 2019-02-23 06:29 (external edit)