Advertisement
Advertisement
| 01.25.2008 at 02:51PM PST, ID: 23112630 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 01.25.2008 at 02:57PM PST, ID: 20747112 |
| 01.25.2008 at 03:09PM PST, ID: 20747197 |
| 01.25.2008 at 04:47PM PST, ID: 20747775 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: |
#!/usr/bin/perl
use strict;
my $uname = `uname -s`;
chomp $uname;
if ($uname eq 'Linux' or $uname eq 'Solaris') {
open DF, "df|" or die "Can not run df $!\n";
while (<DF>) {
next unless /\//;
my ($dev,$total,$used,$free,$percent,$fs) = split;
# Do whatever calculation you need based on the figures
}
}
|
| 01.26.2008 at 04:59PM PST, ID: 20751863 |
| 01.26.2008 at 05:04PM PST, ID: 20751877 |
| 01.30.2008 at 03:53AM PST, ID: 20776222 |
| 01.30.2008 at 07:56AM PST, ID: 20777986 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: |
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $sendmail = '/usr/bin/sendmail';
my $from = 'me@company.com';
my $to = 'you@company.com';
my %env_to_fs =
(DEV => 'FSDEV',
QA => 'FSQA',
PROD => 'FSPRD',
);
#Get argument, set $fs
my $fs_arg = shift;
die "Usage: $0 <Environment>\n" unless $fs_arg;
die "Invalid environment, it must be one of: " . join(", ", keys %env_to_fs) . "\n" unless exists($env_to_fs{$fs_arg});
my $fs = $env_to_fs{$fs_arg};
my $exitcode=0;
open DF, "df|" or die "Can not run df $!\n";
<DF>; #Get header line
#Get all other lines
while (<DF>) {
my ($dev,$total,$used,$free,$percent,$fs) = split /\s+/;
if($dev =~ m!($fs|/u\d+)!) {
if($free/$total < .1) {
$exitcode=1;
open(SM, "$sendmail -t") or die "Could not open sendmail: $!\n";
print SM "From: $from\n";
print SM "To: $to\n";
print SM "Subject: Device $dev is low on space\n";
print SM "\n";
print SM "The device $dev is low on space:\n";
print SM " Total: $total\n";
print SM " Used : $used\n";
print SM " Free : $free\n";
close(SM);
}
}
}
close(DF);
exit($exitcode);
|
| 01.30.2008 at 03:18PM PST, ID: 20782569 |
| 01.30.2008 at 04:32PM PST, ID: 20783004 |
| 01.30.2008 at 06:14PM PST, ID: 20783375 |
| 01.30.2008 at 06:31PM PST, ID: 20783436 |
| 01.31.2008 at 07:20AM PST, ID: 20787371 |
| 01.31.2008 at 01:03PM PST, ID: 20791099 |
| 01.31.2008 at 01:55PM PST, ID: 20791641 |
| 01.31.2008 at 02:21PM PST, ID: 20791908 |
| 01.31.2008 at 06:19PM PST, ID: 20793558 |
| 01.31.2008 at 08:04PM PST, ID: 20794120 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: |
#!/usr/bin/perl
use strict;
use warnings;
my %env_to_fs =
(DEV => 'OAPDEV',
QA => 'OAPQA',
PROD => 'OAPPRD',
);
#Get argument, set $fs
my $env_arg = shift;
die "Usage: $0 <Environment>\n" unless $env_arg;
die "Invalid environment, it must be one of: " . join(", ", keys %env_to_fs) . "\n" unless exists($env_to_fs{$env_arg});
my $fs = $env_to_fs{$env_arg};
my $exitcode=0;
open DF, "df -k|" or die "Can not run df $!\n";
<DF>; #Get header line
#Get all other lines
while (<DF>) {
print;
my ($dev,$total,$used,$free,$percent,$fs) = split /\s+/;
print "DEV: $dev\n";
print "TOTAL: $total\n";
print "Used : $used\n";
print "free : $free\n";
print "percent: $percent\n";
print "fs: $fs\n";
#if($dev =~ m!($fs|/u\d+)!) {
# print "The filesystem is : $dev\n";
# print " Total: $total\n";
# print " Used : $used\n";
# print " Free : $free\n";
# if($free/$total < .1)
# {
# $exitcode=1;
# }
#}
}
close(DF);
exit($exitcode);
|
| 02.01.2008 at 09:16AM PST, ID: 20798501 |