1 |
unnilennium |
1.1 |
diff -up smeserver-sysmon-6.1/root/usr/sbin/sysmon.patch1 smeserver-sysmon-6.1/root/usr/sbin/sysmon |
2 |
|
|
--- smeserver-sysmon-6.1/root/usr/sbin/sysmon.patch1 2012-08-15 20:00:25.000000000 -0400 |
3 |
|
|
+++ smeserver-sysmon-6.1/root/usr/sbin/sysmon 2012-08-15 20:09:15.000000000 -0400 |
4 |
|
|
@@ -57,8 +57,14 @@ unless (fork) { |
5 |
|
|
chomp($badifaces); |
6 |
|
|
|
7 |
|
|
rename("/var/lib/rrd/sysmon.stats","/var/lib/rrd/sysmon.process"); |
8 |
|
|
- `/usr/lib/sa/sadc 1 1 /var/lib/rrd/sysmon.process > /dev/null 2>&1; /usr/lib/sa/sadc 1 1 /var/lib/rrd/sysmon.stats > /dev/null 2>&1`; |
9 |
|
|
- my @sardata = `/usr/bin/sar -hqru -P ALL -n DEV -f /var/lib/rrd/sysmon.process 2> /dev/null`; |
10 |
|
|
+ if ( -x '/usr/lib/sa/sadc' ) { |
11 |
|
|
+ `/usr/lib/sa/sadc 1 1 /var/lib/rrd/sysmon.process > /dev/null 2>&1; /usr/lib/sa/sadc 1 1 /var/lib/rrd/sysmon.stats > /dev/null 2>&1`;} |
12 |
|
|
+ else |
13 |
|
|
+ { |
14 |
|
|
+ `/usr/lib64/sa/sadc 1 1 /var/lib/rrd/sysmon.process > /dev/null 2>&1; /usr/lib64/sa/sadc 1 1 /var/lib/rrd/sysmon.stats > /dev/null 2>&1`;} |
15 |
|
|
+ my @sardata; |
16 |
|
|
+ if ( -x '/usr/bin/sadf' ) { @sardata=`/usr/bin/sadf -- -qrbu -n DEV /var/lib/rrd/sysmon.process 2> /dev/null`;print "sadf used : ";} |
17 |
|
|
+ else { @sardata = `/usr/bin/sar -hqru -P ALL -n DEV -f /var/lib/rrd/sysmon.process 2> /dev/null`; print "old systat : ";} |
18 |
|
|
unlink("/var/lib/rrd/sysmon.process"); |
19 |
|
|
|
20 |
|
|
if($#sardata > 0 && $sardata[0] =~ /\s+(\d+)\s+(\d{10})/ && $1 >= 45 && $1 <= 135 && $2 > $lastupdate) { |