28.10.2010, 15:37

Seit einiger Zeit steht hier ein ReadyNAS der Firma Netgear herum. Zur Kontrolle und Steuerung (da ich keine Lust habe, die Informationen ständig über umständliche Pfade und/oder mehrere verschiedene Programme einzeln zusammenzusuchen) habe ich das Programm mit dem einfallsreichen Namen ctl entwickelt, welches folgend binär (kompiliert für SPARCv8, Glibc 2.3, tauglich für das NAS, getestet mit Firmware Version 4.1.6) und im Sourcecode unter der BSD-Lizenz zur Verfügung gestellt wird.

Binary: ctl (19 KB) und Code: ctl.c

Installiert bzw. kopiert nach /usr/local/bin/ kann das Programm auf das NAS bspw. über SFTP, mittels der SSH-Erweiterung werden.

Folgend eine Auflistung der Fähigkeiten und eine Beispielausgabe. ctl mon warnt, falls der SMART-Selbsttest einer Festplatte fehlschlägt.

 [args...]
commands:
  fan        controls the fan-speed
  mon        output stuff like temperatures, free ram-/disk-space, etc.
  pwm        controls pulse-width modulation settings of leds]]>

]]]>

] [-ucmdx] [-p []]
  -s           use smartctl to read live data from harddisks
  -f   additionally display filesystems of this type; default disabled:
               bind, proc, devpts, sysfs, ramfs, tmpfs, nfsd, usbfs
  -F           display all filesystems
  -u           display uptime and load avg statistics
  -c           display CPU and fan statistics
  -m           display memory (RAM and swap) statistics
  -d           display device statistics
  -x           display filesystem statistics
  -p []    display process statistics for  processes (default: 5)]]>


] {-d  | -s }
      one of 'power', 'hdd' and 1 <= k <= 4 or 'act' (default: all)
    delay in ms between pwm changes, default: 30
    absolute pwm level for the selected leds, 0 <= level <= 15]]>