# # spec file for package monitoring-plugins # # 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 Summary: The Monitoring Plug-Ins License: GPL-2.0+ and GPL-3.0 Group: System/Monitoring Version: 1.5 Release: 0 Url: http://monitoring-plugins.org/ PreReq: permissions PreReq: update-alternatives Source0: nagios-plugins-%{version}.tar.bz2 %ifarch x86_64 Source10: monitoring-plugins.check_xenvm.sh %endif Source11: monitoring-plugins-permissions Source12: monitoring-plugins-README.SUSE Source13: monitoring-plugins-README.SUSE-check_dhcp Source14: monitoring-plugins-README.SUSE-check_icmp Source15: monitoring-plugins-README.SUSE-check_ide_smart Source16: usr.lib.monitoring.plugins.check_dhcp Source17: usr.lib.monitoring.plugins.check_ntp_time Source18: monitoring-plugins.check_cups.sh Source19: usr.lib.monitoring.plugins.check_cups Source20: monitoring-plugins-README.SUSE-check_cups Source22: usr.lib.monitoring.plugins.check_ping Source23: usr.lib.monitoring.plugins.check_icmp Source24: usr.lib.monitoring.plugins.check_ide_smart Source25: usr.lib.monitoring.plugins.check_ssh Patch1: monitoring-plugins-1.4.14-ntpd.patch Patch2: monitoring-plugins-1.4.14-check_log.patch Patch6: monitoring-plugins-1.4.6-no_chown.patch Patch11: monitoring-plugins.check_snmp.arrayaddress.patch Patch12: monitoring-plugins-postgresql.patch Patch13: monitoring-plugins.negate.validate_arguments.patch Patch15: monitoring-plugins-too_few_arguments_for_check_disk.patch Patch116: monitoring-plugins-wrong_return_in_check_swap.patch Patch117: %{name}.check_snmp.snmpv3-context.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bind-utils BuildRequires: dhcp-devel BuildRequires: fping BuildRequires: update-alternatives %if 0%{?suse_version} > 1210 BuildRequires: libgnutls-devel %else BuildRequires: gnutls-devel %endif BuildRequires: iputils BuildRequires: libsmbclient-devel BuildRequires: mysql-devel BuildRequires: nagios-devel BuildRequires: nagios-rpm-macros BuildRequires: net-snmp-devel BuildRequires: openldap2-devel BuildRequires: openssh BuildRequires: openssl-devel BuildRequires: perl-Net-SNMP BuildRequires: postfix BuildRequires: postgresql-devel BuildRequires: procps BuildRequires: python-devel BuildRequires: samba-client %if 0%{?suse_version} %if 0%{?suse_version} > 1020 BuildRequires: freeradius-client-devel %else BuildRequires: radiusclient %endif %if 0%{?suse_version} > 910 BuildRequires: krb5-devel BuildRequires: syslog-ng %else BuildRequires: heimdal-devel %endif %else BuildRequires: krb5-devel %endif Provides: nagios-plugins = %{version} Obsoletes: nagios-plugins < 1.5 Conflicts: nagios-plugins > 1.5 # recommend the old, included checks to allow an easy update - but # also allow users to deselect some of the new sub-packages Recommends: %{name}-bgpstate Recommends: %{name}-breeze Recommends: %{name}-by_ssh Recommends: %{name}-cluster Recommends: %{name}-dhcp Recommends: %{name}-dig Recommends: %{name}-disk Recommends: %{name}-disk_smb Recommends: %{name}-dns Recommends: %{name}-dummy Recommends: %{name}-file_age Recommends: %{name}-flexlm Recommends: %{name}-http Recommends: %{name}-icmp Recommends: %{name}-ide_smart Recommends: %{name}-ifoperstatus Recommends: %{name}-ifstatus Recommends: %{name}-ircd Recommends: %{name}-linux_raid Recommends: %{name}-load Recommends: %{name}-log Recommends: %{name}-mailq Recommends: %{name}-mrtg Recommends: %{name}-mrtgtraf Suggests: %{name}-nagios Recommends: %{name}-nt Recommends: %{name}-ntp_peer Recommends: %{name}-ntp_time Recommends: %{name}-nwstat Recommends: %{name}-oracle Recommends: %{name}-overcr Recommends: %{name}-ping Recommends: %{name}-procs Recommends: %{name}-real Recommends: %{name}-rpc %ifnarch ppc ppc64 sparc sparc64 s390 s390x Recommends: %{name}-sensors %endif Recommends: %{name}-smtp Recommends: %{name}-ssh Recommends: %{name}-swap Recommends: %{name}-tcp Recommends: %{name}-time Recommends: %{name}-ups Recommends: %{name}-users Recommends: %{name}-wave %ifarch x86_64 Suggests: %{name}-xenvm %endif Suggests: %{name}-cups %define apt_get_command %{_bindir}/apt-get %define qstat_command %{_bindir}/qstat %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 those plugins. %package extras Summary: Plug-Ins which depend on additional packages Group: System/Monitoring Provides: nagios-plugins-extras = 1.5 Obsoletes: nagios-plugins-extras < 1.5 Conflicts: nagios-plugins-extras > 1.5 Suggests: %{name}-apt Recommends: %{name}-fping Suggests: %{name}-game Requires: %{name}-common = %{version} Recommends: %{name}-hpjd Recommends: %{name}-ldap Recommends: %{name}-mysql Recommends: %{name}-pgsql Recommends: %{name}-snmp %description extras These are additional monitoring plug-ins for Nagios or Icinga. They depend on other packages which have to be installed. %package all Summary: All Nagios-Plugin checks Group: System/Monitoring Provides: nagios-plugins-all = 1.5 Obsoletes: nagios-plugins-all < 1.5 Conflicts: nagios-plugins-all > 1.5 Recommends: %{name}-apt Recommends: %{name}-bgpstate Recommends: %{name}-bind Recommends: %{name}-bonding Recommends: %{name}-breeze Recommends: %{name}-by_ssh Recommends: %{name}-clamav Recommends: %{name}-cluster Recommends: %{name}-contentage Recommends: %{name}-cups Recommends: %{name}-dhcp Recommends: %{name}-dig Recommends: %{name}-disk Recommends: %{name}-diskio Recommends: %{name}-disk_smb Recommends: %{name}-dns Recommends: %{name}-dummy Recommends: %{name}-file_age Recommends: %{name}-flexlm Recommends: %{name}-fping Recommends: %{name}-game Recommends: %{name}-hpasm Recommends: %{name}-hpjd Recommends: %{name}-http Recommends: %{name}-icmp Recommends: %{name}-ide_smart Recommends: %{name}-ifoperstatus Recommends: %{name}-ifstatus Recommends: %{name}-ipmi-sensor1 Recommends: %{name}-ircd Recommends: %{name}-ldap Recommends: %{name}-linux_raid Recommends: %{name}-load Recommends: %{name}-log Recommends: %{name}-maintenance Recommends: %{name}-mem Recommends: %{name}-mailq Recommends: %{name}-mrtg Recommends: %{name}-mrtgtraf Recommends: %{name}-mysql Recommends: %{name}-mysql_health Recommends: %{name}-nagios Recommends: %{name}-nfsmounts Recommends: %{name}-nis Recommends: %{name}-nt Recommends: %{name}-ntp_peer Recommends: %{name}-ntp_time Recommends: %{name}-nwstat Recommends: %{name}-oracle Recommends: %{name}-overcr Recommends: %{name}-pgsql Recommends: %{name}-ping Recommends: %{name}-procs Recommends: %{name}-qlogic_sanbox Recommends: %{name}-radius Recommends: %{name}-real Recommends: %{name}-rpc Recommends: %{name}-rsync %ifnarch ppc ppc64 sparc sparc64 s390 s390x Recommends: %{name}-sensors %endif Recommends: %{name}-smtp Recommends: %{name}-snmp Recommends: %{name}-ssh Recommends: %{name}-swap Recommends: %{name}-tcp Recommends: %{name}-time Recommends: %{name}-ups Recommends: %{name}-ups_alarm Recommends: %{name}-users Recommends: %{name}-wave Recommends: %{name}-xenvm Recommends: %{name}-zypper %description all This virtual package recommends all currently available, official Nagios plugins. %package apt Summary: Check for software updates via apt-get Group: System/Monitoring Requires: %{apt_get_command} Provides: nagios-plugins-apt = 1.5 Obsoletes: nagios-plugins-apt < 1.5 Conflicts: nagios-plugins-apt > 1.5 %description apt This plugin checks for software updates on systems that use package management systems based on the apt-get command found in Debian GNU/Linux %package bgpstate Summary: Monitor BGP sessions Group: System/Monitoring Requires: whois %description bgpstate Perl bgpstate plugin monitors all BGP sessions. %package breeze Summary: Monitor Breezecom wireless equipment Group: System/Monitoring Requires: %{name}-common = %{version} Requires: net-snmp Requires: perl %description breeze This plugin reports the signal strength of a Breezecom wireless equipment. %package by_ssh Summary: Execute checks via SSH Group: System/Monitoring Requires: openssh %description by_ssh This plugin uses SSH to execute commands on a remote host. The most common mode of use is to refer to a local identity file with the '-i' option. In this mode, the identity pair should have a null passphrase and the public key should be listed in the authorized_keys file of the remote host. Usually the key will be restricted to running only one command on the remote server. If the remote SSH server tracks invocation arguments, the one remote program may be an agent that can execute additional commands as proxy. %package cluster Summary: Host/Service Cluster Plugin Group: System/Monitoring %description cluster Provides the check_cluster plugin to check Services and/or Hosts running as a cluster. Example: check_cluster -s -d 2,0,2,0 -c @3: Will alert critical if there are 3 or more service data points in a non-OK state. %package common Summary: Libraries for Nagios plugins Group: System/Monitoring Provides: monitoring-plugins-libs = %{version}-%{release} Obsoletes: monitoring-plugins-libs < %{version} %description common This package includes the libraries (scripts) that are included by many of the standard checks. %package dhcp Summary: Check DHCP servers Group: System/Monitoring %if 0%{?suse_version} Recommends: apparmor-parser %else Requires: apparmor-parser %endif %description dhcp This plugin tests the availability of DHCP servers on a network. Please read /usr/share/doc/packages/monitoring-plugins-dhcp/README.SUSE-check_dhcp for details how to setup this check. %package dig Summary: Test DNS service via dig Group: System/Monitoring Requires: %{_bindir}/dig %description dig This plugin test the DNS service on the specified host using dig. %package disk Summary: Check disk space Group: System/Monitoring %description disk This plugin checks the amount of used disk space on a mounted file system and generates an alert if free space is less than one of the threshold values. %package disk_smb Summary: Check SMB Disk Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl %description disk_smb Check the amount of used disk space on a remote Samba or Windows share and generate an alert if free space is less than one of the threshold values. %package dns Summary: Obtain the IP address for a given host/domain Group: System/Monitoring Requires: %{_bindir}/nslookup %description dns This plugin uses the nslookup program to obtain the IP address for the given host/domain query. An optional DNS server to use may be specified. If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used. %package dummy Summary: Dummy check Group: System/Monitoring %description dummy This plugin will simply return the state corresponding to the numeric value of the argument with optional text. %package file_age Summary: Check the age/size of files Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl %description file_age This plugin will check either the age of files or their size. %package flexlm Summary: Check flexlm license managers Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl %description flexlm Flexlm license managers usually run as a single server or three servers and a quorum is needed. The plugin return OK if 1 (single) or 3 (triple) servers are running, CRITICAL if 1(single) or 3 (triple) servers are down, and WARNING if 1 or 2 of 3 servers are running. %package fping Summary: Fast ping check Group: System/Monitoring Requires: fping %description fping This plugin will use the fping command to ping the specified host for a fast check. Note that it is necessary to set the suid flag on fping. %package game Summary: Gameserver check Group: System/Monitoring Requires: %{qstat_command} %description game Check connections to game servers. This plugin uses the 'qstat' command, the popular game server status query tool. %package hpjd Summary: Check status of an HP printer Group: System/Monitoring Requires: net-snmp %description hpjd This plugin tests the STATUS of an HP printer with a JetDirect card. %package http Summary: Test the HTTP service on the specified host Group: System/Monitoring %description http This plugin tests the HTTP service on the specified host. It can test normal (http) and secure (https) servers, follow redirects, search for strings and regular expressions, check connection times, and report on certificate expiration times. %package icmp Summary: Send ICMP packets to the specified host Group: System/Monitoring %description icmp This plugin sends ICMP (ping) packets to the specified host. You can specify different RTA factors and acceptable packet loss. Please read /usr/share/doc/packages/monitoring-plugins-icmp/README.SUSE-check_icmp for details how to setup this check. %package ide_smart Summary: Check local hard drive Group: System/Monitoring %description ide_smart This plugin checks a local hard drive with the (Linux specific) SMART interface. Please read /usr/share/doc/packages/monitoring-plugins-ide_smart/README.SUSE-check_ide_smart for details how to setup this check. %package ifoperstatus Summary: Monitor network interfaces Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl-Net-SNMP %description ifoperstatus This plugin monitors operational status of a particular network interface on the target host. %package ifstatus Summary: Monitor operational status network interfaces Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl-Net-SNMP %description ifstatus This plugin monitors operational status of each network interface on the target host. %package ircd Summary: Check an IRCd server Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl %description ircd Monitor the status of an Internet Relay Chat daemon (IRCd) with this check. %package ldap Summary: Test a LDAP server Group: System/Monitoring %description ldap Monitor access to a Lightweight Directory Access Protocol (LDAP) server. This package includes the 'check_ldap' and 'check_ldaps' plugins. %package load Summary: Test the current system load average Group: System/Monitoring %description load This plugin tests the current system load average. %package log Summary: Log file pattern detector Group: System/Monitoring Requires: %{name}-common = %{version} %description log This plugin provides a log file pattern detector - excluding old logfile entries and searching for the given query. %package mailq Summary: Check mail queues Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl %if 0%{?suse_version} Requires: smtp_daemon %endif %description mailq This plugin checks the number of messages in the mail queue (supports multiple sendmail queues, qmail). %package mrtg Summary: Check average or maximum value in an MRTG logfile Group: System/Monitoring Recommends: mrtg %description mrtg This plugin will check either the average or maximum value of one of the two variables recorded in an MRTG log file. %package mrtgtraf Summary: Check incoming/outgoing transfer rates of a router Group: System/Monitoring Recommends: mrtg %description mrtgtraf This plugin will check the incoming/outgoing transfer rates of a router, switch, etc recorded in an MRTG log. If the newest log entry is older than , a WARNING status is returned. If either the incoming or outgoing rates exceed the or thresholds (in Bytes/sec), a CRITICAL status results. If either of the rates exceed the or thresholds (in Bytes/sec), a WARNING status results. %package mysql Summary: Test a MySQL DBMS Group: System/Monitoring %description mysql This plugin tests a MySQL DBMS to determine whether it is active and accepting queries. It provides the two checks: 'check_mysql' and 'check_mysql_query'. %package nagios Summary: Check nagios server Group: System/Monitoring Requires: monitoring_daemon %description nagios This plugin checks the status of the Nagios process on the local machine. The plugin will check to make sure the Nagios status log is no older than the number of minutes specified by the expires option. It also checks the process table for a process matching the command argument. %package nt Summary: Collect data from NSClient service Group: System/Monitoring %description nt This plugin collects data from the NSClient service running on a Windows NT/2000/XP/2003 server. %package ntp_peer Summary: Check health of an NTP server Group: System/Monitoring %description ntp_peer Use this plugin to check the health of an NTP server. It supports checking the offset with the sync peer, the jitter and stratum. This plugin will not check the clock offset between the local host and NTP server; please use check_ntp_time for that purpose. %package ntp_time Summary: Check clock offset with the ntp server Group: System/Monitoring Provides: %{name}-ntp = %{version}-%{release} %if 0%{?suse_version} Recommends: apparmor-parser %else Requires: apparmor-parser %endif %description ntp_time This plugin checks the clock offset between the local host and a remote NTP server. It is independent of any commandline programs or external libraries. %package nwstat Summary: Check MRTGEXT NLM running Group: System/Monitoring %description nwstat This plugin attempts to contact the MRTGEXT NLM running on a Novell server to gather the requested system information. %package oracle Summary: Check Oracle status Group: System/Monitoring Requires: %{name}-common = %{version} %description oracle Check Oracle database health status. %package overcr Summary: Check Over-CR collector daemon Group: System/Monitoring %description overcr This plugin attempts to contact the Over-CR collector daemon running on the remote UNIX server in order to gather the requested system information. %package pgsql Summary: Test a PostgreSQL DBMS Group: System/Monitoring %description pgsql This plugin tests a PostgreSQL DBMS to determine whether it is active and accepting queries. It provides the check 'check_pgsql'. %package ping Summary: Check connection statistics Group: System/Monitoring Requires: iputils %description ping Use ping to check connection statistics for a remote host. This plugin uses the ping command to probe the specified host for packet loss (percentage) and round trip average (milliseconds). %package procs Summary: Check processes Group: System/Monitoring %description procs This plugin checks the number of currently running processes and generates WARNING or CRITICAL states if the process count is outside the specified threshold ranges. The process count can be filtered by process owner, parent process PID, current state (e.g., 'Z'), or may be the total number of running processes. %package procs_perf Summary: Extended version of check_procs plugin for Nagios Group: System/Monitoring Url: http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_procs_perf/details %description procs_perf Extended version of check_procs plugin with metric dependant performance data, extended status information and total warning/critical thresholds Total warning and total critical thresholds ranges (options -x, -y) applied to summary metric across all processes that matched filter - Extended status information for failed processes: pid, metric and value (not applicable for PROC metric) - Added Glabal status (max of total and per-process) as well as total status and usual per-process status - Performance data dependant on metric requested: PROC, VSZ, RSS, CPU -v is required to output performance data %if 0%{?suse_version} < 01110 %package radius Summary: Test RADIUS server Group: System/Monitoring %if 0%{?suse_version} > 1020 Requires: freeradius-client %else Requires: radiusclient %endif %description radius This plugin tests a RADIUS server to see if it is accepting connections. The server to test must be specified in the invocation, as well as a user name and password. A configuration file may also be present. The format of the configuration file is described in the radiusclient library sources. The password option presents a substantial security issue because the password can possibly be determined by careful watching of the command line in a process listing. This risk is exacerbated because nagios will run the plugin at regular predictable intervals. Please be sure that the password used does not allow access to sensitive system resources. %endif %package real Summary: Test REAL service Group: System/Monitoring %description real This plugin will attempt to open an RTSP connection with the host. Successul connects return STATE_OK, refusals and timeouts return STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects, but incorrect reponse messages from the host result in STATE_WARNING return values. %package rpc Summary: Check RPC service Group: System/Monitoring Requires: %{name}-common = %{version} Requires: perl Requires: rpcbind %description rpc Check if a rpc service is registered and running using rpcinfo. %ifnarch ppc ppc64 sparc sparc64 s390 s390x %package sensors Summary: Check hardware status using lm_sensors Group: System/Monitoring Requires: %{name}-common = %{version} Requires: grep Requires: sensors %description sensors This plugin checks hardware status using the lm_sensors package. %endif %package smtp Summary: Check SMTP connections Group: System/Monitoring %description smtp This plugin will attempt to open an SMTP connection with the given host. %package snmp Summary: SNMP monitoring Group: System/Monitoring Requires: net-snmp %description snmp The Simple Network Management Protocol (SNMP) can be used to monitor network-attached devices for conditions that warrant administrative attention. This package includes the 'check_snmp' plugin for Nagios or Icinga. %package ssh Summary: Check SSH service Group: System/Monitoring %description ssh Try to connect to an SSH server at specified server and port. %package swap Summary: Check swap space Group: System/Monitoring %description swap Check swap space on local machine. %package tcp Summary: Tests TCP and UDP connections Group: System/Monitoring Provides: %{name}-clamd = %{version}-%{release} Provides: %{name}-ftp = %{version}-%{release} Provides: %{name}-imap = %{version}-%{release} Provides: %{name}-jabber = %{version}-%{release} Provides: %{name}-nntp = %{version}-%{release} Provides: %{name}-nntps = %{version}-%{release} Provides: %{name}-pop = %{version}-%{release} Provides: %{name}-simap = %{version}-%{release} Provides: %{name}-spop = %{version}-%{release} Provides: %{name}-ssmtp = %{version}-%{release} Provides: %{name}-udp = %{version}-%{release} %description tcp This plugin tests TCP connections with the specified host (or unix socket). This package contains the following checks: * check_clamd * check_ftp * check_imap * check_jabber * check_nntp * check_nntps * check_pop * check_simap * check_spop * check_ssmtp * check_tcp * check_udp %package time Summary: Check the time on the specified host Group: System/Monitoring %description time This plugin will check the time on the specified host. %package ups Summary: Test UPS service on the specified host Group: System/Monitoring %description ups This plugin tests the UPS service on the specified host. Network UPS Tools from www.networkupstools.org must be running for this plugin to work. %package users Summary: Check number of users currently logged in Group: System/Monitoring %description users This plugin checks the number of users currently logged in on the local system and generates an error if the number exceeds the thresholds specified. %package wave Summary: Check wave signal strength Group: System/Monitoring Requires: %{name}-common = %{version} Requires: net-snmp Requires: perl %description wave Check the wave signal strength via SNMP. %ifarch x86_64 %package xenvm Summary: Check available XEN VMs Group: System/Monitoring Requires: xen-tools %description xenvm Checks the number of Xen VMs running on a machine and returns a warning or a critical message if the number exceeds the thresholds specified. %endif %package cups Summary: Check cups service Group: System/Monitoring Requires: cups-client %description cups Check the status of a remote CUPS server, all printers there or one selected. It can also check queue there: it will provide the size of the queue of age of queue. %prep %setup -q -n nagios-plugins-%{version} %{__mkdir_p} example/permissions.d %{__cp} %{S:11} example/permissions.d/%{name} %{__cp} %{S:12} ./README.SUSE %{__cp} %{S:13} ./README.SUSE-check_dhcp %{__cp} %{S:14} ./README.SUSE-check_icmp %{__cp} %{S:15} ./README.SUSE-check_ide_smart %{__cp} %{S:20} ./README.SUSE-check_cups %patch1 -p0 %patch2 -p0 %patch6 %patch11 %patch12 %patch13 %patch15 -p0 # Debian patches %patch116 -p1 %patch117 -p1 find -type f -exec %{__chmod} 644 {} \; %build export CFLAGS="%optflags -fno-strict-aliasing -DLDAP_DEPRECATED" chmod +x configure # needed as configure script is not executable in 1.5.. %configure \ --enable-static=no \ --enable-extra-opts \ --libexecdir=%{nagios_plugindir} \ --sysconfdir=%{nagios_sysconfdir} \ --with-apt-get-command=%{apt_get_command} \ --with-cgiurl=/nagios/cgi-bin \ --with-fping-command=%{_sbindir}/fping \ --with-ipv6 \ --with-ntpq-command=%{_sbindir}/ntpq \ --with-ntpdc-command=%{_sbindir}/ntpdc \ --with-ntpdate-command=%{_sbindir}/ntpdate \ --with-openssl=%{_prefix} \ --with-perl=%{_bindir}/perl \ --with-pgsql=%{_prefix} \ --with-ping6-command='/bin/ping6 -n -U -w %d -c %d %s' \ --with-proc-loadavg=/proc/loadavg \ --with-ps-command="/bin/ps axwo 'stat uid pid ppid vsz rss pcpu etime comm args'" \ --with-ps-format='%s %d %d %d %d %d %f %s %s %n' \ --with-ps-cols=10 \ --with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' \ --with-rpcinfo-command=%{_sbindir}/rpcinfo \ --with-qstat-command=%{qstat_command} \ --with-mysql=%{_prefix} \ --disable-rpath #--enable-perl-modules make all %{?jobs:-j%jobs} %install sed -i 's,^MKINSTALLDIRS.*,MKINSTALLDIRS = ../mkinstalldirs,' po/Makefile %makeinstall install-root %ifarch x86_64 %{__install} -m 0755 %{S:10} $RPM_BUILD_ROOT%{nagios_plugindir}/check_xenvm %endif %{__install} -m 0755 %{S:18} $RPM_BUILD_ROOT%{nagios_plugindir}/check_cups # provide check_host and check_rta_multi as on Debian if [ -x %{buildroot}/%{nagios-plugindir}/check_icmp ] ; then test -f %{buildroot}/%{nagios-plugindir}/check_host && rm -f %{buildroot}/%{nagios-plugindir}/check_host test -f %{buildroot}/%{nagios-plugindir}/check_rta_multi && rm -f %{buildroot}/%{nagios-plugindir}/check_rta_multi ln -s %{nagios-plugindir}/check_icmp %{buildroot}/%{nagios-plugindir}/check_host ; ln -s %{nagios-plugindir}/check_icmp %{buildroot}/%{nagios-plugindir}/check_rta_multi ; fi # fix "use lib" on installed perl checks pushd $RPM_BUILD_ROOT%{nagios_plugindir} for file in $(find -maxdepth 1 -type f); do sed -i 's|use lib "nagios/plugins".*;|use lib "%{nagios_plugindir}";|g; s|use lib "/usr/local/nagios/libexec".*;|use lib "%{nagios_plugindir}";|g' $file done popd # check_sensors makes no sense on some archs %ifarch ppc ppc64 sparc sparc64 s390 s390x %{__rm} -f %{buildroot}%{nagios_plugindir}/check_sensors %endif # install Apparmor profiles mkdir -p %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE16} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE17} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE19} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE22} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE23} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE24} %{buildroot}/%{_sysconfdir}/apparmor.d/ install -m 644 %{SOURCE25} %{buildroot}/%{_sysconfdir}/apparmor.d/ # inform the users about the deprecated monitoring-plugins-extras package cat >> README.SUSE-deprecated << EOF The monitoring-plugins-extras package is deprecated. The checks formerly packaged here are now packaged separately. For example, to install check_fping just install monitoring-plugins-fping. EOF cat >> README.SUSE-all << EOF This virtual package recommends all currently available, official Nagios plugins. It does not require the subpackages as you might not have all needed dependend packages available. EOF # find locale files ##%find_lang %{name} %find_lang nagios-plugins %clean %{__rm} -rf $RPM_BUILD_ROOT %post %{_sbindir}/update-alternatives --install "%{nagios_plugindir}" "%{name}" "%{nagios_plugindir}/../%{name}" 10 %preun if [ "$1" = 0 ] ; then %{_sbindir}/update-alternatives --remove "%{name}" "%{nagios_plugindir}/../%{name}" fi %post dhcp # in case somebody uses the permissions file we provide # in docdir, run permission here if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then %if 0%{?suse_version} < 1210 %run_permissions %else %set_permissions monitoring-plugins %endif fi %post icmp if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then # in case somebody uses the permissions file we provide # in docdir, run permission here %if 0%{?suse_version} < 1210 %run_permissions %else %set_permissions monitoring-plugins %endif fi %post ide_smart if [ -f %{_sysconfdir}/permissions.d/monitoring-plugins ]; then # in case somebody uses the permissions file we provide # in docdir, run permission here %if 0%{?suse_version} < 1210 %run_permissions %else %set_permissions monitoring-plugins %endif fi %files %defattr(-,root,root) %doc ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS ChangeLog CODING COPYING FAQ LEGAL %doc NEWS README REQUIREMENTS SUPPORT THANKS README.SUSE %doc example %files all %defattr(-,root,root) %doc README.SUSE-all %files apt %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_apt %files breeze %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_breeze %files by_ssh %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_by_ssh %files cluster %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_cluster ##files common -f %{name}.lang %files common -f nagios-plugins.lang %defattr(-,root,root) %doc ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS ChangeLog CODING COPYING FAQ LEGAL %doc NEWS README REQUIREMENTS SUPPORT THANKS README.SUSE %doc example %dir %{nagios_libdir} %dir %{nagios_plugindir} %defattr(0755,root,root) %{nagios_plugindir}/negate %{nagios_plugindir}/urlize %{nagios_plugindir}/utils.sh %attr(0644,root,root) %{nagios_plugindir}/utils.pm %files dhcp %defattr(-,root,root) %doc README.SUSE-check_dhcp %dir %{nagios_plugindir} %dir %{_sysconfdir}/apparmor.d %attr(0755,root,root) %{nagios_plugindir}/check_dhcp %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_dhcp %files dig %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_dig %files disk %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_disk %files disk_smb %defattr(0755,root,root) %{nagios_plugindir}/check_disk_smb %files dns %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_dns %files dummy %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_dummy %files extras %defattr(0644,root,root,0755) %doc README.SUSE-deprecated %files file_age %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_file_age %files flexlm %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_flexlm %files fping %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_fping %files game %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_game %files hpjd %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_hpjd %files http %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_http %files icmp %defattr(-,root,root) %doc README.SUSE-check_icmp %dir %{nagios_plugindir} %attr(0755,root,root) %{nagios_plugindir}/check_icmp %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_icmp %files ifoperstatus %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ifoperstatus %files ifstatus %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ifstatus %files ide_smart %defattr(-,root,root) %doc README.SUSE-check_ide_smart %dir %{nagios_plugindir} %attr(0755,root,root) %{nagios_plugindir}/check_ide_smart %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_ide_smart %files ircd %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ircd %files ldap %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ldap %{nagios_plugindir}/check_ldaps %files load %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_load %files log %defattr(0755,root,root) %{nagios_plugindir}/check_log %files mailq %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_mailq %files mrtg %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_mrtg %files mrtgtraf %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_mrtgtraf %files mysql %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_mysql %{nagios_plugindir}/check_mysql_query %files nagios %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_nagios %files nt %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_nt %files ntp_peer %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ntp_peer %files ntp_time %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ntp %{nagios_plugindir}/check_ntp_time %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_ntp_time %files nwstat %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_nwstat %files oracle %defattr(0755,root,root) %{nagios_plugindir}/check_oracle %files overcr %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_overcr %files pgsql %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_pgsql %files ping %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ping %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_ping %files procs %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_procs %if 0%{?suse_version} < 01110 %files radius %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_radius %endif %files real %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_real %files rpc %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_rpc %ifnarch ppc ppc64 sparc sparc64 s390 s390x %files sensors %defattr(0755,root,root) %{nagios_plugindir}/check_sensors %endif %files smtp %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_smtp %files snmp %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_snmp %files ssh %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ssh %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_ssh %files swap %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_swap %files tcp %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_clamd %{nagios_plugindir}/check_ftp %{nagios_plugindir}/check_imap %{nagios_plugindir}/check_jabber %{nagios_plugindir}/check_nntp %{nagios_plugindir}/check_nntps %{nagios_plugindir}/check_pop %{nagios_plugindir}/check_simap %{nagios_plugindir}/check_spop %{nagios_plugindir}/check_ssmtp %{nagios_plugindir}/check_tcp %{nagios_plugindir}/check_udp %files time %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_time %files ups %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_ups %files users %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_users %files wave %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_wave %ifarch x86_64 %files xenvm %defattr(0755,root,root) %dir %{nagios_plugindir} %{nagios_plugindir}/check_xenvm %endif %files cups %defattr(-,root,root) %doc README.SUSE-check_cups %dir %{nagios_plugindir} %dir %{_sysconfdir}/apparmor.d %attr(0755,root,root)%{nagios_plugindir}/check_cups %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/apparmor.d/usr.lib.monitoring.plugins.check_cups %changelog