Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

df output 1

Status
Not open for further replies.

gringomike

Technical User
Aug 6, 2003
148
GB
Hi All,

I have a simple script which generates disk info from a NetApps filer and emails it to a list of users.
I would like to format the output in order to make it a bit more "readable".
All the script does at the moment it "rsh" into the filer and run a "df", mailing the output in the following format (there is another column but I've removed it to fit the data into the window);

Generating disk info on server1

Filesystem kbytes used avail
/vol/vol0/ 12518648 131696 12386952
/vol/vol0/.backup 3129660 2128 3127532
/vol/data3/ 87630524 48148456 39482068
/vol/data3/.backup 21907628 20016588 1891040

server1adm disk info complete


What I would like to do is display a sufficient space between the columns (tab seperated) and display the "used" column in bold.
Can anybody help!?

Many thanks!

GM
 
what's "suffiecient space between the columns"?
Can you give a sample input and a desired output, pls?


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
If you are a little confident with awk you can try to generate a HTML report with all the formatting you will.

Hope This Help
PH.
 
Thanks for the quick replies,

I'm looking for it to read something like this but with the &quot;kbytes used&quot; column displayed in bold print;

Generating disk info on server1

Filesystem kbytes used avail Size
/vol/vol0/ 12518648 131696 12386952
/vol/vol0/.backup 3129660 2128 3127532
/vol/data3/ 87630524 48148456 39482068
/vol/data3/.backup 21907628 20016588 1891040

server1adm disk info complete


It will be part of a morning check procedure for the helpdesk. I'd like it to read a bit better as they won't necessarily know what they're looking at!

Many Thanks!

GM

 
thread822-531443 may help if you want to create a html report. You can then use uuencode and mailx to send the report as an attachment.
 
Hi,

Thanks for the advice. An HTML output would be fine, the only problem is that I can't seem to get any of these scripts to compile properly:-(

Script posted by ygor;

I'm told that the &quot;-P&quot; is a bad command. When I removed it I noticed that it doesn't seem to be able to handle entries which have a value of &quot;0&quot;.

Upon running the script the following error was displayed;

# ./script.ksh
./script.ksh[12]: 150*0/0: divide by zero

The other script I tried on the same thread mails the correct email address but it only sends a blank file. There is not data to view. The df2tb.awk file is also empty so it mustn't be collecting the data at all.

Help!

Many Thanks

GM
 
Many apologies - I'd made a mistake in my syntax and managed to get the script from hallux to compile.

It's exactly what I was looking for.

Thanks very much!

GM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top