check mirror status in Solaris

hans hm04 hm04.yer at ma.yer.at
Wed Sep 22 23:27:57 CEST 2004



just do a diff of a given output for metastat 
and a current running metastat. 
depending on, set the exit-status. 
here an example, whichs works for me.

best regards 
hans 

-- 



metastat > /tmp/.mdstat.2 

echo 'd20: Mirror
    Submirror 0: d15
      State: Okay         
    Submirror 1: d16
      State: Okay         
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 135967680 blocks (64 GB)

d15: Submirror of d20
    State: Okay         
    Size: 135967680 blocks (64 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t5d0s0          0     No            Okay   Yes 


d16: Submirror of d20
    State: Okay         
    Size: 135967680 blocks (64 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t6d0s0          0     No            Okay   Yes 


Device Relocation Information:
Device   Reloc  Device ID
c1t6d0   Yes    id1,sd at SSEAGATE_ST373307LW______3HZ1DCFR000074146Q52
c1t5d0   Yes    id1,sd at SSEAGATE_ST373307LW______3HZ1TMW8000074134T27' > /tmp/.mdstat.1

if test -z "`diff /tmp/.mdstat.1 /tmp/.mdstat.2`" 
  then 
    echo METASTAT OK
    exit 0
  else 
    echo METASTAT CRITICAL 
    exit 2
fi


======================================================================
On Tue, Sep 21, 2004 at 04:02:07PM -0700, magadmin wrote:
> Hi every one,
> 
> Did any one try monitor disk mirror status in Solaris 8? I tried it but
> didn't work.
> 
> Here what I did:
> 
> cat /usr/opt/SUNWmd/sbin/metastat|grep blocks|while read n; do echo $n|grep
> "_"; done | wc -l
> 
> The output returns 0 on both computers with and without mirror setup. Can
> any one help me please?
> 
> Thank you for reading this post,
> Nguyen.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list