[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-poweredge
Subject:    Re: Monitoring disks and power supplies and fans and such...
From:       Ben Russo <ben () muppethouse ! com>
Date:       2004-05-27 13:49:04
Message-ID: 40B5F1D0.5090903 () muppethouse ! com
[Download RAW message or body]

Michael Weber wrote:

> Hi, Ben.
> 
> Would it be a problem to get a copy of your script?  I am just getting
> to write such a beast.
> 
> Thanx!
> 
> 
> 
Sure Michael,

I actually got this from someone else on the mailing list a while ago. 
I'm sorry I don't remember who, or I would give due credit.

[root@bonzo root]# cd /etc/RAID
[root@bonzo RAID]# ls -lart
total 668
-rw-r--r--    1 root     root           86 Aug  6  2002 raid.check.commands
-rw-r--r--    1 root     root          331 Aug  6  2002 cronlist
-rwxr-xr-x    1 root     root       642103 Aug 25  2003 
afaapps-2.6-0.i386.rpm
-rw-r--r--    1 root     root         1228 Aug 26  2003 
raid.production.config
-rw-r--r--    1 root     root          119 Aug 26  2003 testmsg.txt
-rwx------    1 root     root          507 Aug 26  2003 raid.cronjob
drwxr-xr-x   55 root     root         8192 May 25 14:24 ..
-rw-r--r--    1 root     root         1228 May 27 08:47 raid.current.config
-rw-r--r--    1 root     root            0 May 27 08:47 raid.check.diff
drwxr-xr-x    2 root     root         4096 May 27 08:47 .

*[root@bonzo RAID]# crontab -l
#  MIN   HOUR   DOM     MOY     DOW     COMMAND
# (0-59) (0-23) (1-31)  (1-12)  (0-6) 0=Sunday
#_____  ______  ______  ______  ______  ______
47 1,8,19 * * * /etc/RAID/raid.cronjob > /dev/null 2>&1
*
[root@bonzo RAID]# cat raid.cronjob
#!/bin/bash
cd /etc/RAID
rm raid.current.config
/usr/sbin/afacli < /etc/RAID/raid.check.commands
diff raid.current.config raid.production.config > raid.check.diff
NUMLINES=`cat /etc/RAID/raid.check.diff | wc -l`
if [ $NUMLINES -gt 0 ]
        then
        logger -p kern.emerg -t DISK-ERROR cronjob 
/etc/RAID/raid.cronjob dead hard disk on BONZO.reston.tnsi.com, please 
check asap.
        sendmail Eli@mydomain.com < testmsg.txt
        sendmail Ben.Russo@mydomain.com < testmsg.txt
        sendmail 8772283694@mydomain.com < testmsg.txt
        fi

[root@bonzo RAID]# cat raid.production.config
File raid.current.config receiving all output.

AFA0>
COMMAND: container list
Executing: container list
Num          Total  Oth Chunk          Scsi   Partition
Label Type   Size   Ctr Size   Usage   B:ID:L Offset:Size
----- ------ ------ --- ------ ------- ------ -------------
 0    RAID-5  546GB       32KB Open    0:01:0 64.0KB: 136GB
 /dev/sda                              0:04:0 64.0KB: 136GB
                                       0:02:0 64.0KB: 136GB
                                       0:03:0 64.0KB: 136GB
                                       0:00:0 64.0KB: 136GB


AFA0>
COMMAND: disk list
Executing: disk list

B:ID:L  Device Type     Blocks    Bytes/Block Usage            Shared Rate
------  --------------  --------- ----------- ---------------- ------ ----
0:00:0   Disk            286749480 512         Initialized      NO     160
0:01:0   Disk            286749480 512         Initialized      NO     160
0:02:0   Disk            286749480 512         Initialized      NO     160
0:03:0   Disk            286749480 512         Initialized      NO     160
0:04:0   Disk            286749480 512         Initialized      NO     160

AFA0>
COMMAND: logfile end
Executing: logfile end

*[root@bonzo RAID]# cat testmsg.txt
From: root@bonzo.reston.tnsi.com
To: MIS-UNIX-ALERTS
Subject: BONZO HAS RAID PROBLEM
Bonzo has a Disk or RAID problem.
*

_______________________________________________
Linux-PowerEdge mailing list
Linux-PowerEdge@dell.com
http://lists.us.dell.com/mailman/listinfo/linux-poweredge
Please read the FAQ at http://lists.us.dell.com/faq or search the list archives at \
http://lists.us.dell.com/htdig/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic