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

# spec file for package monitoring-plugins-smart_attributes
# Copyright (c) 2014 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
# 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

Name:           monitoring-plugins-smart_attributes
Version:        1.6
Release:        0
Summary:        SMART Attributes Monitoring Plugin
Group:          System/Monitoring
License:        GPL-3.0-or-later
BuildRequires:  nagios-rpm-macros
BuildRequires:  sudo
Requires:       smartmontools
Requires:       sudo
Requires:       perl(Config::JSON)
Requires:       perl(Getopt::Long)
Requires:       perl(Storable)
Recommends:     monitoring-plugins-common
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The Smart Attributes Monitoring Plugin allows you to monitor the Smart-Values
of SSDs and hard disks. The plugin is written in scripting language Perl and is
used to query smart values smartctl. The plugin is necessary as an
interpretation of the smart attributes is not normed. Each manufacturer has its
own definition of evaluating smart attributes. The plugin provides an easy way
to define definitions and monitor SSDs and HDDs correctly.

%setup -q -n check_smart_attributes-%{version}


install -Dm755 check_smart_attributes %{buildroot}/%{nagios_plugindir}/check_smart_attributes
install -Dm644 check_smartdb.json %{buildroot}/%{_sysconfdir}/monitoring-plugins/check_smartdb.json
mkdir -p %{buildroot}/%{_sysconfdir}/sudoers.d
cat >> %{buildroot}/%{_sysconfdir}/sudoers.d/check_smart_attributes << EOF
%{nagios_user} ALL=(root)NOPASSWD:%{_sbindir}/smartctl

%license COPYING
%doc changelog check_smartcfg.json
%dir %{_sysconfdir}/monitoring-plugins
%dir %{_sysconfdir}/sudoers.d
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%config(noreplace) %{_sysconfdir}/monitoring-plugins/check_smartdb.json
%config(noreplace) %{_sysconfdir}/sudoers.d/check_smart_attributes