[DRBD-user] DRBD notification

James R. Leu jleu at inoc.com
Mon Nov 5 15:22:37 CET 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


You can monitor the state of DRBD via SNMP by using net-snmp's snmpd
'extend' feature:

Add this to /etc/snmp/snmpd.conf:

    extend drbd-value /usr/bin/drbd-status.sh

The contents of /usr/bin/drbd-status.sh should be:

    #!/bin/sh
    for i in `/bin/cat /proc/drbd | grep "cs:" | awk '{print $2}' | awk -F: '{print $2}'`
    do 
    if [ "$i" == "Connected" ]; then
        echo "1";
    else 
        echo "2";
    fi
    done

Then use the following SNMP OID to walk the resulting 'table':

    1.3.6.1.4.1.8072.1.3.2.4.1.2.15.100.114.98.100.45.118.97.108.117.101
                                     d   r   b  d  -  v   a   l   u   e

We then setup a 'threshold' in our monitoring system for when the values
are not '1'.  This technique could be extended to accomplish a lot more.

On Mon, Nov 05, 2007 at 02:02:43PM +0000, Igor Neves wrote:
> On Mon, 5 Nov 2007 15:24:14 +0200
> Marian Marinov <mm at yuhu.biz> wrote:
> 
> > On Monday 05 November 2007 15:06:52 Rodrigo Campos wrote:
> > > On 11/5/07, Igor Neves <igor at 3gnt.net> wrote:
> > > > Hi,
> > > >
> > > > There is some kind of notification (email, execute some script or
> > > > something) implemented in drbd?
> > > >
> > > > I need DRBD to be reactive to some situations:
> > > > * Split-Brain (IMPORTANT)
> > > > * State Change (primary->secondary) (LESS IMPORTANT)
> > > > * Sync's (MUCH LESS IMPORTANT)
> > > > * ...
> > > >
> > > > I can do some cron job script, to parse the output of '/proc/drbd'
> > > > every minute of so, but i want something more professional. It's
> > > > there anything something like this in DRBD?
> > > >
> > > > I'm using drbd 8.0.6 release.
> > >
> > > There was a "plug-in" for nagios to check drbd services somewhere.
> > > But i dont remember if it works well with drbd 8.0
> > >
> > > Thanks,
> > > Rodrigo
> > 
> > Try heartbeat http://linux-ha.org
> > 
> > Regards
> > Marian
> 
> I'm using it, but heartbeat for itself, does not notify me of anything.
> 
> I have configured in heartbeat one resource, that send me one email in
> the end of the service were migrated.
> But the problem persists when there is a split-brain the drbd on the
> Primary, will be primary anyway, and work in StandAlone mode, and I'm
> never notificated, and the service remains working.
> 
> Thanks.
> ---------
> Igor Neves <igor.neves at 3gnt.net>
> 3GNTW - Tecnologias de Informação, Lda
>  
>  sip igor at 3gnt.net 	jid igor at jabber.3gnt.org
>  icq 249075444		tlm 00351914503611
> 
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user

-- 
James R. Leu
Software Architect
INOC
608.204.0203
608.663.4555 fax
jleu at inoc.com
www.inoc.com

*** DELIVERING UPTIME ***
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20071105/a2959297/attachment.pgp>


More information about the drbd-user mailing list