Why not do an md5sum of all the files you are interested in to a single file? That way, just running md5sum -c checksums-file will do them all in one go. If you look at the file it creates, it will have the checksum and the examined filename in each record so you don't need to keep lots of separate single files and save you the worry of building/using an array.
For clarity, you can spread out your script if that helps, so saving the initial checksums:-
Code:
# However many files per line that makes sense to you, but nothing after the \ on each line
files_to_check="\
/etc/passwd /etc/shadow /security/access.conf \
/etc/resolv.conf /etc/sysconfig/network-scripts/* \
/etc/fstab \
/etc/httpd/httpd.conf \
/anything/else/you/fancy \
"
md5sum $files_to_check > /var/lib/md5sums/critical.md5
Later you can just md5sum -c /var/lib/md5sums/critical.md5 and you get a nice report about the files previously listed.
i have a unix batch written in c, dealing with really time-consuming
database operations
i want to write a ksh script to monitor its performance.
which items i should monitor?
do you have any suggestions?
1)cputime
2)swap area
3)pmem
4)
5)
what else? (1 Reply)
Hi Gurus,
Need to have a way to monitor Bandwidth utilization on Linux servers, running squid .
Have worked on 3rd party monitoring tools like Bandwidth d, Nagios etc.
But we are working to find out a way to monitor this through Sitescope, for which we need to find a file where the... (4 Replies)
Hi i am am monitioring a file every 60 seconds and checking if the file has changed and if it has changed i append the changes to another file. i am able to monitior the change in file size but i have a problem copying the changes made in the file to another file. i am using lseek to seek the last... (1 Reply)
Hi
Can any one helpe me in obtaining commands , which enables me to know the following :
Monitor Storage
Monitor RAM & CPU Utilization
Monitor Power Supply
Best wishes (1 Reply)
Hi,
I am trying to write a script to do monitoring kind of stuff,
requirement - when a server is given a start it updates a file called server.log, I need to keep on grepping the word "Running" and as soon as it comes , script should be exited with the message , "Server came up... (2 Replies)
Hi All,
I am writing a tool which remotely monitors network devices and sends an alarm if the device does not respond just like an NMS.
Can I use Threads module and invoke a simultaneous ping/snmpwalk to 100 or more devices and raise an alarm if any of the devices do no respond?
Please... (1 Reply)
Hello All,
I have written a script which will grep for error codes in a file and if the count for the same is about 500 it will send and smpp alert.
Here is my code.
#!/bin/bash
#########################################################################################################... (3 Replies)
I currently have a shellscript to check the size of a filesystem and email me if the size is over a certain percentage (80%). I have this script on crontab and executes the shell every 10 mins.
I have the above in place on 8 servers. It so happens that a file system on one of the servers is... (1 Reply)
Hi,
i have joined newly as a hp-ux admin... previously worked in linux environment
can anyone tell me how to monitor memory and cpu utilization in hpux??
hp-ux is not as flexible as linux as i understand... please help me out by giving the commands needed and way of troubleshooting if the... (12 Replies)
Discussion started by: Prasad@hp-ux
12 Replies
LEARN ABOUT DEBIAN
lcf
LCF(1) Debian GNU/Linux manual LCF(1)NAME
lcf - Determine which of the historical versions of a config is installed
SYNOPSIS
lcf [options] <Destination File Name> <Historical MD5SUM source directory>
DESCRIPTION
This script, given a destination file name, and a directory containing md5sums of historical versions of the file, attempts to determine if
the installed version corresponds to a historical version. lcf uses the same algorithm that ucf uses, and should exhibit the same behav-
iour.
The source directory is the place where historical md5sums are expected to live. Specifically, the historical md5sums are looked for in
either the file ${filename}.md5sum, or the subdirectory ${filename}.md5sum.d/
OPTIONS -h, --help
Print a short usage message
-n, --no-action
Dry run. Print the actions that would be taken if the script is invoked, but take no action.
-d [n], --debug [n]
Set the debug level to the (optional) level n (n defaults to 1). This turns on copious debugging information.
-v, --verbose
Make the script be very verbose about setting internal variables.
FILES
/var/lib/ucf/hashfile, /etc/ucf.conf
SEE ALSO ucf(1)ucf.conf(5).
BUGS
There are no bugs. Any resemblance thereof is delirium. Really.
AUTHOR
This manual page was written Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system.
Debian Feb 1 2002 LCF(1)