diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml new file mode 100644 index 00000000..aa58ba4d --- /dev/null +++ b/.github/workflows/build-test.yaml @@ -0,0 +1,64 @@ +name: Build Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + strategy: + matrix: + os: + - ubuntu-20.04 + - ubuntu-latest + # no libssl on windows + # - windows-latest + fail-fast: false + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: CPAN Cache + id: cpan-cache + uses: actions/cache@v3 + with: + path: thirdparty + key: ${{ matrix.os }}-cpan-{{ hashFiles('**/cpanfile') }} + + - name: Install dependencies + run: sudo apt-get install librrds-perl rrdtool dma + + - name: Bootstrap + run: ./bootstrap + + - name: Configure + run: ./configure --prefix=$HOME/test-install + + - name: Make + run: make + + - name: Dist + run: make dist + + - name: Check Dist + run: | + make dist + tar xf *-$(cat VERSION).tar.gz + cd *-$(cat VERSION) + ./configure --prefix=$HOME/test-install + cp -rp ../thirdparty/lib thirdparty/ + make + make install + cd $HOME/test-install + ./bin/smokeping --version + + - name: Cache Prep + run: | + rm -rf thirdparty/Makefile* thirdparty/work diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 00000000..a3a86637 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,21 @@ +name: Mark stale issues and pull requests +# https://github.com/actions/stale +on: + schedule: + - cron: "21 4 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3 + with: + stale-issue-message: 'This issue has become stale and will be closed automatically within 7 days. Comment on the issue to keep it alive.' + stale-pr-message: 'This pull request has become stale and will be closed automatically within 7 days. Comment on the PR to keep it alive.' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + days-before-stale: 90 + days-before-issue-close: 7 + days-before-pr-close: 7 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9d8ecc76..7e627f23 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ etc/config.dist thirdparty/* !thirdparty/ !thirdparty/Makefile.am -!thirdparty/Makefile.in \ No newline at end of file +*-*.*.*/ +*.gz \ No newline at end of file diff --git a/CHANGES b/CHANGES index 66a3b605..c3484997 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,60 @@ + - fix error when toggling autorefresh @jlu5 + - Support parsing IPv6 output in OpenSSHJunOSPing Plugin @zimage + - Enhancement to SSHProbe allows specification of IPv4 vs IPv6 transport, #385 + - InfluxDB 2.x v1 (compatibility) api doesn't set the "WWW-Authenticate" header (violating rfc7235). + Work around this issue by manually setting the Authorization header @HandyMenny + - use actual link for form submission @michaelharo + - allow to enable/disable autorefresh from ui @Fantros + - make image responsive @HinataKato + - add fix for #209 - auto create 'dyndir' structure when saving slave updates @simfishing + - add favicon (bas64) to basepage.html @rezzorix + - add "Home"-Link to basepage.html @rezzorix + - remove --insecure from curl (wget does not have it!) in configure.ac @Gunni + - add fix for curl feature checking introduced in curl 7.74 and later @matellis + - enhancement to extend color handling, making dark templates easier to do @matellis + - enhancement to remove more borders with graphborders set to no @matellis + - add "literalsearch" option to filter targets using literal strings instead + of regex @jlu5 + - OpenSSH 9.8 compatibility for SSH Plugin @ermuller + +2021-08-13 08:12:06 +0200 Tobias Oetiker + + - release 2.8.2 + - fix spelling issues in FTPtransfer.pm + - add missing README.md to the release archive + +2021-08-11 17:12:22 +0200 Tobias Oetiker + + - release 2.8.1 + - fix regression with 'use FindBin' missing from the installed scripts + +2021-08-06 15:46:22 +0200 Tobias Oetiker + + - release 2.8.0 + - support for influxdb @mad-ady + - AnotherDNS update @parseword + - new matcher ConsecutiveLoss @rborgmaster + - lots of spelling fixes @jsoref + - update FPing commandline @lelutin + - better handling of return codes from probe binaries @lelutin + - manual page for smokeinfo @lelutin + - drop SSHv1 and rsa1 from SSH.pm @Strykar + - disable page refresh while zooming @n0rc + - overflow scrollbar @bevhost + - update url in zoom mode @dekenberg + - allow relative time entry for cropper @dekenberg + - fix config reload for slaves @stromnet + - improved template layout @bevhost + - fix edgetrigger functionality @oetiker + - fping protocol parameter optional @AID + - exploss matcher fixes @dfrli + - interface parameter for fping probe @saaly182 + - pass 6th argument to edgetrigger external alerts @Ryan Rawdon + - red background for 100% loss @dagelf + - probe target in graph title @Daxtorim + - make loss colors more distinctive @Daxtorim + - calculate loss buckets based on number of 'pings' @Daxtorim + commit 0992229546c3732d12ac5af348672c58b6ad8e74 Author: Tobias Oetiker Date: Thu Dec 20 11:23:55 2018 +0100 diff --git a/Makefile.am b/Makefile.am index ac83abd0..1dc34c75 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,14 +16,9 @@ AUTOMAKE_OPTIONS = foreign -SUBDIRS = thirdparty doc etc htdocs lib bin +SUBDIRS = lib thirdparty bin doc etc htdocs -EXTRA_DIST = COPYRIGHT CHANGES CONTRIBUTORS LICENSE PERL_MODULES VERSION - -THIRDPARTY_DIR := $(shell pwd)/thirdparty +EXTRA_DIST = COPYRIGHT CHANGES CONTRIBUTORS LICENSE cpanfile VERSION README.md dist-hook: $(PERL) -i -p -e '"$(PACKAGE_VERSION)" =~ /(\d+)\.(\d+)\.(\d+)/ and $$v = sprintf("%d.%03d%03d",$$1,$$2,$$3) and s/^\$$VERSION\s*=\s*".*?"/\$$VERSION = "$$v"/' $(distdir)/lib/Smokeping.pm - -install-exec-hook: - [ ! -d $(THIRDPARTY_DIR)/lib/perl5 ] || $(CP) -fr $(THIRDPARTY_DIR)/lib/perl5/* $(DESTDIR)$(libdir) diff --git a/PERL_MODULES b/PERL_MODULES deleted file mode 100644 index 16645f1b..00000000 --- a/PERL_MODULES +++ /dev/null @@ -1,20 +0,0 @@ -FCGI -CGI -CGI::Fast -Config::Grammar -Socket6 -IO::Socket::SSL -Digest::HMAC_MD5 -Net::Telnet -Net::OpenSSH -Net::SNMP -Net::LDAP -Net::DNS -IO::Pty -LWP -Authen::Radius -Path::Tiny -InfluxDB::HTTP -InfluxDB::LineProtocol -JSON::MaybeXS -Object::Result diff --git a/README b/README.md similarity index 56% rename from README rename to README.md index 606b2d42..08d772eb 100644 --- a/README +++ b/README.md @@ -1,18 +1,20 @@ +``` ____ _ ____ _ / ___| _ __ ___ ___ | | _____| _ \(_)_ __ __ _ \___ \| '_ ` _ \ / _ \| |/ / _ \ |_) | | '_ \ / _` | ___) | | | | | | (_) | < __/ __/| | | | | (_| | |____/|_| |_| |_|\___/|_|\_\___|_| |_|_| |_|\__, | |___/ -Authors: Tobias Oetiker - Niko Tyni +``` +Original Authors: Tobias Oetiker and Niko Tyni - SmokePing is a latency logging and graphing and - alerting system. It consists of a daemon process which - organizes the latency measurements and a CGI which - presents the graphs. +[![Build Test](https://github.com/oetiker/SmokePing/actions/workflows/build-test.yaml/badge.svg)](https://github.com/oetiker/SmokePing/actions/workflows/build-test.yaml) +SmokePing is a latency logging and graphing and +alerting system. It consists of a daemon process which +organizes the latency measurements and a CGI which +presents the graphs. SmokePing is ... ================ @@ -29,15 +31,6 @@ SmokePing is ... * able to deal with DYNAMIC IP addresses as used with Cable and ADSL internet. -Do you like it -============== - -If you like SmokePing, and want to show your appreciation for -the work I am doing (SmokePing like MRTG and RRDtool have -been written entirely in my spare time) please feel free to -use: - - http://tobi.oetiker.ch/wish cheers tobi diff --git a/VERSION b/VERSION index 2c9b4ef4..1817afea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.7.3 +2.8.2 diff --git a/bin/Makefile.am b/bin/Makefile.am index 3f4b21a6..2c6f3bc5 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -18,8 +18,7 @@ dist_bin_SCRIPTS = smokeinfo smokeping smokeping_cgi tSmoke install-exec-hook: - test "$(PERL5LIB)" = "" || cd "$(DESTDIR)$(bindir)" && $(PERL) -i -p -e 's{^#!.*}{#!$(PERL)}; s{.*# PERL5LIB}{use lib (split /:/, q{$(PERL5LIB)}); # PERL5LIB}' $(dist_bin_SCRIPTS) + test "$(PERL5LIB)" = "" || cd "$(DESTDIR)$(bindir)" && $(PERL) -i -p -e 's{.*# PERL5LIB}{use lib (split /:/, q{$(PERL5LIB)}); # PERL5LIB}' $(dist_bin_SCRIPTS) cd "$(DESTDIR)$(bindir)" && $(PERL) -i -p -e 's{.*# LIBDIR}{use lib qw($(libdir)); # LIBDIR}' $(dist_bin_SCRIPTS) cd "$(DESTDIR)$(bindir)" && $(PERL) -i -p -e 's{^#!.*perl.*}{#!$(PERL)};' $(dist_bin_SCRIPTS) - # EOF diff --git a/bin/smokeping b/bin/smokeping index 041eebfe..1dae42a0 100755 --- a/bin/smokeping +++ b/bin/smokeping @@ -4,8 +4,8 @@ use strict; use warnings; -use lib (split /:/, q{}); # PERL5LIB use FindBin; +use lib (split /:/, q{}); # PERL5LIB use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR use Smokeping; diff --git a/bin/smokeping_cgi b/bin/smokeping_cgi index dee9c888..610118c9 100755 --- a/bin/smokeping_cgi +++ b/bin/smokeping_cgi @@ -4,8 +4,8 @@ use strict; use warnings; -use lib (split /:/, q{}); # PERL5LIB use FindBin; +use lib (split /:/, q{}); # PERL5LIB use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR # don't bother with zombies diff --git a/bin/tSmoke b/bin/tSmoke index 03385550..85591890 100755 --- a/bin/tSmoke +++ b/bin/tSmoke @@ -53,7 +53,8 @@ use warnings; # Point the lib variables to your implementation use lib (split /:/, q{}); # PERL5LIB -use FindBin;use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR +use FindBin; +use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR use Smokeping; @@ -63,7 +64,7 @@ use Pod::Usage; use RRDs; # Point to your Smokeping config file -my $cfgfile = "etc/config.dist"; +my $cfgfile = (shift @ARGV) || "$FindBin::Bin/../etc/config"; # global variables my $cfg; diff --git a/configure.ac b/configure.ac index df38556a..3a5af124 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# Copyright (C) 2011 Tobi Oetiker +# Copyright (C) 2021 Tobi Oetiker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,10 +22,7 @@ AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(conftools) # need this to allow long path names -AM_INIT_AUTOMAKE([1.9 tar-ustar foreign no-dependencies no-installinfo no-texinfo.tex nostdinc ]) -AM_MAINTAINER_MODE - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AM_INIT_AUTOMAKE([1.9 tar-ustar foreign]) AC_PREFIX_DEFAULT(/opt/$PACKAGE_NAME-$PACKAGE_VERSION) @@ -37,7 +34,7 @@ AC_PATH_PROG(WGET, wget, no) URL_CAT="neither curl nor wget found" if test -x "$CURL"; then - URL_CAT="$CURL --location --insecure" + URL_CAT="$CURL --location" else if test -x "$WGET"; then URL_CAT="$WGET -O -" @@ -71,7 +68,7 @@ AC_PATH_PROG(RM, rm, no) AC_PATH_PROG(RMDIR, rmdir, no) AC_PATH_PROG(MKDIR, mkdir, no) AC_PATH_PROG(FIND, find, no) -AC_PATH_PROG(SENDMAIL, sendmail, /path/to/sendmail, [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/lib]) +AC_PATH_PROG(SENDMAIL, sendmail, /path/to/sendmail, $PATH:/usr/sbin:/usr/lib) AC_PATH_PROGS(NROFF, [gnroff nroff]) AC_ARG_VAR(GMAKE, [Path to local GNU Make binary]) diff --git a/cpanfile b/cpanfile new file mode 100644 index 00000000..d10728c0 --- /dev/null +++ b/cpanfile @@ -0,0 +1,24 @@ +requires 'FCGI'; +requires 'CGI'; +requires 'CGI::Fast'; +requires 'Config::Grammar'; +requires 'Socket6'; +requires 'IO::Socket::SSL'; +requires 'Digest::HMAC_MD5'; +requires 'Net::Telnet'; +requires 'Net::OpenSSH'; +requires 'Net::SNMP'; +requires 'Net::LDAP'; +requires 'Net::DNS'; +requires 'IO::Pty'; +requires 'LWP'; +requires 'Authen::Radius'; +requires 'Path::Tiny'; +requires 'MIME::Base64'; +requires 'InfluxDB::HTTP'; +requires 'InfluxDB::LineProtocol'; +# JSON::MaybeXS and Object::Result are required by InfluxDB::HTTP but were not +# listed in that lib's dependencies, so we need to cover for them here. +# See: https://github.com/raphaelthomas/InfluxDB-HTTP/issues/10 +requires 'JSON::MaybeXS'; +requires 'Object::Result'; diff --git a/etc/basepage.html.dist b/etc/basepage.html.dist index ab2318cc..2c0694f1 100644 --- a/etc/basepage.html.dist +++ b/etc/basepage.html.dist @@ -1,11 +1,16 @@ + - SmokePing Latency Page for <##title##> + @@ -17,6 +22,9 @@