#!/usr/bin/perl -w
# Olivier Poitrey <rs@rhapsodyk.net>
#
# LM-sensors info grabber
#
# sensors_grab.pl chip [field1 [fieldN]]
use strict;
my $ship = shift or exit 1;
my %fields;
@fields{@ARGV} = ();
open(CMD, "/usr/bin/sensors $ship|") or exit 1;
while(<CMD>)
{
my($field, $value) = /^(.*?):\s+[+-]?([\d.]+)/;
if(defined $field && exists $fields{$field})
{
$fields{$field} = $value;
}
}
close(CMD);
print join ' ', map(defined $fields{$_} ? $fields{$_} : 0, @ARGV);
Linux sensors support script
Moderators: Developers, Moderators
Who is online
Users browsing this forum: No registered users and 2 guests