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

#
# spec file for package monitoring-plugins-wl
#
# Copyright (c) 2014 SUSE LINUX Products 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 http://bugs.opensuse.org/
#

Name:           monitoring-plugins-wl
Version:        1.0.0
Release:        100
License:        GPL-2.0+
Summary:        William Leibzon public code repository for nagios plugins
Url:            https://github.com/willixix/WL-NagiosPlugins
Group:          System/Monitoring
Source0:        WL-NagiosPlugins-master.zip
Provides:       nagios-plugins-wl = %{version}-%{release}
Obsoletes:      nagios-plugins-wl < %{version}-%{release}
BuildRequires:  nagios-rpm-macros
BuildRequires:  perl
BuildRequires:  unzip
Requires:       perl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Nagios is a program that will monitor hosts and services on your
network, and to email or page you when a problem arises or is resolved.
Nagios runs on a unix server as a background or daemon process,
intermittently running checks on various services that you specify.

The actual service checks are performed by separate "plugin" programs
which return the status of the checks to Nagios.

This package contains additional nagios plugins provided by William Leibzon:
http://william.leibzon.org/nagios/
https://github.com/willixix/WL-NagiosPlugins

%package all
Summary:        All William Leibzon Nagios-Plugin checks
Group:          System/Monitoring
Provides:       nagios-plugins-wl-all = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-all < %{version}-%{release}
Requires:       perl
Requires:       %{name}-common
Requires:       %{name}-by_snmp
Requires:       %{name}-daytime
Requires:       %{name}-dnsname
Requires:       %{name}-files
Requires:       %{name}-jboss
Requires:       %{name}-linux_procstat
Requires:       %{name}-localtime
Requires:       %{name}-memcached
Requires:       %{name}-mysqld
Requires:       %{name}-netint
Requires:       %{name}-netsnmp_memory
Requires:       %{name}-netsnmp_memory_15
Requires:       %{name}-netstat
Requires:       %{name}-profile_nagios_executiontime
Requires:       %{name}-redis
Requires:       %{name}-snmp_attributes
Requires:       %{name}-snmp_baytech_pdu
Requires:       %{name}-snmp_dell_powersupply
Requires:       %{name}-snmp_netint
Requires:       %{name}-snmp_raid
Requires:       %{name}-snmp_table
Requires:       %{name}-snmp_temperature
Requires:       %{name}-tftp
Requires:       %{name}-uptime

%description all
This virtual package recommends all currently available 
Nagios plugins provided by William Leibzon:
http://william.leibzon.org/nagios/
https://github.com/willixix/WL-NagiosPlugins

%package common
Summary:        Libraries for William Leibzon Nagios plugins
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-common = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-common < %{version}-%{release}

%description common
This package includes the libraries (scripts) that are included by many
of the standard checks.

%package by_snmp
Summary:        William Leibzon check_by_snmp
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-by_snmp = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-by_snmp < %{version}-%{release}

%description by_snmp
This plugin is used in conjunction with other plugins to retrieve data
made available using snmpexec and provide this to other plugins for
processing or to execute plugins remotely using snmpd and return the
results to Nagios.

%package daytime
Summary:        William Leibzon check_daytime
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-daytime = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-daytime < %{version}-%{release}

%description daytime
This plugin checks that time on remote host is no more than specified
number of seconds different then on nagios server. It supports checking
time using TCP or UDP with daytime (port 13) and time (port 37) protocols.
You should use it only if you can not use NTP to check time on remote
system as this is not precise enough.

%package dnsname
Summary:        William Leibzon check_dnsname
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-dnsname = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-dnsname < %{version}-%{release}

%description dnsname
This plugin checks that specifies dns hostname exists and corresponds
to expected ip address or has the same ip address as another "base" hostname. 
    
%package files
Summary:        William Leibzon check_files
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-files = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-files < %{version}-%{release}

%description files
This plugin checks how many files of given type/name are in the directory
and can return an error if there are too many. It can also check that given
directory or file has not been un-updated for too long.

%package jboss
Summary:        William Leibzon check_jboss
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-jboss = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-jboss < %{version}-%{release}

%description jboss
This plugins checks one or more JBOSS attributes allows to set thresholds
for when to send WARNING or CRITICAL alert. It uses twiddleutility and
will therefore require local copy of JBOSS.

%package linux_procstat
Summary:        William Leibzon check_linux_procstat
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-linux_procstat = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-linux_procstat < %{version}-%{release}

%description linux_procstat
This plugin parses data from /proc/stat on linux system and outputs
CPU utilization and load data. It outputs a lot more data
(user, system, iowait, irq for each cpu and tnumber of processes
and context switches) as performance data for graphing and other use.

%package localtime
Summary:        William Leibzon check_localtime
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-localtime = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-localtime < %{version}-%{release}

%description localtime
This plugin returns localtime of the system and can do WARN and CRITICAL alerts
if its within certain range. This is useful for regularly (daily, twice-daily)
heartbeat alerts. Despite being one of my early plugins, it works well and does
exactly what I want (so I never really needed to modify it) and has been used
in every place I setup nagios on.

%package memcached
Summary:        William Leibzon check_memcached
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-memcached = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-memcached < %{version}-%{release}

%description memcached
This is Memcached Check plugin. It gets stats variables and allows
to set thresholds on their value or their rate of change. It can measure
response time, caclulate hitrate, memory utilization and other data.
It also returns status variables as perf data for graphing and processing,
and you can download templates for PNP4Nagios here: check_memcached.php

%package mysqld
Summary:        William Leibzon check_mysqld version
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-mysqld = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-mysqld < %{version}-%{release}

%description mysqld
Replacement for check_mysql that allows to set thresholds for
any variables in SHOW STATUS or for similar SQL queries.
Data is also made available for graphing or other use
(graph preview: queries | nagiosgrapher templates: full OR queries_only)

%package netint
Summary:        William Leibzon check_netint
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-netint = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-netint < %{version}-%{release}

%description netint
This is a plugin for nagios to check network interfaces (network ports)
on servers switches & routers. It is based on check_snmp_int.pl plugin
by Patrick Ploy with extensive rewrites for performance improvements
and additions to support Cisco and other switches (plugin can query and
cache cisco port names, port link data and switch STP status and more)
The plugin can use nagios-stored previous performance data to give port
traffic & utilization without creation of temporary files. This new 2.4
version supports checking interface on a local linux server without SNMP.

%package netsnmp_memory
Summary:        William Leibzon check_netsnmp_memory
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-netsnmp_memory = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-netsnmp_memory < %{version}-%{release}

%description netsnmp_memory
The check_netsnmp_memory plugin provides memory use information from SNMP
including amount and percent of used real, system, buffer cache and swap memory.
The plugin is an example of using generalized check_snmp_attributes.pl plugin
library which allows to specify set of SNMP data values to be retrieved
and variables as RPM expressions from these values which are the attributes
users see and check set thresholds on.

%package netsnmp_memory_15
Summary:        William Leibzon check_netsnmp_memory_15
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-netsnmp_memory_15 = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-netsnmp_memory_15 < %{version}-%{release}

%description netsnmp_memory_15
This plugin provides memory statistics data from NetSNMP and calculates percentage
of used data based on amount of system/user memory as opposed to also including
buffer/cache by default as other plugins do (which is a problem for heavily used
servers where disk cache would end up using all unused memory). There is also
very pretty and useful graph template available for nagiosgrapher for this plugin.

This plugin also serves as an example of using check_snmp_attributes in a way
where custom expression is written in an array defined in another plugin which
then directly calls check_snmp_attributes.

%package netstat
Summary:        William Leibzon check_netstat
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-netstat = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-netstat < %{version}-%{release}

%description netstat
This plugin checks (directly on server or through snmp) number of open
TCP or UDP connections on a list of ports and can send an alert if there
are too many or too few. Data is also returned as performance values and
can be used to graph TCP connections to/from the server.

%package profile_nagios_executiontime
Summary:        William Leibzon profile_nagios_executiontime
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-profile_nagios_executiontime = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-profile_nagios_executiontime < %{version}-%{release}

%description profile_nagios_executiontime
This is a nagios profiler to find which checks take longer
time to execute. Run it directly from unix shell, not as
a plugin. There are no parameters, but you may want to
change the file with path to your nagios status file
if its different than /var/log/nagios/status.dat

%package redis
Summary:        William Leibzon check_redis
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-redis = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-redis < %{version}-%{release}

%description redis
This is Redis Check plugin. It gets statistics variables
and allows to set thresholds on their value or their rate of change.
It can measure response time, caclulate hitrate, memory utilization,
replication delay (for slave) and other data. It can also check data
of keys against specified thresholds. Plugin returns performance data
for graphing and other processing for anything checked.

%package snmp_attributes
Summary:        William Leibzon check_snmp_attributes
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_attributes = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_attributes < %{version}-%{release}

%description snmp_attributes
The check_netsnmp_memory plugin provides memory use information from SNMP
including amount and percent of used real, system, buffer cache and swap memory.
The plugin is an example of using generalized check_snmp_attributes.pl
plugin library which allows to specify set of SNMP data values to be
retrieved and variables as RPM expressions from these values which
are the attributes users see and check set thresholds on.

%package snmp_baytech_pdu
Summary:        William Leibzon check_snmp_baytech_pdu
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_baytech_pdu = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_baytech_pdu < %{version}-%{release}

%description snmp_baytech_pdu 
This plugin checks Baytech PDU retrieving various parameters
(such as voltage, current, temperature, etc) for specific ports.

%package snmp_dell_powersupply
Summary:        William Leibzon check_snmp_dell_powersupply
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_dell_powersupply = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_dell_powersupply < %{version}-%{release}

%description snmp_dell_powersupply
Plugin that checks that both of the redundant power supplies
in a Dell server are functioning.

%package snmp_netint
Summary:        William Leibzon check_snmp_netint
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_netint = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_netint < %{version}-%{release}

%description snmp_netint
This plugin checks port status, STP, traffic and errors data
of network interfaces. Based on check_snmp_int it is optimized
for faster execution and better support of cisco switches.
It does not require temporary files for bandwidth and utilization data.

%package snmp_raid
Summary:        William Leibzon check_snmp_raid
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_raid = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_raid < %{version}-%{release}

%description snmp_raid
This is a Nagios plugin that uses SNMP to monitor several types of RAID cards.
It can check status of physical drives and logical volumes, and check for disk errors.

This was originally written to monitor LSI MegaRAID series of cards, sold by LSI and
more commonly found in Dell systems under their brand name 'PERC' (PERC3-PERC6).
Older ones are SCSI RAID cards and newer are SAS RAID cards. New cards sold directly
are now called MTPFusion and supported by plugin too. The plugin code is general
enough that it was possible to add support for Adaptec and HP SmartArray cards.
This was added to 2.x version of this plugin when it was also renamed check_snmp_raid
Support for more controllers maybe added if you look at the MIBS are willing to
contribute settings for them.

This plugin requires that Net::SNMP be installed on the machine performing the
monitoring and that snmp agent be set up on the machine to be monitored.

%package snmp_table
Summary:        William Leibzon check_snmp_table
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_table = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_table < %{version}-%{release}

%description snmp_table
This is a general plugin for checking named values where names
are in one SNMP table and values are in another SNMP table.
You specify these names as attributes and specify threshold
for each attribute.

This plugin can also serve as a base for writing specific plugin for type of check you're doing.

%package snmp_temperature
Summary:        William Leibzon check_snmp_temperature
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-snmp_temperature = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-snmp_temperature < %{version}-%{release}

%description snmp_temperature
General temperature check plugin that directly supports dell, hp, cisco, juniper, alteon
with other types easily specified if you know temperature SNMP OIDs.
Data also returned as performance values for graphing or other processing.

%package tftp
Summary:        William Leibzon check_tftp
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-tftp = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-tftp < %{version}-%{release}

%description tftp
This plugin tries to retrieve a specified file from tftp to verify its working.

%package uptime
Summary:        William Leibzon check_uptime
Group:          System/Monitoring
Requires:       perl
Requires:       %{name}-common
Provides:       nagios-plugins-wl-uptime = %{version}-%{release}
Obsoletes:      nagios-plugins-wl-uptime < %{version}-%{release}

%description uptime
This plugin can run locally or use SNMP and will attempt to auto-determine
type of remote system supporting windows and several types or unix systems.
It reports how long system has been up ('uptime') as well as system name and kernel.
It can also issue WARNING and CRITICAL alerts for systems recently rebooted.

%prep
%setup -q -n WL-NagiosPlugins-master

%build
true

%install
%{__rm} -rf %{buildroot}
%{__mkdir} -p %{buildroot}/%{nagios_plugindir}
%{__cp} *.pl %{buildroot}/%{nagios_plugindir}/
%{__cp} *.pm %{buildroot}/%{nagios_plugindir}/

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README

%files all
%defattr(-,root,root)
%doc README

%files common
%defattr(0755,root,root)
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%attr(0644,root,root) %{nagios_plugindir}/Naglio.pm

%files by_snmp
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_by_snmp.pl

%files daytime
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_daytime.pl

%files dnsname
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_dnsname.pl

%files files
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_files.pl

%files jboss
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_jboss.pl

%files linux_procstat
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_linux_procstat.pl

%files localtime
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_localtime.pl

%files memcached
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_memcached.pl

%files mysqld
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_mysqld.pl

%files netint
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_netint.pl

%files netsnmp_memory
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_netsnmp_memory.pl

%files netsnmp_memory_15
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_netsnmp_memory_15.pl

%files netstat
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_netstat.pl

%files profile_nagios_executiontime
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/profile_nagios_executiontime.pl

%files redis
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_redis.pl

%files snmp_attributes
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_attributes.pl

%files snmp_baytech_pdu
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_baytech_pdu.pl

%files snmp_netint
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_netint.pl

%files snmp_dell_powersupply
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_dell_powersupply.pl

%files snmp_raid
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_raid.pl

%files snmp_table
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_table.pl

%files snmp_temperature
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_snmp_temperature.pl

%files tftp
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_tftp.pl

%files uptime
%defattr(0755,root,root)
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_uptime.pl

%changelog