1761303 Members
2508 Online
108901 Solutions
New Discussion юеВ

Daily maintenance?

 
SOLVED
Go to solution
Dave Wherry
Esteemed Contributor

Re: Daily maintenance?

Like Rick, I also do a periodic set of make_recovery tapes for my systems. Keep in mind that mirroring only protects you from a disk drive failure of your primary drive. If data is corrupted or deleted, mirroring will give you 2 copies of corrupted data or the data will be gone from both drives.
The make_recovery tapes allow you to recover from a bad situation.
Steve Sauve
Frequent Advisor

Re: Daily maintenance?

Couple more things to do, though not daily.
Every so often make and print out a copy of the following:
/etc/hosts
/etc/passwd
/etc/rc.config.d/netconf
/etc/fstab

Also run these and save/print out the result file.
bdf > (filename)
ioscan -fun > (filename)
swlist > (filename)

There are probably some more that I'm not remembering, but a backup copy/print out of these can be helpful if things go bad.

Hope this helps,
Steve
Bob Gulien
Advisor

Re: Daily maintenance?

Hi,

Attached you find a script which can help you check your system.
It check's syslog, spooler, cron, corefiles etc. Run it as root and use what you need.

Good Luck

Comments to Bob.Gulien@croklaan.com
Bill Ogle_1
Occasional Advisor

Re: Daily maintenance?

I like to do a # ps -ef to check to see what processes are being run at that time, and a # ps -ef | grep d1p1 to see if there are any hung processes out there. Hung processes tend to hold the system up and over time, cause a great deal of problems. if there is ever a hung process, do a kill -9 on the process to clear it.

Hope this helps!
Shannon Petry
Honored Contributor

Re: Daily maintenance?

Another nice part of Unix, which no-one has mentioned is system accounting. To enable accounting run "/usr/sbin/acct/turnacct on"
and change the variable "START_ACCT" from 0 to 1 in "/etc/rc.config.d/acct".
Accounting shows many nice things, like who accessed the system, which programs are used the most, who is the CPU hog, etc...
man acct should give you a good start.
A couple of other things pertain to being a bit anal about knowing your system. On my critical seats, I usually run "last" (see man last) and e-mail myself the output, as well as /var/adm/syslog/mail.log and /var/adm/syslog/syslog.log.
A good book to get you started is "Essential System Administration" published by O'Reilly of course!

Best o Luck!
Shannon
Microsoft. When do you want a virus today?
Ted Flanders_1
Advisor

Re: Daily maintenance?

Bill, I did a ps -ef on d1p1 and got 3 lines back.
root 1598 2549 0 11:36:07 ttyd1p1 0:01 /usr/vsifax3/lbin/c2-fim -d fa
root 23953 1 0 Aug 24 ttyd1p10 0:00 /usr/lbin/uucp/uugetty -r -t 6
and my grep line
What is that on the 2nd line, uugetty, should that be killed?
Ted Flanders_1
Advisor

Re: Daily maintenance?

Shannon, How do you run acct after you set it up?
Shannon Petry
Honored Contributor
Solution

Re: Daily maintenance?

Sorry for the delay in answering, I have been a bit busy, and not able to follow threads as well as I would like.
To utilize accounting after setup, you need to do a few things.
Make an entry if it does not exist in "/usr/lib/cron/cron.allow" for "adm".
Setup a cron job for adm at whatever schedult you want accounting to run. Usually, I run at exactly midnight, every night. You may not want weekends, or may want two or three times a day. Hey if you have three shifts, you may want each separate. See note below for multiples.
The cron job should simply run "/usr/sbin/acct/runacct" then "/usr/sbin/acct/pacct". Runacct will process all of the goods, pacct will check disk space, and shutdown accounting if disk space is low.
NOTE ABOUT HOLIDAYS: You will probably get an error "update /etc/holidays blah blah blah". If this happens, accounting will still run, but your file /etc/holidays contains the wrong year. Simply edit the file and put in the correct year.
The output location should be in "/var/adm/acct/sum" and you should have interest in two files. The first should be "rprt$MM$DD" where $MM is the month, and $DD is the day. The next is "loginlog" which shows the last time a user logged in to the host. (If you are really ambitious, the tacct$MM$DD is the C data, which you can write your own tools to extract and manipulate)
The rprt$MM$DD should be ready to print to your favorite printer :)
Special considerations.....
I have scripts that delete OLD data! It adds up quick. Usually, I compress last month, and delete previous month.
NOTE FOR MULTIPLE ACCOUNTING SESSIONS.
There is a file called "/var/adm/acct/nite/lastdate" which tells the accounting system the last time it was run. If you need multiple sessions in a day, this file should be removed. Also, your file rprt$MM$DD and tacct$MM$DD will be overwritten if not renamed. It is not hard to write a script to handle all of these tasks for you.

Best of luck, and have fun!
Shannon
Microsoft. When do you want a virus today?