Re: Notification for GMirror failures

2018-05-08 Thread Jack L.
I use crontab @daily (/sbin/gmirror status | grep -q COMPLETE) || mail
-s "gmirror failure" email addy

On Tue, May 8, 2018 at 4:41 PM, Vincent Hoffman-Kazlauskas
 wrote:
>
>
> On 08/05/2018 08:28, Andrea Brancatelli wrote:
>> Hi,
>>
>> out of curiosity, does any kind of GMirror-failure notification tools
>> exist?
>>
>> Either native... SNMP... external ports... whatever?
>>
> If you use nagios (or compatible) net-mgmt/nagios-geom in ports works
>
> root@banshee # /usr/local/libexec/nagios/check_geom mirror gm0
> OK mirror/gm0 COMPLETE { ada0s1 (ACTIVE) , ada1s1 (ACTIVE)
> }|geom_mirror=2;;;0;
> ($00:41:05 $) 0
>
>
> Vince
> ___
> freebsd-stable@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Notification for GMirror failures

2018-05-08 Thread Vincent Hoffman-Kazlauskas


On 08/05/2018 08:28, Andrea Brancatelli wrote:
> Hi, 
> 
> out of curiosity, does any kind of GMirror-failure notification tools
> exist? 
> 
> Either native... SNMP... external ports... whatever?
> 
If you use nagios (or compatible) net-mgmt/nagios-geom in ports works

root@banshee # /usr/local/libexec/nagios/check_geom mirror gm0
OK mirror/gm0 COMPLETE { ada0s1 (ACTIVE) , ada1s1 (ACTIVE)
}|geom_mirror=2;;;0;
($00:41:05 $) 0


Vince
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Userland PPP on ADSL

2018-05-08 Thread Eugene Grosbein
08.05.2018 12:08, O'Connor, Daniel wrote:
> Hi,
> I have several FreeBSD machines setup as routers connected to ADSL modems in 
> bridge mode. ie the FreeBSD box terminates the PPP connection and the ADSL 
> modem doesn't do much.
> 
> This worked well for many moons but a while ago I found issues with the 
> inbuilt PPP and ended up switching to mpd5 which has so far worked flawlessly.
> 
> I was wondering if anyone else had also seen similar issues?
> 
> In my experience PPP will hang for a long time when the ADSL link goes down. 
> It does seem to eventually come back (minutes later) but while it's stuck it 
> will only exit with kill -9.
> 
> This wouldn't be such a big deal but the rc.d script doesn't actually check 
> if the PPP process exits so a naive monitoring script that does 'service ppp 
> restart' will end up with 2 processes which usually screws up firewall rules. 
> There are ways around this (eg have the script check, or set ppp_unit) but it 
> seems like a bug.
> 
> The only log messages I see are..
> May  8 12:27:53 portero ppp[76165]: tun0: LCP: deflink: SendEchoReply(114) 
> state = Opened
> May  8 12:27:54 portero ppp[76165]: tun0: LCP: deflink: SendEchoRequest(38) 
> state = Opened
> May  8 12:27:54 portero ppp[76165]: tun0: LCP: deflink: RecvEchoReply(38) 
> state = Opened
> May  8 12:28:54 portero ppp[76165]: tun0: LCP: deflink: SendEchoRequest(39) 
> state = Opened
> May  8 12:29:54 portero ppp[76165]: tun0: LCP: deflink: SendEchoRequest(40) 
> state = Opened
> 
> Does anyone have any suggestions where to start looking? It would be nice if 
> the base tool worked properly for what I feel is a not uncommon scenario :)

You have not specified FreeBSD version you use.

First, you should check if the ppp process is waiting on some system call when 
it's hung.
Use ps -l or procstat to check it. And you should enable verbose logs in 
ppp.conf.

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Notification for gmirror failures

2018-05-08 Thread Miroslav Lachman

Andrea Brancatelli wrote on 2018/05/08 09:28:

Hi,

out of curiosity, does any kind of GMirror-failure notification tools
exist?

Either native... SNMP... external ports... whatever?


I don't know any daemon like solution so I wrote some simple shell 
script. Its used on all our machines. It should be run be cron in some 
sane interval (like each 5 or 10 minutes)


#!/bin/sh

## $Id: check_gmirror.sh 8c1f418ba7f5 2017-06-15 12:36 +0200 lachman $

export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"

mailto="y...@example.com"
subject_pref="$(hostname) gmirror"
notify_state="/var/run/${0##*/}.notified"

cmd_out=$(gmirror status -s)

components="$(echo "$cmd_out" | grep -F -v COMPLETE)"

if [ -n "$components" ]; then
if [ ! -f "$notify_state" ]; then
subject="$subject_pref FAILED - $(date '+%Y-%m-%d %H:%M:%S')"
echo "$cmd_out" | sed -E 's/(SYNCHRONIZING,) [0-9]+%/\1 x%/' > 
"$notify_state"

echo "$cmd_out" | mail -s "$subject" "$mailto"
echo "$subject" | logger
else
subject="$subject_pref FAILED - $(date '+%Y-%m-%d %H:%M:%S')"
echo "$cmd_out" | sed -E 's/(SYNCHRONIZING,) [0-9]+%/\1 x%/' > 
"$notify_state.now"
diff -u -b -B "$notify_state" "$notify_state.now" > 
"$notify_state.diff"


if [ -s "$notify_state.diff" ]; then## if diff is not empty
cat "$notify_state.diff" | mail -s "$subject" "$mailto"
echo "$subject additional failure occurred" | logger
cp "$notify_state.now" "$notify_state"
fi
rm "$notify_state.now" "$notify_state.diff"
fi
else
if [ -f "$notify_state" ]; then
rm "$notify_state"
subject="$subject_pref now OK - $(date '+%Y-%m-%d %H:%M:%S')"
echo "$cmd_out" | mail -s "$subject" "$mailto"
echo "$subject" | logger
fi
fi


We have similar script for checking ZFS too.

Miroslav Lachman
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Notification for GMirror failures

2018-05-08 Thread Patrick M. Hausen
Hi all,


> Am 08.05.2018 um 09:28 schrieb Andrea Brancatelli :
> out of curiosity, does any kind of GMirror-failure notification tools
> exist? 

http://soren.klintrup.dk/gmirror

We use it in production. Works as designed.

HTH,
Patrick
-- 
punkt.de GmbH   Internet - Dienstleistungen - Beratung
Kaiserallee 13a Tel.: 0721 9109-0 Fax: -100
76133 Karlsruhe i...@punkt.de   http://punkt.de
AG Mannheim 108285  Gf: Juergen Egeling

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Notification for GMirror failures

2018-05-08 Thread Andrea Brancatelli
Hi, 

out of curiosity, does any kind of GMirror-failure notification tools
exist? 

Either native... SNMP... external ports... whatever?

-- 

Andrea Brancatelli
Schema31 S.p.a.
Chief Technology Officier

ROMA - FI - PA 
ITALY
Tel: +39.06.98.358.472
Cell: +39.331.2488468
Fax: +39.055.71.880.466
Società del Gruppo OVIDIO TECH S.R.L.
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"