procmail
[Top] [All Lists]

Re: procmail diagnostic shell script?

2001-12-16 17:55:23
On Sat, 15 Dec 2001, Professional Software Engineering wrote:

Would a few old hands mind fetching that and seeing what might be tweaked 
to make it a better diagnostic collector?

I would consider adding at the very bottom:
  
echo "Please consider running this reporting script thus: "
echo "   $0 | mail procdiag(_dot_)sh-report-parser(_at_)procmail(_dot_)org "
echo "to help us improve procmail. "

#----------------------------------------------
 
which initially can be pointed at /dev/null, until a parser,
which assigns a hash serial number, stuffs it into a database,
looks for interesting variances, and turn around a diagnostic
report by return email.  This might be available to a person 
knowing the hash (a salted md5sum of a serial number) for 
privacy reasons, and after being anonymized, for discussion.

Specific things that would be nice to improve upon are a reliable "what OS 
is this system running" (right now, uses OSTYPE envioronment variable, and 
the first line of 'dmesg' which I know works on BSD and most Linux),

and consider cleaning up variable reporting throughout into 
the form:

echo "UNAME: `uname -a`"
echo "PATH: $PATH"
#----------------------------------------------

to facilitate statistical reporting;  pine does this, and the 
produced charts over time are fascinating.

 and 

Is there a standard utility or a ready-made script that will report file 
permissions in numeric format?

Here is a meatball script ---

$ cat numperm
#!/bin/sh
#
#
for i in `ls -al | awk {'print $1'} | tr 'rwx-' '4210' | \
        cut -c 2- | tr -d 'a-z'`; do
        L=`echo $i | cut -c 1-3`
        C=`echo $i | cut -c 4-6`
        R=`echo $i | cut -c 7-9`
        for j in `echo $L $C $R `; do
                c4=`echo $j | cut -c 1`
                c2=`echo $j | cut -c 2`
                c1=`echo $j | cut -c 3`
                k=`echo "0 + $c4 + $c2 + $c1" | bc`
                echo $j $k
        done
done

Hope it is helpful.


-- 
end
==================================
 .-- -... ---.. ... -.- -.--
Copyright (C) 2001 R P Herrold
      herrold(_at_)owlriver(_dot_)com  NIC: RPH5 (US)
   My words are not deathless prose, 
      but they are mine.

       Owl River Company  
   "The World is Open to Linux (tm)"
   ... Open Source LINUX solutions ...
      info(_at_)owlriver(_dot_)com 
         Columbus, OH

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>