Hallo,
habe mal ein wenig die systeminfo.sh bearbeitet. Diese hier ist nun angepasst für das AT5IONT-I Board.
Vorraussetzung:
- sensors (bei Yavdr bereits vorhanden)
- hddtemp
- vdr-plugin-systeminfo (bei Yavdr bereits vorhanden)
- hddtemp hat Zugriffsrechte in der sudoers (mit visudo bearbeiten), ist bei Yavdr wichtig
# /etc/sudoers
...
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
vdr ALL=NOPASSWD: /usr/sbin/hddtemp
# Added by yavdr-startup, don't remove
vdr ALL=NOPASSWD: /usr/bin/start-xterm
vdr ALL=NOPASSWD: /sbin/reboot
Die /usr/share/vdr-plugin-systeminfo/systeminfo.sh (Pfade können bei anderen Installationen als Yavdr auch woanders liegen):
Bash
#!/bin/bash
# systeminfo.sh: external data collection script
# This file belongs to the VDR plugin systeminfo
#
# See the main source file 'systeminfo.c' for copyright information and
# how to reach the author.
#
# $Id$
#
# possible output formats:
# (blanks around tabs only for better reading)
# 1) Name \t Value displays Name and Value
# 2) Name \t Value1 \t Value2 displays Name, Value1 and Value2
# 3) Name \t total used displays an additional progress bar (percentage) after the values
# 4) s \t Name \t ... defines a static value, this line is only requested during the first cycle
#
# special keywords (they are replaced by the plugin with the actual value):
# CPU% CPU usage in percent
#
# test with: for i in $(seq 1 16); do systeminfo.sh $i;echo;done
#
PATH=/usr/bin:/bin:/sbin
case "$1" in
1) # kernel version (static)
KERNEL=$(uname -rm)
echo -ne "s\tLinux Kernel:\t"$KERNEL
;;
2) # distribution release (static)
if test -f /etc/SuSE-release; then
DISTRI="openSuSE"
RELEASE=$(head -n 1 /etc/SuSE-release)
elif test -f /etc/redhat-release; then
DISTRI="RedHat"
RELEASE=$(head -n 1 /etc/redhat-release)
elif test -f /etc/lsb-release; then
DISTRI=$(grep DISTRIB_ID /etc/lsb-release|cut -d"=" -f 2)
RELEASE=$(grep DISTRIB_RELEASE /etc/lsb-release|cut -d"=" -f 2)
CODENAME=$(grep DISTRIB_CODENAME /etc/lsb-release|cut -d"=" -f 2)
elif test -f /etc/debian_version; then
DISTRI="Debian"
RELEASE=$(head -n 1 /etc/debian_version)
elif test -f /etc/gentoo-release; then
DISTRI="Gentoo"
RELEASE=$(head -n 1 /etc/gentoo-release)
elif test -x /usr/bin/crux; then
DISTRI="Crux"
RELEASE=$(crux|cut -d" " -f 3)
elif test -f /etc/arch-release; then
DISTRI="Arch Linux"
RELEASE=$(LANG= pacman -Qi filesystem | sed -n 's|Version.*: ||p')
else
DISTRI="unknown"
RELEASE="unknow"
fi
if [ ${DISTRI} == "Ubuntu" ]; then
echo -ne "s\tDistribution:\t"$DISTRI" "$RELEASE" "\($CODENAME\)
else
echo -ne "s\tDistribution:\t"$RELEASE
fi
exit
;;
3) # CPU type (static)
CPUTYPE=$(grep 'model name' /proc/cpuinfo | cut -d':' -f 2 | cut -d' ' -f2- | uniq)
echo -ne "s\tCPU Type:\t"$CPUTYPE
;;
4) # current CPU speed
VAR=$(grep 'cpu MHz' /proc/cpuinfo | sed 's/.*: *\([0-9]*\)\.[0-9]*/\1 MHz/')
echo -ne "CPU speed:\t"$VAR
exit
;;
5) # hostname and IP (static)
hostname=$(hostname)
dnsname=$(dnsdomainname)
IP=$(ifconfig eth0 | grep inet | cut -d: -f2 | cut -d' ' -f1)
echo -ne "s\tHostname:\t"${hostname:-<unknown>}"\tIP: "${IP:-N/A}
exit
;;
6) # fan speeds
CPU=$( sensors | grep -i 'CPU FAN' | tr -s ' ' | cut -d' ' -f 4)
CASE=$(sensors | grep -i 'CHASSIS FAN' | tr -s ' ' | cut -d' ' -f 4)
echo -ne "Fans:\tCPU: "$CPU" rpm\tCase: "$CASE" rpm"
exit
;;
7) # temperature of CPU and mainboard
CPU=$(sensors | grep -i 'CPU Temperature' | tr -s ' ' | cut -d' ' -f 3)
MB=$( sensors | grep -i 'GPU Temperature' | tr -s ' ' | cut -d' ' -f 3)
echo -ne "Temperaturen:\tCPU: "$CPU" Mainboard: "$MB
exit
;;
8) DISK1=$(sudo hddtemp /dev/sda | cut -d: -f2,3)
DISK2=$(sudo hddtemp /dev/sdb | cut -d: -f2,3)
echo -ne "\tFestplatte 1 " $DISK1 #"\tFestplatte 2 "$DISK2
exit
;;
9) GPU=$(nvidia-settings -c :1.0 -q GPUCoreTemp -t)
echo -e "\tGPU: +"$GPU".0°C"
exit
;;
10) # CPU usage
echo -e "CPU time:\tCPU%"
exit
;;
11) # header (static)
echo -ne "s\t\ttotal / free"
exit
;;
12) # video disk usage
VAR=$(df -Pk /var/lib/video.00 | tail -n 1 | tr -s ' ' | cut -d' ' -f 2,4)
echo -ne "Video Disk:\t"$VAR
exit
;;
13) # memory usage
VAR=$( grep -E 'MemTotal|MemFree' /proc/meminfo | cut -d: -f2 | tr -d ' ')
echo -ne "Memory:\t"$VAR
exit
;;
14) # swap usage
VAR=$(grep -E 'SwapTotal|SwapFree' /proc/meminfo | cut -d: -f2 | tr -d ' ')
echo -ne "Swap:\t"$VAR
exit
;;
test)
echo ""
echo "Usage: systeminfo.sh {1|2|3|4|...}"
echo ""
exit 1
;;
esac
exit
Alles anzeigen
Das war es schon.
Viel Spass damit.