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
This commit is contained in:
commit
6f96279e62
30
check_iostat
30
check_iostat
@ -71,14 +71,36 @@ my ($crit_tps,$crit_read,$crit_written) = split(',',$critical);
|
||||
my ($warn_tps,$warn_read,$warn_written) = split(',',$warning);
|
||||
|
||||
# Checking parameters:
|
||||
if (-d "$disk") {
|
||||
# directory specified ...
|
||||
my $mp = `stat --format '\%m' $disk`;
|
||||
chomp($mp);
|
||||
my $fstype = `stat --file-system --format '\%T' $mp`;
|
||||
chomp($fstype);
|
||||
if ($fstype eq "tmpfs") {
|
||||
print "OK - $disk (mountpoint $mp is tmpfs)\n";
|
||||
exit 0;
|
||||
}
|
||||
open(MOUNTS,"/proc/mounts");
|
||||
while(<MOUNTS>) {
|
||||
chomp($_);
|
||||
my @line = split('\s+',$_);
|
||||
$disk = $line[0] if $mp eq $line[1];
|
||||
}
|
||||
close(MOUNTS);
|
||||
}
|
||||
|
||||
$disk =~ s/^\/dev\/mapper\///;
|
||||
$disk =~ s/^\/dev\///;
|
||||
|
||||
if (! -b "/dev/$disk") {
|
||||
if (-b "/dev/mapper/$disk") {
|
||||
my @f = stat("/dev/mapper/$disk");
|
||||
$f[6] %= 256;
|
||||
$disk = "dm-$f[6]";
|
||||
$f[6] %= 256;
|
||||
$disk = "dm-$f[6]";
|
||||
} else {
|
||||
warn "ERROR: Device incorrectly specified\n";
|
||||
HELP_MESSAGE();
|
||||
warn "ERROR: Device incorrectly specified\n";
|
||||
HELP_MESSAGE();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 11 18:10:48 CET 2019 - ro@suse.de
|
||||
|
||||
- check_iostat: sanitize dev name to properly match iostat output
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 5 16:34:19 CET 2019 - ro@suse.de
|
||||
|
||||
- check_iostat: exit with OK if running on tmpfs
|
||||
- check_iostat: fix apparmor profile to allow stat call
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 5 14:40:38 CET 2019 - ro@suse.de
|
||||
|
||||
- check_iostat: allow to just specify a directory
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Apr 14 16:06:32 UTC 2019 - Christian Boltz <suse-beta@cboltz.de>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package monitoring-plugins-sar-perf
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2019 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -22,7 +22,7 @@ License: BSD-2-Clause
|
||||
Group: System/Monitoring
|
||||
Version: 0.1
|
||||
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
|
||||
Source1: check_iostat
|
||||
Source2: usr.lib.nagios.plugins.check_iostat
|
||||
|
@ -5,9 +5,11 @@
|
||||
#include <abstractions/perl>
|
||||
/usr/bin/iostat rix,
|
||||
/{usr/,}bin/bash rix,
|
||||
/{usr/,}bin/stat rix,
|
||||
/usr/bin/which rix,
|
||||
/sys/devices/system/cpu/ r,
|
||||
/proc/meminfo r,
|
||||
@{PROC}/[0-9]*/mounts r,
|
||||
/proc/diskstats r,
|
||||
/proc/uptime r,
|
||||
/etc/sysstat/sysstat.ioconf r,
|
||||
|
Loading…
Reference in New Issue
Block a user