#!/bin/sh # # Copyright (c) 2013 Nagios Plugins Development Team # # Originally written by Holger Weiss . # # This file is free software; the Nagios Plugins Development Team gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY, to the extent permitted by law; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. mirrors=' ftp://ftp.fu-berlin.de/unix/network/monitoring-plugins/ ftp://ftp.lysator.liu.se/pub/monitoring-plugins/ ftp://ftp.belnet.be/mirror/nagios-plugins.org/ ftp://ftp.cc.uoc.gr/mirrors/monitoring-plugins/ ftp://mirrors.fe.up.pt/pub/monitoring-plugins/ ftp://ftp.osuosl.org/pub/monitoring-plugins/ ftp://mirror.bytemark.co.uk/monitoring-plugins/ ftp://mirror.is.co.za/mirror/monitoring-plugins.org/ ftp://mirror.webtastix.net/monitoring-plugins/ ftp://mirror.mephi.ru/nagios-plugins/ ' # # Our mirrors: # # GERMANY # # URLs: # - ftp://ftp.fu-berlin.de/unix/network/monitoring-plugins/ # # Features: # - IPv4 # - 10 GBit/s # - Updated four times a day # # Contacts: # - Mirror Admins # - Holger Weiss # # Home page: # - http://www.fu-berlin.de/en/ # # SWEDEN # # URLs: # - ftp://ftp.lysator.liu.se/pub/monitoring-plugins/ # - http://ftp.lysator.liu.se/pub/monitoring-plugins/ # - https://ftp.lysator.liu.se/pub/monitoring-plugins/ # - rsync://ftp.lysator.liu.se/pub/monitoring-plugins/ # # Features: # - IPv4 # - IPv6 # - 1 GBit/s # - Updated three times a day # # Contacts: # - Mirror Admins # - Niclas Zeising # # Home page: # - http://www.lysator.liu.se/english.html # # BELGIUM # # URLs: # - ftp://ftp.belnet.be/mirror/nagios-plugins.org/ # - http://ftp.belnet.be/nagios-plugins.org/ # # Features: # - IPv4 # - IPv6 # - Updated twice a day # # Contacts: # - Mirror Admins # # Home page: # - http://www.belnet.be/ # # GREECE # # URLs: # - ftp://ftp.cc.uoc.gr/mirrors/monitoring-plugins/ # - http://ftp.cc.uoc.gr/mirrors/monitoring-plugins/ # # Features: # - IPv4 # - Updated daily # # Contacts: # - Mirror Admins # - Counalakis Dimitris-Nektarios # # Home page: # - http://www.en.uoc.gr/ # # PORTUGAL # # URLs: # - ftp://mirrors.fe.up.pt/pub/monitoring-plugins/ # - http://mirrors.fe.up.pt/pub/monitoring-plugins/ # # Features: # - IPv4 # - IPv6 # - Updated daily # # Contacts: # - Mirror Admins # - Filipe Carvalho # # Home page: # - http://www.sp.up.pt/ # # UNITED STATES # # URLs: # - ftp://ftp.osuosl.org/pub/monitoring-plugins/ # - http://ftp.osuosl.org/pub/monitoring-plugins/ # # Features: # - IPv4 # - IPv6 # - Update interval unknown # # Contacts: # - Lance Albertson / Kerry Vance # # Home page: # - http://osuosl.org/ # # # UNITED KINGDOM # # URLs: # - ftp://mirror.bytemark.co.uk/monitoring-plugins/ # - http://mirror.bytemark.co.uk/monitoring-plugins/ # - rsync://mirror.bytemark.co.uk/monitoring-plugins/ (currently not available) # # Features: # - IPv4 # - IPv6 # - Updated twice a day # # Contacts: # - James Lawrie # # Home page: # - http://www.bytemark.co.uk/ # # SOUTH AFRICA # # URLs: # - ftp://mirror.is.co.za/mirror/monitoring-plugins.org/ # - http://mirror.is.co.za/mirror/monitoring-plugins.org/ # - rsync://mirror.is.co.za/mirror/monitoring-plugins.org/ # # Features: # - IPv4 # - Updated twice a day # # Contacts: # - Henti Smith # # Home page: # - http://www.is.co.za/ # # NEW ZEALAND # # URLs: # - ftp://mirror.webtastix.net/monitoring-plugins/ # - http://mirror.webtastix.net/monitoring-plugins/ # # Features: # - IPv4 # - Updated hourly # # Contacts: # - Mirror Admins # - Shane Langley # # Home page: # - http://www.webtastix.net/ # # RUSSIA # # URLs: # - ftp://mirror.mephi.ru/nagios-plugins/ # - http://mirror.mephi.ru/nagios-plugins/ # - rsync://mirror.mephi.ru/nagios-plugins/ # # Features: # - IPv4 # - Updated twice a day # # Contacts: # - Mirror Admins # - Andrew Savchenko # - Dmitry Okunev # # Home page: # - http://eng.mephi.ru/ # # CHINA # # URLs: # - http://mirrors.ustc.edu.cn/monitoring-plugins/ # - rsync://mirrors.ustc.edu.cn/monitoring-plugins/ # # Features: # - IPv4 # - IPv6 # - Updated twice a day # # Contacts: # - Mirror Admins # - Roy Zhang # # Home page: # - http://lug.ustc.edu.cn/ # set -e set -u umask 022 export PATH='/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' prefix='/home/plugins' myself=${0##*/} download_dir="$prefix/web/download" temp_dir=$(mktemp -d "/tmp/$myself.XXXXXX") trap 'rm -rf "$temp_dir"' EXIT cd "$temp_dir" date -d 'yesterday' '+%F' >'expected' for mirror in $mirrors do url="${mirror%/}/timestamp" if ncftpget -V -t 600 "$url" >'ftp.log' 2>&1 then cmp -s 'expected' 'timestamp' \ || echo >&2 "$mirror is outdated ($(cat 'timestamp'))." else tail -n 1 'ftp.log' >&2 fi rm -f 'timestamp' done cd "$OLDPWD" date '+%F' >"$download_dir/timestamp"