/[james]/archive/sysstats/getdata
ViewVC logotype

Annotation of /archive/sysstats/getdata

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20 - (hide annotations) (download)
Thu Feb 13 11:48:06 2003 UTC (21 years, 8 months ago) by james
File size: 714 byte(s)
Handle missing discs.

1 james 20 #!/usr/bin/perl -W
2    
3 james 9 $datetime = `date -u '+%Y%m%d.%H:%M:%S'`;
4 james 8 chomp $datetime;
5    
6     $sensors = `sensors`;
7     $sensors =~ /SYS Temp: +([+-][0-9.]+)/;
8     $sys = $1;
9     $sensors =~ /CPU Temp: +([+-][0-9.]+)/;
10     $cpu = $1;
11    
12     $df = `df -k`;
13 james 20 $hda1u = $hda1f = $hda3u = $hda3f = $hdc1u = $hdc1f = '-';
14     ($hda1u, $hda1f) = ($1, $2) if $df =~ m|/dev/hda1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
15     ($hda3u, $hda3f) = ($1, $2) if $df =~ m|/dev/hda3\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
16     ($hdc1u, $hdc1f) = ($1, $2) if $df =~ m|/dev/hdc1\s+[0-9]+\s+([0-9]+)\s+([0-9]+)|;
17 james 8
18     $ip = `ip -s -o link show eth0`;
19     $ip =~ /RX:.*?([0-9]+)/;
20     $rx = $1;
21     $ip =~ /TX:.*?([0-9]+)/;
22     $tx = $1;
23    
24     print "$datetime $sys $cpu $hda1u $hda1f $hda3u $hda3f $hdc1u $hdc1f $rx $tx\n";

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26