From: Stroller <stroller@stellar.eclipse.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Disable fcron logging
Date: Sat, 21 Aug 2010 20:26:28 +0100 [thread overview]
Message-ID: <68A64BAB-F743-4908-A608-7D5549B0444C@stellar.eclipse.co.uk> (raw)
In-Reply-To: <201008211525.35115.wonko@wonkology.org>
On 21 Aug 2010, at 14:25, Alex Schuster wrote:
> ...
> I want to monitor the power status of my hard drives, so I wrote a
> little
> script that gives me this output:
>
> sda: standby
> sdb: standby
> sdc: active/idle 32°C
> sdd: active/idle 37°C
>
> This script is called every minute via an fcron entry, output goes
> into a
> log file, and I use the file monitor plasmoid to watch this log file
> in
> KDE.
>
> It's working fine, but also monitor my syslog in another file monitor
> plamoid, and now I get lots of these entries:
>
> Aug 21 14:21:06 [fcron] pam_unix(fcron:session): session opened for
> user root by (uid=0)
> Aug 21 14:21:06 [fcron] Job /usr/local/sbin/hdstate >> /var/log/
> hdstate started for user root (pid 24483)
> Aug 21 14:21:08 [fcron] Job /usr/local/sbin/hdstate >> /var/log/
> hdstate completed
> Aug 21 14:21:08 [fcron] pam_unix(fcron:session): session closed for
> user root
#!/bin/bash
while true
do
for drive in a b c d
do
/usr/sbin/smartctl /dev/sd$drive --whatever >> /var/log/hdstate
done
sleep 60
done
I would personally update more often than this, and my concern would
be that if the process fails then your plasmoid isn't showing the
correct data.
I presume this is the same with your current setup: if cron dies then
the current temperature will not be read to file, and the plasmoid
will continue reading the last lines in /var/log/hdstate - the drive
can overheat without you knowing about it.
So I would expect there to be a better "plasmid" for this task. I'm
completely unfamiliar with plasmids, but what you really want is a
plasmid that itself runs a script and displays the stdout on your
screen. That way if there's no data, or an error, then _you see that
in the plasmid_, instead of silently ignoring it (as you may be at
present).
The easiest (but dumb) way to handle this is to add the date to your
plasmid's display so that at least you can see that something's wrong
if it doesn't match the clock. A better way is not to have to watch a
status monitor at all, and just have a script running that emails you
if the temperature is above a specified range.
Stroller.
next prev parent reply other threads:[~2010-08-21 20:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-21 13:25 [gentoo-user] Disable fcron logging Alex Schuster
2010-08-21 13:43 ` Alan McKinnon
2010-08-23 22:12 ` Alex Schuster
2010-08-24 6:49 ` Alan McKinnon
2010-08-21 19:26 ` Stroller [this message]
2010-08-22 10:26 ` Alex Schuster
2010-08-22 19:00 ` Stroller
2010-08-22 19:50 ` Stroller
2010-08-22 21:39 ` Alex Schuster
2010-08-22 22:18 ` Mick
2010-08-24 13:31 ` KDE and hdparm (was: Re: [gentoo-user] Disable fcron logging) Alex Schuster
2010-08-25 9:54 ` [gentoo-user] Re: KDE and hdparm Alex Schuster
2010-08-25 19:14 ` Mick
2010-08-30 16:38 ` KDE and hdparm (was: Re: [gentoo-user] Disable fcron logging) Mick
2010-08-23 18:25 ` [gentoo-user] Disable fcron logging Stroller
2010-08-23 21:30 ` Alex Schuster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=68A64BAB-F743-4908-A608-7D5549B0444C@stellar.eclipse.co.uk \
--to=stroller@stellar.eclipse.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox