File monitoring-plugins.spec of Package monitoring-plugins

#
# spec file for package monitoring-plugins-smb
#
# Copyright (c) 2017 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
Version:        0
Release:        0
License:        GPL-2.0+ and GPL-3.0
Summary:        Monitoring plugins that are not part of the Leap distribution
Group:          System/Monitoring
Source:         monitoring-plugins-collection.tar.gz
BuildRequires:  nagios-rpm-macros
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description 
Leap already comes with a bunch of monitoring plugins.
However, some where missing for me.
This is my collection of monitoring plugins that are not part of Leap.


%package smb
Summary:        Check with anonymous accout if a samba server reacts
Requires:       samba-client
Requires:       monitoring-plugins-common

%description smb
Uses smbclient to connect anonymously to a samba server.



%package vdr-signalstrength
Summary:        Checks signal strength on a TV card
Requires:       vdr
Requires:       vdr-plugin-femon

%description vdr-signalstrength
Usese svdrpsend to connect to a VDR using the femon plugin.



%package snmp-printer-supply
Summary:       Checks if printer supply is empty
Requires:      net-snmp

%description snmp-printer-supply
Uses snmpwalk to connect to a printer and check it's supplies.



%package tftp
Summary:       Checks if a file is served via a tftpd
Requires:      tftp

%description tftp
Uses tftp to connect to a tftpd and checks if a file with a known name can be downloaded.



%package postfix-queue
Summary:      Checks the queue length of postfix
Requires:     postfix

%description postfix-queue
Uses mailq to check the length of the queue of postfix.



%package tor-by-ip
Summary:      Checks if IP address is masquaraded
Requires:     wget

%description tor-by-ip
Uses wget to obtain the external IP address by query dyndns.com servers. No dyndns accout is required.



%package nfs-health
Summary:      Checks health of a nfs server
Requires:     awk
Requires:     bc

%description nfs-health
Checks status and health of a nfs server.



%package vdr-diskusage
Summary:      Checks disk usage of VDR
Requires:     vdr
Requires:     awk

%description vdr-diskusage
Uses svdrpsend to check disk utilization of VDR.



%package proxy
Summary:      Checks if a proxy does not modify a file
Requires:     wget
Requires:     bc
Requires:     awk

%description proxy
Uses wget to obtain a file directly and through a proxy. Then it compares if the files are identical.
Caution: lot's of websites include the time in their source code. These will be always different.



%package mem
Summary:     Checks memory usage
Requires:    procps
Requires:    awk

%description  mem
Uses command free to get free (buffered or unused) memory.



%package fileage
Summary:     Checks age of a file
Requires:    python3

%description fileage
Checks if a file is younger than a certain age. Useful for checking arbitrary daemons that write to files periodically.



%package ftp
Summary:     Checks if login on a ftp server is possible

%description ftp
Checks if an ftp server is up and running by logging in.



%package cups-queue
Summary:     Checks length of a cups printer queue
Requires:    cups-client

%description cups-queue
Checks the length of a printer queue in cupsd.



%package cups-printer
Summary:     Checks availability of a printer
Requires:    cups-client

%description cups-printer
Checks if cups provides a certain printer.



%package sensors
Summary:     Check reading of hardware sensors
Requires:    sensors
Requires:    awk
Requires:    bc
Requires:    grep

%description sensors
Uses sensors package to read hardware information like fan RPMs or 
temperatures.



%package file-exists
Summary:     Check if file exit

%description file-exists
Uses test command to check if a file exists. Can also be used for device files 
/dev/*.



%package tor
Summary:      Checks if tor is in your proxy chain
Requires:     curl

%description tor
This script reads index.html from check.torproject.org, which contains 
information wether or not tor is in your proxy-chain.



%package ipmi-power
Summary:      Checks via ipmi if a system is powered
Requires:     freeipmi
Requires:     ipmitool
License:      GPL-2.0+

%description ipmi-power
Uses ipmitool from freeipmi to check is a system is powered. Useful as master 
for service dependencies.



%package -n cron-check-nagios
Summary:      Check via cron if nagios is running
Requires:     monitoring-plugins-nagios
Requires:     mailx
Requires:     cron

%description -n cron-check-nagios
Provides a script that can be executed via cron to see if nagios is still up 
and running. If nagios is down or last log entry longer than a minute ago, a 
mail is sent to root.

%package dd-wrt-inet-access
Summary:      Check if a router running dd-wrt has internet connction
Url:          https://github.com/Aikhjarto/check_dd-wrt

%description dd-wrt-inet-access
Logs in via ssh on a router running dd-wrt and tries to access a certain
website with w3m to check if internet access is given.

%package dd-wrt-ps
Summary:      Check running processes on a dd-wrt router
Url:          https://github.com/Aikhjarto/check_dd-wrt

%description dd-wrt-ps
Logs in via ssh on a router running dd-wrt and checks with a list of 
given processes if all of them are running.

%package linux-raid
Summary:     Check consistecy of Linux software RAIDs
Obsoletes:   nagios-plugins-linux_raid

%description linux-raid
This plugin checks the status of a local Linux software RAID via the
/proc/mdstat interface.


%package systemd-service
Summary:     Checks if a systemd service or mount is running
Url:	     https://github.com/melmorabity/nagios-plugin-systemd-service

%description systemd-service
For a *.service it checks if it is prestent, enabled and alive.
Extension for openSUSE: also check is a mountpoint is active.

%package file-age2
Summary:     Check file age and size of a lock file

%description file-age2
Check file age and size but has a mode to not report error on
missing files. Thus file-age2 is suitable for lock files.

%package ts3
Summary:	Checks if a Teamspeak 3 server responses
Requires:	expect

%description ts3
Connects to the dataport of a teamspeak server and checks
for its characterstic respone.


%package remote-load
Summary:	Check /proc/loadavg via ssh
Requires:	bc

%description remote-load
Connects via ssh to a remote maschine, reads /proc/loadavg,
and checks 1 m, 5 m and 15 m averages.


%package systemd
Summary: 	Checks for failed systemd services and long boot time
Requires:       systems

%description systemd
Connects via systemctl to a remote machine and reads units and boot time.


%package apcaccess
Summary:	Checks UPS from APC via apcaccess
Requires:	apcupsd
Requires:	python3

%description apcaccess
Receives data from a running apcupsd via the tool apcups


%package jitsi
Summary: Checks health of jitis service
Requires: python3-requests
License:  GPL-2.0+

%description jitsi
Uses jitsi's JVB API to optain statistics from jitsi services and reports 
health as status and several other metrics.


%package influxdb-data-age
Summary: Checks most recent timestamp from an InfluxDB
Requires: python3-request
Requires: python3-pytz
Requires: python3-pyrfc3339
License:  GPL-2.0+

%description influxdb-data-age
Uses the HTTP API of InfluxDB to perform a query. Then checks the age of the data
based  on returned column '_time'.


%package openvpn
Summary: Check if an OpenVPN server runs
Requires: python3-base

%description openvpn
Check if an OpenVPN server runs on a given UDP or TCP port.


%prep
%setup -qn monitoring-plugins-collection

%build
# make goes here but unneeded

%install
%{__install} -D -d %{buildroot}%{nagios_plugindir}
%{__install} -m 0755 check_* %{buildroot}%{nagios_plugindir}

%{__install} -D -m 0755 cron_check_nagios %{buildroot}%{_bindir}/cron_check_nagios
%{__install} -D -d %{buildroot}%{_sysconfdir}/cron.hourly
ln -s %{_bindir}/cron_check_nagios %{buildroot}%{_sysconfdir}/cron.hourly/cron_check_nagios

%files
%dir /usr/lib/nagios

%files smb
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_smb

%files vdr-signalstrength
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_vdr_signalstrength

%files snmp-printer-supply
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_snmp_printer_tray
%attr(0755,root,root) %{nagios_plugindir}/check_snmp_printer_supply

%files tftp
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_tftp

%files postfix-queue
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_postfix_queue

%files tor-by-ip
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_tor_by_ip

%files nfs-health
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_nfs_health

%files vdr-diskusage
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_vdr_diskusage

%files proxy
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_proxy

%files mem
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_mem

%files fileage
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_fileage.py

%files ftp
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_ftp.pl

%files cups-queue
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_cups_queue

%files cups-printer
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_cups_printer

%files sensors
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_sensors

%files file-exists
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_file_exists

%files tor
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_tor

%files ipmi-power
%defattr(-,root,root)
%dir %{nagios_plugindir}
%attr(0755,root,root) %{nagios_plugindir}/check_ipmi_power

%files -n cron-check-nagios
%defattr(-,root,root)
%dir %{_sysconfdir}/cron.hourly/
%attr(0755,root,root) %{_bindir}/cron_check_nagios
%attr(0644,root,root) %{_sysconfdir}/cron.hourly/cron_check_nagios

%files dd-wrt-inet-access
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_dd-wrt_inet_access

%files dd-wrt-ps
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_dd-wrt_ps

%files linux-raid
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_linux_raid

%files systemd-service
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_systemd_service.sh

%files file-age2
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_file_age2.pl

%files ts3
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_ts3

%files remote-load
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_remote_load

%files systemd
%defattr(-,root,root)
%attr(0755,root,root) %{nagios_plugindir}/check_systemd.sh

%files apcaccess
%defattr(-,root,root)
%attr(0775,root,root) %{nagios_plugindir}/check_apcaccess.py

%files jitsi
%defattr(-,root,root)
%attr(0775,root,root) %{nagios_plugindir}/check_jitsi.py

%files influxdb-data-age
%defattr(-,root,root)
%attr(0775,root,root) %{nagios_plugindir}/check_influxdb_data_age.py

%files openvpn
%defattr(-,root,root)
%attr(0775,root,root) %{nagios_plugindir}/check_openvpn


%changelog
openSUSE Build Service is sponsored by