1
0

44 Commits

Author SHA256 Message Date
c3eb87f9c8 Accepting request 1240863 from server:monitoring
OBS-URL: https://build.opensuse.org/request/show/1240863
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=16
2025-01-28 16:10:05 +00:00
29e705c89e - Requires Python3 and not old Python2
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=44
2025-01-28 15:52:16 +00:00
06db1f855b Accepting request 1240516 from server:monitoring
- Fix version number, we don't want to downgrade this package.

- Conversion to _service pulled source from upstream
- Add no-python2.patch to make script python3 compatible (forwarded request 1240508 from mcepl)

OBS-URL: https://build.opensuse.org/request/show/1240516
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=15
2025-01-27 19:56:21 +00:00
caf477d719 - Fix version number, we don't want to downgrade this package.
- Conversion to _service pulled source from upstream
- Add no-python2.patch to make script python3 compatible

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=42
2025-01-27 11:55:31 +00:00
d1c3053021 Accepting request 1194088 from server:monitoring
OBS-URL: https://build.opensuse.org/request/show/1194088
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=14
2024-08-16 10:23:41 +00:00
0956590c02 Accepting request 1149735 from server:monitoring
OBS-URL: https://build.opensuse.org/request/show/1149735
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=13
2024-02-23 15:46:14 +00:00
7ce96685f5 Accepting request 1149727 from home:pgajdos:m
- Use %autosetup macro. Allows to eliminate the usage of deprecated
  %patchN

OBS-URL: https://build.opensuse.org/request/show/1149727
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=38
2024-02-23 08:57:05 +00:00
46fd9253c8 Accepting request 889342 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/889342
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=12
2021-04-29 20:46:57 +00:00
Lars Vogdt
957a8b0672 - reload the apparmor profile in postun to make the changes effective
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=36
2021-04-22 14:26:21 +00:00
Lars Vogdt
257ff21d36 - include abstractions/bash in apparmor profile - otherwise
the 'which iostat' command fails

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=35
2021-04-22 12:30:34 +00:00
289fd4a33d Accepting request 824333 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/824333
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=11
2020-08-04 18:25:35 +00:00
Ruediger Oertel
7ed92bc2ee - update apparmor profile again to allow reading
/sys/devices/**/stat

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=33
2020-07-28 12:07:55 +00:00
97e8d7b643 Accepting request 820972 from server:monitoring
-  update AppArmor profiles to include a comment why the check
   needs to read nsswitch.conf and passwd

OBS-URL: https://build.opensuse.org/request/show/820972
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=10
2020-07-16 10:16:47 +00:00
8d326ca04b OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=31 2020-07-14 19:50:08 +00:00
2c395551ed OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=30 2020-07-14 19:48:04 +00:00
Lars Vogdt
0ef023c731 include a comment why the check needs to read nsswitch.conf and passwd
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=29
2020-07-07 15:29:46 +00:00
d026fc27c5 Accepting request 810954 from server:monitoring
OBS-URL: https://build.opensuse.org/request/show/810954
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=9
2020-06-03 18:34:46 +00:00
Lars Vogdt
9ec369151a Accepting request 810470 from home:cboltz:branches:server:monitoring
- update AppArmor profile to allow reading /etc/nsswitch.conf and /etc/passwd

OBS-URL: https://build.opensuse.org/request/show/810470
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=27
2020-06-02 20:36:05 +00:00
c01d7b5735 Accepting request 786621 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/786621
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=8
2020-03-20 22:58:33 +00:00
Ruediger Oertel
886371e9ba - update apparmor profile usr.lib.nagios.plugins.check_iostat
to allow reading / and /proc/$pid/mountinfo

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=25
2020-03-12 23:44:13 +00:00
Ruediger Oertel
1f718b7799 fix last change
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=24
2020-03-10 13:42:07 +00:00
b0cc8afdae Accepting request 782144 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/782144
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=7
2020-03-06 20:29:11 +00:00
Ruediger Oertel
2be02b9d41 - check_iostat: add reasons why state is warning or critical
to the output

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=22
2020-02-28 14:41:50 +00:00
6f96279e62 Accepting request 757911 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/757911
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=6
2019-12-21 11:29:55 +00:00
Ruediger Oertel
2f4e862ed2 - check_iostat: sanitize dev name to properly match iostat output
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=20
2019-12-11 17:11:36 +00:00
Ruediger Oertel
0cb710c31c - check_iostat: exit with OK if running on tmpfs
- check_iostat: fix apparmor profile to allow stat call

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=19
2019-12-05 15:35:07 +00:00
Ruediger Oertel
bb1beac553 - check_iostat: allow to just specify a directory
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=18
2019-12-05 13:41:57 +00:00
e8d5ef7570 Accepting request 694435 from server:monitoring
OBS-URL: https://build.opensuse.org/request/show/694435
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=5
2019-04-17 08:07:53 +00:00
Lars Vogdt
5bd64f92b0 Accepting request 694066 from home:cboltz:branches:server:monitoring
- update AppArmor profile for usrMerge (bash) (boo#1132350)

OBS-URL: https://build.opensuse.org/request/show/694066
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=16
2019-04-15 13:53:55 +00:00
07460d5b67 Accepting request 621119 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/621119
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=4
2018-07-06 08:48:36 +00:00
Ruediger Oertel
d7a583cfc0 - check_iostat: fix to work with iostat on sle15
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=14
2018-04-10 09:09:24 +00:00
bf50496515 Accepting request 544408 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/544408
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=3
2017-11-23 08:44:11 +00:00
Ruediger Oertel
315c48ab46 - check_iostat: get field numbers from iostat dynamically
by parsing header line (r/s and w/s fields move between versions)

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=12
2017-11-15 11:53:02 +00:00
Ruediger Oertel
77bb1e171a - check_iostat: pass warning and critical level to perfdata
- use iostat fields r/s and w/s for tps calculation

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=11
2017-11-14 16:28:21 +00:00
Ruediger Oertel
6e8dcaed67 check_iostat pass warn and crit levels to performance data
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=10
2017-11-14 16:13:21 +00:00
83ca7b9211 Accepting request 492303 from server:monitoring
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/492303
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=2
2017-05-02 06:54:58 +00:00
Ruediger Oertel
e45c8ecb6f ...
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=8
2017-04-24 10:57:53 +00:00
Ruediger Oertel
f96c0e60ff - use -x for iostat and add utilization monitoring
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=7
2017-04-24 10:33:47 +00:00
a2bfa65904 Accepting request 341694 from server:monitoring
New package for openSUSE:Factory: check the IO of your systems

OBS-URL: https://build.opensuse.org/request/show/341694
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins-sar-perf?expand=0&rev=1
2016-02-11 11:37:05 +00:00
Lars Vogdt
ca4f72b406 - switch to BSD-2-Clause as the script is more likely released
under this license

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=5
2015-10-30 15:02:49 +00:00
Lars Vogdt
06b322efa3 fix build on RHEL-7
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=4
2015-08-01 19:27:59 +00:00
Lars Vogdt
0aadf20c17 - add apparmor profile for check_iostat
- recommend apparmor-profiles (needed for apparmor profile, but as 
  the check itself runs without apparmor, we use a week dependency)

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=3
2015-08-01 19:17:32 +00:00
Lars Vogdt
84ad4ad9cb - Renamed package to monitoring-plugins-sar-perf
- check_iostat: use 5 seconds instead of 2 to get more useful data 

- check_iostat: add warning and critical levels for iowait 

- check_iostat: actually check current io stats, not since boot 

- more additions to check_iostat: can use device-mapper name 

- rewrite check_iostat in perl, also output iowait value 

- add requires sysstat
- check_iostat: call iostat with "-k" to really display kb
  instead of blocks as unit

- added check_iostat

- also print the used arguments as output to STDOUT, so the user 
  knows what is mesured (monitoring-plugins-sar-perf-stdout.patch)

- added monitoring-plugins-sar-perf-output.patch :
  do not print DEV name for disk in performance output

- initial version (git commit  4878d0cc66e928bd1075) defined as 0.1

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=2
2014-07-30 21:35:13 +00:00
Lars Vogdt
af43822f8a osc copypac from project:server:monitoring package:nagios-plugins-sar-perf revision:10
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=1
2014-07-30 19:20:37 +00:00
10 changed files with 115 additions and 23 deletions

15
_service Normal file
View File

@@ -0,0 +1,15 @@
<services>
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/nickanderson/check-sar-perf.git</param>
<param name="versionprefix">0.1+git</param>
<param name="changesgenerate">enable</param>
<param name="changesauthor">mcepl@cepl.eu</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="manual"/>
</services>

4
_servicedata Normal file
View File

@@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/nickanderson/check-sar-perf.git</param>
<param name="changesrevision">4878d0cc66e928bd10757a0b234730e03310871e</param></service></servicedata>

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2dd4f9e9bcb1f4f48993fbf3ba664495fc94abee13d1bf2eb928ac7b03259376
size 8202

4
check-sar-perf.obsinfo Normal file
View File

@@ -0,0 +1,4 @@
name: check-sar-perf
version: 0.1+git.1272298931.4878d0c
mtime: 1272298931
commit: 4878d0cc66e928bd10757a0b234730e03310871e

View File

@@ -1,14 +1,28 @@
Index: check_sar_perf.py ---
=================================================================== check_sar_perf.py | 15 ++++++++-------
--- check_sar_perf.py.orig 1 file changed, 8 insertions(+), 7 deletions(-)
+++ check_sar_perf.py
@@ -99,7 +99,8 @@ class SarNRPE: --- a/check_sar_perf.py
+++ b/check_sar_perf.py
@@ -99,13 +99,14 @@ class SarNRPE:
# Create dictionary # Create dictionary
for i in range(len(columns)): for i in range(len(columns)):
# Remove first column if data contains only letters # Remove first column if data contains only letters
- if i != 0 or not search.match(data[i]): - if i != 0 or not search.match(data[i]):
- # Remove characters that cause issues (%/)
- badchars=['%','/']
- columns[i] = ''.join(j for j in columns[i] if j not in badchars)
- string = "%s=%s" %(columns[i].strip('%/'), data[i].strip())
- self.stats.append(string)
- #print "Appended data: ", data[i]
+ #if i != 0 or not search.match(data[i]): + #if i != 0 or not search.match(data[i]):
+ if (i != 0 or not search.match(data[i])) and (columns[i] != "DEV"): + if (i != 0 or not search.match(data[i])) and (columns[i] != "DEV"):
# Remove characters that cause issues (%/) + # Remove characters that cause issues (%/)
badchars=['%','/'] + badchars=['%','/']
columns[i] = ''.join(j for j in columns[i] if j not in badchars) + columns[i] = ''.join(j for j in columns[i] if j not in badchars)
+ string = "%s=%s" %(columns[i].strip('%/'), data[i].strip())
+ self.stats.append(string)
+ #print "Appended data: ", data[i]
def CheckBin(program):
'''Ensure the program exists in the PATH'''

View File

@@ -1,19 +1,21 @@
Index: check_sar_perf.py ---
=================================================================== check_sar_perf.py | 5 +++--
--- check_sar_perf.py.orig 1 file changed, 3 insertions(+), 2 deletions(-)
+++ check_sar_perf.py
--- a/check_sar_perf.py
+++ b/check_sar_perf.py
@@ -153,11 +153,12 @@ def Main(args): @@ -153,11 +153,12 @@ def Main(args):
else: else:
sar = SarNRPE(myOpts[args[1]]) sar = SarNRPE(myOpts[args[1]])
else: else:
- print 'ERROR: option not defined' - print 'ERROR: option not defined'
+ print 'ERROR: option ',args[1],' not defined' + print('ERROR: option ',args[1],' not defined')
sys.exit(ERR_UNKN) sys.exit(ERR_UNKN)
# Output in NRPE format # Output in NRPE format
- print 'sar OK|', ' '.join(sar.stats) - print 'sar OK|', ' '.join(sar.stats)
+ args[0]='' + args[0]=''
+ print 'sar OK: ',' '.join(args),'|', ' '.join(sar.stats) + print('sar OK: ',' '.join(args),'|', ' '.join(sar.stats))
if __name__ == '__main__': if __name__ == '__main__':
Main(sys.argv) Main(sys.argv)

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Tue Jan 28 15:50:00 UTC 2025 - Ana Guerrero <ana.guerrero@suse.com>
- Requires Python3 and not old Python2
-------------------------------------------------------------------
Mon Jan 27 09:28:18 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Fix version number, we don't want to downgrade this package.
-------------------------------------------------------------------
Fri Jan 24 09:58:04 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Conversion to _service pulled source from upstream
- Add no-python2.patch to make script python3 compatible
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 24 12:24:59 CEST 2024 - ro@suse.de Wed Jul 24 12:24:59 CEST 2024 - ro@suse.de

View File

@@ -1,7 +1,7 @@
# #
# spec file for package monitoring-plugins-sar-perf # spec file for package monitoring-plugins-sar-perf
# #
# Copyright (c) 2024 SUSE LLC # Copyright (c) 2025 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -20,21 +20,24 @@ Name: monitoring-plugins-sar-perf
Summary: Get performance data from sar Summary: Get performance data from sar
License: BSD-2-Clause License: BSD-2-Clause
Group: System/Monitoring Group: System/Monitoring
Version: 0.1 Version: 0.1+git.1272298931.4878d0c
Release: 0 Release: 0
URL: https://github.com/nickanderson/check-sar-perf URL: https://github.com/nickanderson/check-sar-perf
Source0: nickanderson-check-sar-perf-4878d0c.tar.gz Source0: check-sar-perf-%{version}.tar.xz
Source1: check_iostat Source1: check_iostat
Source2: usr.lib.nagios.plugins.check_iostat Source2: usr.lib.nagios.plugins.check_iostat
Patch0: monitoring-plugins-sar-perf-output.patch Patch0: monitoring-plugins-sar-perf-output.patch
Patch1: monitoring-plugins-sar-perf-stdout.patch Patch1: monitoring-plugins-sar-perf-stdout.patch
# PATCH-FIX-UPSTREAM no-python2.patch gh#nickanderson/check-sar-perf!3 mcepl@suse.com
# make the script Python 3 compatible
Patch2: no-python2.patch
BuildRequires: nagios-rpm-macros BuildRequires: nagios-rpm-macros
%if 0%{?suse_version} %if 0%{?suse_version}
Recommends: apparmor-profiles Recommends: apparmor-profiles
%endif %endif
Provides: nagios-plugins-sar-perf = %{version}-%{release} Provides: nagios-plugins-sar-perf = %{version}-%{release}
Obsoletes: nagios-plugins-sar-perf < %{version}-%{release} Obsoletes: nagios-plugins-sar-perf < %{version}-%{release}
Requires: python Requires: python3
Requires: sysstat Requires: sysstat
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -54,7 +57,7 @@ sar OK| DEV=sda tps=0.00 rd_sec/s=0.00 wr_sec/s=0.00 avgrq-sz=0.00
avgqu-sz=0.00 await=0.00 svctm=0.00 util=0.00 avgqu-sz=0.00 await=0.00 svctm=0.00 util=0.00
%prep %prep
%autosetup -p0 -n nickanderson-check-sar-perf-4878d0c %autosetup -p1 -n check-sar-perf-%{version}
%build %build

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c76642e2dfc208fe0e699f6fdc55231d9839f2bfd55cb6371c63cf5ad8be5ed
size 3308

34
no-python2.patch Normal file
View File

@@ -0,0 +1,34 @@
---
check_sar_perf.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/check_sar_perf.py
+++ b/check_sar_perf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2010, Nick Anderson <nick@cmdln.org>
# All rights reserved.
@@ -121,10 +121,10 @@ def CheckBin(program):
def Main(args):
# Ensure a profile (aka myOpts) is selected
if not len(args) > 1:
- print 'ERROR: no profile selected'
+ print('ERROR: no profile selected')
sys.exit(ERR_UNKN)
if not CheckBin('sar'):
- print 'ERROR: sar not found on PATH (%s), install sysstat' %os.environ['PATH']
+ print('ERROR: sar not found on PATH (%s), install sysstat' %os.environ['PATH'])
sys.exit(ERR_CRIT)
# Profiles may need to be modified for different versions of the sysstat package
@@ -148,7 +148,7 @@ def Main(args):
if len(args) > 2:
sar = SarNRPE(myOpts[args[1]],args[2])
else:
- print 'ERROR: no device specified'
+ print('ERROR: no device specified')
sys.exit(ERR_UNKN)
else:
sar = SarNRPE(myOpts[args[1]])