File monitoring-plugins-network.spec of Package monitoring-plugins-network

# spec file for monitoring-plugins-network
# Copyright (c) 2019, Martin Hauke <>
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%global provider        github
%global provider_tld    com
%global project         araujobsd
%global repo            icinga2-network-plugin
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
%define realname check_network
Name:           monitoring-plugins-network
Version:        1.0
Release:        0
Summary:        A Nagios/Icinga plugin to monitor network traffic
License:        BSD-2-Clause
Group:          System/Monitoring
BuildRequires:  golang-packaging
BuildRequires:  nagios-rpm-macros
Requires:       vnstat >= 2.0

A Nagios/Icinga plugin that uses vnstat to monitor network traffic.
You can define warning and critical limits for the Transmit- and
Receive Rate on network interfaces (5 seconds sampling interval).

%setup -q -n icinga2-network-plugin-%{version}

sed -i 's|%{_prefix}/local/|%{_prefix}/|g' bsd_network.go
%{goprep} %{import_path}
%{gobuild} ...

install -d %{buildroot}/%{nagios_plugindir}/
mv %{buildroot}%{_bindir}/icinga2-network-plugin %{buildroot}/%{nagios_plugindir}/check_network

%{gotest} %{import_path}...

%files -f file.lst
%license LICENSE
%dir %{nagios_libdir}
%dir %{nagios_plugindir}