Discussion Locked

script about the autoraid

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i want to get an info from the autoraid with command " logprint " at the OS Unix "HP"

if there is a script that i can use to check all the servers ( 20 server ), if was any change from the disks.
help

5 replies

by cpfeiffe

there are a few ways you can do this.

1) from each server add a cron job to do `logprint |mailx -s "autoraid for $machine" user@domain
If you don't want it in an email you can redirect the results to a file. If you only want one file to look at you can share a directory among all servers and redirect/append to the same file. To make this readable you probably will want your cron to call a script that will echo a header for each machine before sending the results of the command to thefile

2) If you have or are willing to give trusted access for one account on one machine to all 20 servers (via .rhosts so the account can run commands and log in without a password) you can have one machine run a script that will do `rsh $serverlogprint 1>>$file`. This will redirect/append the standard output you normally see on the screen to a file. Before each rsh command, it may also be useful to echo a header with this script as well. The .rhosts entry would be user@IPaddress for the user and machine you want to allow trusted access to. This should only be done within a secure environment.

I would most strongly recommend option one redirecting to a shared file.

Hope this helps

by ghassans

hi
the command that logprint |mailx -s "autoraid for $machine" user@domain
but this command when u run it u will get all the log but i don't need all the logs i need just the last change at the server ( auto raid ).

by oliviu

The first answer you get is a good one and offers 2 solutions.
I don't know the structure of the log file you intent to monitor but I suppose it contains also the date when the new lines were put. It may have also options to allow you to see the lines from the last day(s).

You can, also, write a small script that will find the last date, grep the line number and tail the last lines.
Or, find out how many lines the log file has now and substract them tomorrow.. Tail only the difference and,voila, you have the last day. You can do this if the log is a text file.

Good lock!

This discussion is closed to new replies.