Hello community, here is the log from the commit of package monitoring-plugins-traffic_limit for openSUSE:Factory checked in at 2019-07-05 13:48:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/monitoring-plugins-traffic_limit (Old) and /work/SRC/openSUSE:Factory/.monitoring-plugins-traffic_limit.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "monitoring-plugins-traffic_limit" Fri Jul 5 13:48:47 2019 rev:3 rq:708767 version:0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/monitoring-plugins-traffic_limit/monitoring-plugins-traffic_limit.changes 2016-11-10 13:23:43.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins-traffic_limit.new.4615/monitoring-plugins-traffic_limit.changes 2019-07-05 13:48:48.569461759 +0200 @@ -1,0 +2,13 @@ +Mon Jun 3 09:38:00 UTC 2019 - Dirk Stoecker <opens...@dstoecker.de> + +- update to version 0.5 + * use b337c024130437d217d6be53ba58cd0238311200.patch for update + as upstream didn't react on proposal to do a "real" release + +------------------------------------------------------------------- +Wed Oct 18 15:46:25 UTC 2017 - opens...@dstoecker.de + +- Switch from Nagios::Plugin to Monitoring::Plugin +- Update to version 0.4 + +------------------------------------------------------------------- Old: ---- check_traffic_limit_0.3_20110209.tar.gz New: ---- 0.4.tar.gz b337c024130437d217d6be53ba58cd0238311200.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ monitoring-plugins-traffic_limit.spec ++++++ --- /var/tmp/diff_new_pack.V3QCiC/_old 2019-07-05 13:48:49.061462518 +0200 +++ /var/tmp/diff_new_pack.V3QCiC/_new 2019-07-05 13:48:49.065462524 +0200 @@ -1,7 +1,7 @@ # # spec file for package monitoring-plugins-traffic_limit # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,25 +12,27 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: monitoring-plugins-traffic_limit -Version: 0.3 +Version: 0.5 Release: 0 Summary: Checks the traffic on any interface License: BSD-4-Clause Group: System/Monitoring Url: http://exchange.nagios.org/directory/Plugins/Network-Connections%2C-Stats-and-Bandwidth/check_traffic_limit/details -Source0: check_traffic_limit_%{version}_20110209.tar.gz +Source0: https://github.com/localguru/check_traffic_limit/archive/0.4.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/localguru/check_traffic_limit/pull/1 +Patch1: b337c024130437d217d6be53ba58cd0238311200.patch BuildRequires: nagios-rpm-macros Provides: nagios-plugins-traffic_limit = %{version}-%{release} Obsoletes: nagios-plugins-traffic_limit < %{version}-%{release} Requires: gawk Requires: grep Requires: vnstat -Requires: perl(Nagios::Plugin) +Requires: perl(Monitoring::Plugin) BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -43,25 +45,23 @@ ./check_traffic_limit -i eth0 -w 10000 -c 12000 -p d %prep -%setup -q -n check_traffic_limit_%{version} +%setup -q -n check_traffic_limit-0.4 +%patch1 -p1 %build +sed -i s/Nagios::/Monitoring::/ check_traffic_limit %install install -Dm755 check_traffic_limit %{buildroot}/%{nagios_plugindir}/check_traffic_limit -install -Dm644 check_traffic_limit.ncfg %{buildroot}/%{nagiosgrapher_sysconfdir}/check_traffic_limit.ncfg %clean rm -rf %{buildroot} %files %defattr(-,root,root) -%doc CHANGES README +%doc docs README.md %dir %{nagios_libdir} %dir %{nagios_plugindir} -%attr(0755,root,%{nagios_command_group}) %dir %{nagios_sysconfdir} -%dir %{nagiosgrapher_sysconfdir} %{nagios_plugindir}/check_traffic_limit -%config(noreplace) %{nagiosgrapher_sysconfdir}/check_traffic_limit.ncfg %changelog ++++++ check_traffic_limit_0.3_20110209.tar.gz -> 0.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/CHANGES new/check_traffic_limit-0.4/CHANGES --- old/check_traffic_limit_0.3/CHANGES 2011-02-09 15:12:24.000000000 +0100 +++ new/check_traffic_limit-0.4/CHANGES 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -V0.3/2011-02-09 minor fixes, add nagios grapher template - -V0.2/2011-02-06 add daily and monthly limit, - some fixes for different vnstat versions - -V0.1/2011-02-05 initial version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/INSTALL new/check_traffic_limit-0.4/INSTALL --- old/check_traffic_limit_0.3/INSTALL 2011-02-06 23:51:42.000000000 +0100 +++ new/check_traffic_limit-0.4/INSTALL 1970-01-01 01:00:00.000000000 +0100 @@ -1,16 +0,0 @@ -installation -============ - -Just install and set up vnstat[1] and copy check_traffic_limit to -your nagios plugin directory, e.g. /usr/lib/nagios/plugins/contrib/ - -Please report any installation problem to <marcus.scho...@uni-bielefeld.de> - -[1] http://humdi.net/vnstat/ - - -nagiosgrapher -============= - -Copy check_traffic_limit.ncfg template to e.g. -/etc/nagiosgrapher/ngraph.d/standard/ and restart ngrapher. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/README new/check_traffic_limit-0.4/README --- old/check_traffic_limit_0.3/README 2011-02-06 21:05:57.000000000 +0100 +++ new/check_traffic_limit-0.4/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -check_traffic_limit is a Nagios plugin based on vnstat to check if daily or monthly traffic -limit of an interface has reached. - -Example: -check_traffic_limit_0.2 -i eth0 -w 10000 -c 12000 -p d diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/README.md new/check_traffic_limit-0.4/README.md --- old/check_traffic_limit_0.3/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/check_traffic_limit-0.4/README.md 2017-10-03 00:28:49.000000000 +0200 @@ -0,0 +1,108 @@ +# check_traffic_limit + +check_traffic_limit is a Nagios/Icinga2 plugin based on vnstat traffic accounting. It checks traffic on any interface and sends a warning when defined daily or monthly limits are reached. +The plugin comes with a pnp4Nagios grapher templates. + +# Installation + +* `apt install vnstat` +* `vnstat -u -i eth0` +* `apt install libnagios-plugin-perl` +* `cp check_traffic_limit /usr/local/lib/nagios/plugins/` + +# Usage + +see `check_traffic_limit --h` for help + +``` +check_traffic_limit -i interface + [-w warning_threshold] [-c critical_threshold] + [-p period d|m] +``` + +* Example: + + `check_traffic_limit -i eth0 -w 10000 -c 12000 -p d` + +# Icinga2 configuration + +### /etc/nagios/nrpe_local.cfg +``` +command[check_traffic_limit]=/usr/local/lib/nagios/plugins/check_traffic_limit -i $ARG1$ -w $ARG2$ -c $ARG3$ -p $ARG4$ +``` + +### /etc/icinga2/conf.d/hosts/servername/nrpe-check-traffic-limit.conf + +``` +object Service "NRPE trafficlimit: servername - day" { + import "generic-nrpe-service" + host_name = "servername" + check_command = "check_nrpe_1arg" + vars.nrpe_command = "check_traffic_limit" + + vars.nrpe_args = [ "$interface$", "$warning$", "$critical$", "$period$" ] + + vars.interface = "eth0" + vars.warning = "20971520" + vars.critical = "23068672" + vars.period = "d" +} + +object Service "NRPE trafficlimit: servername - month" { + import "generic-nrpe-service" + host_name = "servername" + check_command = "check_nrpe_1arg" + vars.nrpe_command = "check_traffic_limit" + + vars.nrpe_args = [ "$interface$", "$warning$", "$critical$", "$period$" ] + + vars.interface = "eth0" + vars.warning = "576716800" + vars.critical = "597688320" + vars.period = "m" + + check_interval = 10m +} +``` + +/etc/icinga2/conf.d/templates.conf +``` +template Service "generic-nrpe-service" { + import "generic-service" + check_command = "check_nrpe_1arg" + vars.pnp_check_arg1 = "!$nrpe_command$" +} +``` + +/etc/icinga2/conf.d/your_commands.conf +``` +object CheckCommand "check_nrpe_1arg" { + import "plugin-check-command" + command = [PluginDir + "/check_nrpe" ] + arguments = { + "-H" = "$nrpe_host$" + "-p" = "$nrpe_port$" + "-c" = "$nrpe_command$" + "-a" = { + value = "$nrpe_args$" + repeat_key = false + order = 1 + } + "-t" = "$nrpe_timeout$" + } + + vars.nrpe_host = "$address$" + vars.nrpe_port = 5666 + +``` +# Output examples + +#### 24h +![24h overview](docs/img/check_traffic_limit_day_24h.png) + +#### one year +![24h overview](docs/img/check_traffic_limit_month_year.png) + +# Feedback + +Feel free to contact me on any questions: marcus.scho...@uni-bielefeld.de diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/check_traffic_limit new/check_traffic_limit-0.4/check_traffic_limit --- old/check_traffic_limit_0.3/check_traffic_limit 2011-02-09 15:11:59.000000000 +0100 +++ new/check_traffic_limit-0.4/check_traffic_limit 2017-10-03 00:28:49.000000000 +0200 @@ -3,7 +3,7 @@ # --- =head1 NAME -check_traffic_limit - Nagios plugin for checking daily traffic limit +check_traffic_limit - Icinga2 / Nagios plugin for checking daily traffic limit =head1 SYNOPSIS @@ -15,14 +15,14 @@ =head1 OPTIONS =over 4 - + =item -i|--iface= Select one specific interface. Default is eth0. =item -w|--warning=threshold -threshold in ḱilobyte. All values must be integer and > 0. Default is unlimitted. +threshold in kilobyte. All values must be integer and > 0. Default is unlimitted. =item -c|--critical=threshold @@ -45,6 +45,8 @@ use Getopt::Long qw(:config no_ignore_case bundling); use Pod::Usage; +$ENV{'LC_ALL'}='C'; + my $vnstatbin = '/usr/bin/vnstat'; my $vnstat_output_kb = 'KB|KiB'; my $vnstat_output_mb = 'MB|MiB'; @@ -58,7 +60,7 @@ my $warn_threshold = '0:'; my $crit_threshold = '0:'; my $period = "d"; -my $version = 'v0.2/2011-02-06/schoppa'; +my $version = 'v0.4/2017-10-02/schoppa'; my $printversion = 0; my $result = UNKNOWN; my $help = 0; @@ -145,7 +147,7 @@ =head1 AUTHOR -marcus.scho...@uni-bielefeld.de +<marcus.scho...@uni-bielefeld.de> University of Bielefeld =head1 KNOWN ISSUES @@ -174,9 +176,10 @@ =head1 HISTORY +v0.4/2017-10-02 encoding bug fix in help output, LC_ALL fix + V0.3/2011-02-09 minor fixes, add nagios grapher template -V0.2/2011-02-06 add daily and monthly limit, - some fixes for different vnstat versions +V0.2/2011-02-06 add daily and monthly limit, some fixes for different vnstat versions V0.1/2011-02-05 initial version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/check_traffic_limit_0.3/check_traffic_limit.ncfg new/check_traffic_limit-0.4/check_traffic_limit.ncfg --- old/check_traffic_limit_0.3/check_traffic_limit.ncfg 2011-02-09 15:21:53.000000000 +0100 +++ new/check_traffic_limit-0.4/check_traffic_limit.ncfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,152 +0,0 @@ -# --- -# NagiosGrapher Template for check_traffic_limit -# Author: Marcus Schopen -# --- - -define ngraph{ - service_name TRAFFICLIMIT - graph_perf_regex TOTAL=(\d+) - graph_value TOTAL - graph_units MegaByte - graph_legend TOTAL: - rrd_plottype LINE2 - rrd_color FEF102 - page TOTAL -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source TOTAL - print_description Latest: - print_function LAST - print_format %2.2lf -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source TOTAL - print_description Minimum: - print_function MIN - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source TOTAL - print_description Maximum: - print_function MAX - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source TOTAL - print_description Average: - print_function AVERAGE - print_format %2.2lf - print_eol left - } - -# -- TRAFFICLIMIT2 CPU - -define ngraph{ - service_name TRAFFICLIMIT - graph_perf_regex IN=(\d+) - graph_value IN - graph_units MegaByte - graph_legend IN: - rrd_plottype LINE2 - rrd_color F34AC9 - page IN -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source IN - print_description Latest: - print_function LAST - print_format %2.2lf -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source IN - print_description Minimum: - print_function MIN - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source IN - print_description Maximum: - print_function MAX - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source IN - print_description Average: - print_function AVERAGE - print_format %2.2lf - print_eol left - } - -# -- TRAFFICLIMIT3 CPU - -define ngraph{ - service_name TRAFFICLIMIT - graph_perf_regex OUT=(\d+) - graph_value OUT - graph_units MegaByte - graph_legend OUT: - rrd_plottype LINE2 - rrd_color C5FE3F - page OUT -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source OUT - print_description Latest: - print_function LAST - print_format %2.2lf -} - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source OUT - print_description Minimum: - print_function MIN - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source OUT - print_description Maximum: - print_function MAX - print_format %2.2lf - } - -define ngraph{ - service_name TRAFFICLIMIT - type GPRINT - print_source OUT - print_description Average: - print_function AVERAGE - print_format %2.2lf - print_eol left - } Binary files old/check_traffic_limit_0.3/docs/img/check_traffic_limit_day_24h.png and new/check_traffic_limit-0.4/docs/img/check_traffic_limit_day_24h.png differ Binary files old/check_traffic_limit_0.3/docs/img/check_traffic_limit_month_year.png and new/check_traffic_limit-0.4/docs/img/check_traffic_limit_month_year.png differ ++++++ b337c024130437d217d6be53ba58cd0238311200.patch ++++++ >From b337c024130437d217d6be53ba58cd0238311200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20St=C3=B6cker?= <git...@dstoecker.de> Date: Tue, 28 May 2019 10:07:02 +0200 Subject: [PATCH] support ISO date, increase version to 0.5 --- check_traffic_limit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/check_traffic_limit b/check_traffic_limit index 129f7c1..61513b2 100755 --- a/check_traffic_limit +++ b/check_traffic_limit @@ -60,20 +60,20 @@ my $iface = 'eth0'; my $warn_threshold = '0:'; my $crit_threshold = '0:'; my $period = "d"; -my $version = 'v0.4/2017-10-02/schoppa'; +my $version = 'v0.5/2019-05-28/schoppa'; my $printversion = 0; my $result = UNKNOWN; my $help = 0; my $vnstatquery = ''; use Time::localtime; -my ($mday, $mon) = (localtime->mday,localtime->mon); +my ($mday, $mon, $year) = (localtime->mday,localtime->mon,1900+localtime->year); my $local_day = sprintf("%02d", $mday); my $local_month = sprintf("%02d", $mon +1); my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); my $local_month_abbreviated = $months[$local_month -1]; -my $day = "($local_month\/$local_day\/|$local_day\.$local_month\.)"; +my $day = "($local_month\/$local_day\/|$local_day\.$local_month\.|$year-$local_month-$local_day)"; my $month = "$local_month_abbreviated"; # -- GetOpt @@ -176,6 +176,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 HISTORY +v0.5/2019-05-28 support ISO data format yyyy-mm-dd + v0.4/2017-10-02 encoding bug fix in help output, LC_ALL fix V0.3/2011-02-09 minor fixes, add nagios grapher template