1834604 Members
4089 Online
110069 Solutions
New Discussion

Daily maintenance?

 
SOLVED
Go to solution
Ted Flanders_1
Advisor

Daily maintenance?

Can you give me some suggestions on what I should do on a daily basis. Right now I do a bulog to make sure my backup worked. I do a top to see how the system is running. I do a bdf to check the file systems. What else (and how) should I be doing on a daily basis? I will trim files on a monthly basis, through sam. As you can probably tell I am fairly new at this. I would like to create some good habits early in my Unix career. I am running an HP9000 K220 with HPUX 10.20.
17 REPLIES 17
Victor BERRIDGE
Honored Contributor

Re: Daily maintenance?

look at your sulog, and syslog.log from time to time also. Purge them once a month...
James R. Ferguson
Acclaimed Contributor

Re: Daily maintenance?

Ted:

You're starting to do the right things. Check the following two threads for triggers for more:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xf74a49c5ae73d4118fef0090279cd0f9,00.html

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x2eb6119c3420d411b66300108302854d,00.html

And, last, but not least, keep participating in this forum!!!

...JRF...
Rick Garland
Honored Contributor

Re: Daily maintenance?

One additional option I would include is the creation of make_recovery tapes. I do this once a week. Not needed if you are mirroring the vg00 but if you are not and the vg00 disk crashes, you will need to recreate.]

Another command would be to run the print_manifest on the systems. This will detail for you the system layouts and will help tremendously if you have to rebuild a system.

The Ignite package is a no-cost package.
Stefan Farrelly
Honored Contributor

Re: Daily maintenance?


As well as what your already doing you should be checking logfiles for important errors;
1. /var/adm/syslog/syslog.log
2. root mail for any mailed errors from the system
3. use the dmesg command to check for important kernel errors
4. periodcially check the hardware logs using xstm (need to install OnlineDiag from the SupportCD)
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ted Flanders_1
Advisor

Re: Daily maintenance?

Victor,
What is sulog?
How to you check it?
I tried the command and it says not found, I did find it in /var/adm typed in sulog and nothing happend. I tried to vi it with no success.
What do I do with syslog.log? How do you check it and what am I looking for?
Antoanetta Naghiu
Esteemed Contributor

Re: Daily maintenance?

Welcome to the Club!
What you are doing is already a good start!
Check the logs (especially /var/adm/syslog/syslog.log) for possible errors, notice that are repetetived tasks, try to make scripts and automated them. (Cron can help you with that).
Depends on your environment, you can check as well network, database, application, printer status.
See if you have glance and perfview to get some reports. If not, you can use vmstat and other tools to see what can be improved.
For daily stuff, not more... Be sure you have enough info (prints out, backup tapes0 and a strategy for DR (disaster recovery).
Will be good day, will be days as hell... Good luck!
RikTytgat
Honored Contributor

Re: Daily maintenance?

Hi,

A Unix System Administrator has quit a lot of responsibilities, too many to summarize in here.

There are a number of great sites on the www for us guys. A good starting point would be

http://www.ugu.com

There are links to sites on all possible flavours of our favorite OS.

Good luck,
Rik.
Victor BERRIDGE
Honored Contributor

Re: Daily maintenance?

sulog is in /var/adm
in this file you will see all people doing su someone else (...)
I shoul add purging /var/adm/syslog/syslog.log is not just removing the file or >syslog.log
Do it properly:
# mv syslog.log syslog.log.old

and restart syslogd:
# cd /sbin/init.d
./syslogd stop
./syslogd start

Good luck
Victor
Victor BERRIDGE
Honored Contributor

Re: Daily maintenance?

Since your entered the club,
Some more links maybe (thats how I started...)
http://www.washington.edu/R870/
http://wks.uts.ohio-state.edu/sysadm_course/sysadm.html

Best regards
Victor
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?