Operating System - HP-UX
1834714 Members
2094 Online
110069 Solutions
New Discussion

[Q] how grab the result while "sar" is running ??

 
Tony, Lim
Frequent Advisor

[Q] how grab the result while "sar" is running ??

Hello, Experts..

Our DB server running on HPUX 11.11 rp3440 has been off accidentally.
In /var/adm/syslog/syslog.log, "vmunix: file: table is full" is there.
I heard this is caused by kernel parameter kind like "nfile,nproc,maxuser etc".
So, I would like to grab the usage associated those things.
However, when I ran "sar -v 5 5 |tee -a sar_result" or "sar -v 5 5 > sar_result", it only generated the result file only if it completed.
If it failed or interrupted while running, there was no results file.

I mean, I would like to add crontab this and monitor this "sar" of DB server.
So, while "sar" is running, the results is being captured in the real time.
That's what I want to do.

How could I do that ? Any help or information would be appreciated.
Many thanks
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor

Re: [Q] how grab the result while "sar" is running ??

You have a fundamental problem. If you are seeing "file table is full" then you have reached the system-wide number of open files limit. How do you think sar will be able to open the output file when nfile has been reached? Sar does have a data collector mode where it automatically runs periodically and collects data and outputs to daily files. That would be one approach but the same problem is in effect. The other method would be to create a cronjob that runs every 2 minutes or so:

#!/usr/bin/sh

OFILE=/var/tmp/sardata
date >> ${OFILE}
sar -v 1 1 >> ${OFILE}


While the actual overflow of nfile will not be logged, the approach to the overflow would be detected.

In your case, nfile definitely needs to be increased so data collection is optional. A good admin would already have monitoring routines in place and would have detected and corrected this condition before it ever became a problem.
If it ain't broke, I can fix that.