|
1 --- patch/net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c Tue Oct 12 07:37:07 2010 |
|
2 +++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c Tue Oct 12 07:34:41 2010 |
|
3 @@ -709,7 +709,12 @@ |
|
4 case CPUIDLE: |
|
5 return ((u_char *) (&cpu_perc[CPU_IDLE])); |
|
6 case CPURAWUSER: |
|
7 - take_snapshot(&raw_values); |
|
8 + /* Take the current snapshot */ |
|
9 + if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
|
10 + snmp_log(LOG_WARNING, |
|
11 + "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
|
12 + return (NULL); |
|
13 + } |
|
14 /* |
|
15 * LINTED has to be 'long' |
|
16 */ |
|
17 @@ -723,7 +728,12 @@ |
|
18 * (Has been changed to Counter32 in the latest MIB version!) |
|
19 */ |
|
20 case CPURAWSYSTEM: |
|
21 - take_snapshot(&raw_values); |
|
22 + /* Take the current snapshot */ |
|
23 + if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
|
24 + snmp_log(LOG_WARNING, |
|
25 + "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
|
26 + return (NULL); |
|
27 + } |
|
28 /* |
|
29 * LINTED has to be 'long' |
|
30 */ |
|
31 @@ -732,7 +742,12 @@ |
|
32 raw_values.css_cpu[CPU_WAIT]) / raw_values.css_cpus); |
|
33 return ((u_char *) (&long_ret)); |
|
34 case CPURAWIDLE: |
|
35 - take_snapshot(&raw_values); |
|
36 + /* Take the current snapshot */ |
|
37 + if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
|
38 + snmp_log(LOG_WARNING, |
|
39 + "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
|
40 + return (NULL); |
|
41 + } |
|
42 /* |
|
43 * LINTED has to be 'long' |
|
44 */ |
|
45 @@ -740,7 +755,12 @@ |
|
46 (long) (raw_values.css_cpu[CPU_IDLE] / raw_values.css_cpus); |
|
47 return ((u_char *) (&long_ret)); |
|
48 case CPURAWWAIT: |
|
49 - take_snapshot(&raw_values); |
|
50 + /* Take the current snapshot */ |
|
51 + if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
|
52 + snmp_log(LOG_WARNING, |
|
53 + "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
|
54 + return (NULL); |
|
55 + } |
|
56 /* |
|
57 * LINTED has to be 'long' |
|
58 */ |
|
59 @@ -748,7 +768,12 @@ |
|
60 (long) (raw_values.css_cpu[CPU_WAIT] / raw_values.css_cpus); |
|
61 return ((u_char *) (&long_ret)); |
|
62 case CPURAWKERNEL: |
|
63 - take_snapshot(&raw_values); |
|
64 + /* Take the current snapshot */ |
|
65 + if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) { |
|
66 + snmp_log(LOG_WARNING, |
|
67 + "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n"); |
|
68 + return (NULL); |
|
69 + } |
|
70 /* |
|
71 * LINTED has to be 'long' |
|
72 */ |