[lug] Monitoring file descriptors
Jeffrey Haemer
jeffrey.haemer at gmail.com
Mon Jul 28 20:43:34 MDT 2008
Unfortunately, "-e" and "-E" differ. "-e" is "test for presence of mail in
the mailbox." "-E" is "don't send if the body's empty."
"mailx" is actually the POSIX mail interface. It was sort of modelled on
Berkeley "Mail," but it doesn't have the full array of options. They made
up a new name for it so as not to make people ask, "Wait ... did you say
'mail' or 'Mail'?"
On Mon, Jul 28, 2008 at 8:26 PM, David L. Anselmi <anselmi at anselmi.us>wrote:
> Jeffrey Haemer wrote:
>
>> If only I had a mail program that interpreted "-E" as "don't send if the
>> body's empty", this would be still easier for me to read. (YMMV.)
>>
>
> Very nice.
>
> awk '(diff = $3 - $1) < 10 {print "Low on file descriptors - " diff}'
>> /proc/sys/fs/file-nr |
>> mail -E -s "ftp1 file descriptors" ben at atrust.com
>>
>
> Yeah, putting it in awk makes it shorter and more readable. But I usually
> avoid awk for things that complicated because a notch or two more than that
> and I'd be using perl.
>
> If perl has a mail package that's as easy as the above I'd say we're a few
> lines from the point of switching.
>
> Of course, that would require a Berkeley-style "mail" which would mean I
>> wouldn't have /proc. Catch-22.
>>
>
> Hmmm... My mail(1) has that (-e actually). And a little jaunt through the
> Debian alternatives system shows it's really bsd-mailx(1) from the package
> by the same name.
>
> Dave
>
>
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>
--
Jeffrey Haemer <jeffrey.haemer at gmail.com>
720-837-8908 [cell]
http://goyishekop.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20080728/1e38dc0e/attachment.html>
More information about the LUG
mailing list