cho un problem con questo!! (moltissime bestemmione) use - TopicsExpress



          

cho un problem con questo!! (moltissime bestemmione) use strict; use warnings; use utf8; use Getopt::Long; binmode(STDOUT, :utf8); *STDERR = *STDOUT; # 2>&1 # default values my $t_warn = 70; my $t_crit = 90; my $chip = ; my $temperature = -9999; sub help { print Usage: temperature [-w ] [-c ] [--chip ]\n; print -w : warning threshold to become yellow\n; print -c : critical threshold to become red\n; print --chip : sensor chip\n; exit 0; } GetOptions(help|h => \&help, w=i => \$t_warn, c=i => \$t_crit, chip=s => \$chip); # Get chip temperature open (SENSORS, sensors -u $chip |) or die Cannot exec sensors $!; while () { if (/^\s+temp1_input:\s+[\+]*([\-]*\d+\.\d)/) { $temperature = $1; last; } } close(SENSORS); $temperature eq -9999 and die Cannot find temperature; # Print short_text, full_text print $temperature°C\n x2; # Print color, if needed if ($temperature >= $t_crit) { print #FF0000\n; exit 33; } elsif ($temperature >= $t_warn) { print #FFFC00\n; } exit 0;
Posted on: Sun, 17 Aug 2014 10:21:54 +0000

Trending Topics



z 6 speed
When a woman loves you , you are a husband

Recently Viewed Topics




© 2015