- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Get specific info and email
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 12:35 PM
09-13-2005 12:35 PM
i want that if usage of any File system is more than 70% then it send email to me. i know that i got it from bdf but tell me how can i get that when File system using more than 70%
bye
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 12:48 PM
09-13-2005 12:48 PM
Re: Get specific info and email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 12:56 PM
09-13-2005 12:56 PM
Re: Get specific info and email
bdf | awk '{print $1 " " $5}'
Filesystem %used
/dev/vg00/lvol3 64%
/dev/vg00/lvol1 82%
/dev/vg00/lvol8 44%
/dev/vg00/lvol7 75%
/dev/vg00/lvol4 2%
/dev/vg00/lvol6 85%
/dev/vg00/lvol5 28%
now i want to take percentage for each logical volume separately please tell me how can i get it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 12:59 PM
09-13-2005 12:59 PM
Solutionrefer to this post:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=732203
especially the reply given by Sridhar Bhaskarla.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 01:39 PM
09-13-2005 01:39 PM
Re: Get specific info and email
#!/usr/bin/perl
$reportfull = 70;
my $temp_dir = "/var/tmp/diskspace_check.$$";
mkdir $temp_dir, 0700 or die "cannot create $temp_dir: $!";
$email_users = "Enter the Email address in the format abc\@xyz.com";
open OUTPUT, ">$temp_dir/bdf_check";
foreach (`bdf`)
{
chomp($line = $_ );
@fields = split /\s+/, $line;
$filesystem = $fields[0];
$kbytes = $fields[1];
$usedkbytes = $fields[2];
$availkbytes = $fields[3];
$percentused = $fields[4];
$mountpoint = $fields[5];
next if $filesystem eq "Filesystem";
next if $kbytes eq "";
if ( $usedkbytes / $kbytes * 100 > $reportfull )
{
select OUTPUT;
$| = 1;
printf "Filesystem mounted on %s is %d%% full.\n", $mountpoint, $percentused;
select STDOUT;
}
}
if (-s OUTPUT)
{
$machine = `uname -n`;
chomp($machine);
$subject = "$machine diskspace over ${reportfull}%";
system "elm -s \"$subject\" $email_users < $temp_dir/bdf_check >/dev/null 2>&1";
}
unlink glob "$temp_dir/* $temp_dir/.*";
rmdir $temp_dir;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2005 02:53 PM
09-13-2005 02:53 PM