Fix incorrect use of OSHI getDiskStores causing lots of reads on AIX.

This commit is contained in:
Mark Nellemann 2022-11-16 12:21:33 +01:00
parent c503032d94
commit 6ffc943a51
13 changed files with 145 additions and 98 deletions

View File

@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
## [1.0.24] - 2022-11-16
- Fix incorrect use of OSHI getDiskStores()
- Update dashboards
## [1.0.23] - 2022-11-07
- Update dashboards.
- Lower default interval for most plugins.
@ -36,6 +40,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Updated 3rd party dependencies.
[1.0.24]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.24%0Dv0.1.23
[1.0.23]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.23%0Dv0.1.21
[1.0.21]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.21%0Dv0.1.18
[1.0.18]: https://bitbucket.org/mnellemann/sysmon/branches/compare/v1.0.18%0Dv0.1.13

View File

@ -38,7 +38,7 @@ def projectName = "sysmon-client"
application {
// Define the main class for the application.
mainClass.set('sysmon.client.Application')
applicationDefaultJvmArgs = [ "-server", "-Xms64m", "-Xmx64m", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
applicationDefaultJvmArgs = [ "-Xms64m", "-Xmx64m", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
}
run {

View File

@ -6,6 +6,7 @@ Description=Sysmon Client
#Group=nobody
TimeoutSec=20
Restart=on-failure
# BELOW: Specify sysmon-server URL, add '-n hostname' if needed
ExecStart=/opt/sysmon/client/bin/client -s http://10.20.30.40:9925/metrics
[Install]

View File

@ -11,7 +11,7 @@
dir="/opt/sysmon/client"
cmd="/opt/sysmon/client/bin/client"
args="-s http://10.20.30.40:9925/metrics" # Specify sysmon-server URL here, add '-n hostname' if needed
args="-s http://10.20.30.40:9925/metrics" # <- HERE: Specify sysmon-server URL, add '-n hostname' if needed
user=""
name="sysmon-client"
@ -21,7 +21,9 @@ stderr_log="/var/log/$name.err"
# Uncomment if required
#JAVA_HOME=/usr/java8_64
#JAVA_HOME=/opt/ibm/ibm-semeru-certified-11-jre
#JAVA_HOME=/opt/ibm-semeru-open-8-jdk
#JAVA_HOME=/opt/ibm-semeru-open-11-jdk
#JAVA_HOME=/opt/ibm-semeru-open-17-jdk
#export JAVA_HOME
get_pid() {

View File

@ -15,21 +15,7 @@
## limitations under the License.
## ---------------------------------------------------------------------------
# to configure camel main
# here you can configure options on camel main (see MainConfigurationProperties class)
camel.main.name = sysmon-client
# enable tracing
#camel.main.tracing = true
# bean introspection to log reflection based configuration
#camel.main.beanIntrospectionExtendedStatistics=true
#camel.main.beanIntrospectionLoggingLevel=INFO
# run in lightweight mode to be tiny as possible
camel.main.jmxEnabled = false
camel.main.lightweight = true
# and eager load classes
#camel.main.eager-classloading = true
# limit the seda queue size
camel.component.seda.queue-size=10
camel.component.seda.queue-size = 100

View File

@ -1457,7 +1457,7 @@
"type": "linear"
},
"showPoints": "never",
"spanNulls": true,
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "normal"
@ -1532,7 +1532,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -1554,16 +1554,18 @@
"params": [],
"type": "mean"
},
{
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
5
],
"type": "moving_average"
},
{
"params": [],
"type": "non_negative_difference"
},
{
"params": [
"read"
@ -1690,7 +1692,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -1712,16 +1714,18 @@
"params": [],
"type": "mean"
},
{
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
5
],
"type": "moving_average"
},
{
"params": [],
"type": "non_negative_difference"
},
{
"params": [
"write"
@ -1843,7 +1847,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -1872,8 +1876,10 @@
"type": "moving_average"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -1996,7 +2002,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -2025,8 +2031,10 @@
"type": "moving_average"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2230,11 +2238,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2252,11 +2262,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2274,11 +2286,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2296,11 +2310,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2318,11 +2334,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2340,15 +2358,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2366,11 +2382,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2388,11 +2406,13 @@
},
{
"params": [],
"type": "mean"
"type": "last"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -2545,14 +2565,16 @@
"type": "mean"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
5
],
"type": "moving_average"
},
{
"params": [
10
"$__interval"
],
"type": "moving_average"
"type": "non_negative_derivative"
}
]
],
@ -3129,6 +3151,6 @@
"timezone": "",
"title": "Sysmon - Host Overview",
"uid": "QkVPjseMt",
"version": 15,
"version": 18,
"weekStart": ""
}

View File

@ -196,7 +196,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -218,6 +218,12 @@
"params": [],
"type": "mean"
},
{
"params": [
10
],
"type": "moving_average"
},
{
"params": [
"5min"
@ -340,7 +346,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -361,6 +367,12 @@
{
"params": [],
"type": "mean"
},
{
"params": [
10
],
"type": "moving_average"
}
]
],
@ -478,7 +490,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -499,6 +511,12 @@
{
"params": [],
"type": "mean"
},
{
"params": [
10
],
"type": "moving_average"
}
]
],
@ -617,7 +635,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -638,6 +656,12 @@
{
"params": [],
"type": "mean"
},
{
"params": [
10
],
"type": "moving_average"
}
]
],
@ -709,6 +733,6 @@
"timezone": "",
"title": "Sysmon - IBM Power",
"uid": "3zPCIbN4z",
"version": 6,
"version": 7,
"weekStart": ""
}

View File

@ -697,7 +697,7 @@
},
{
"params": [
"null"
"none"
],
"type": "fill"
}
@ -722,8 +722,10 @@
"type": "sum"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -744,8 +746,10 @@
"type": "sum"
},
{
"params": [],
"type": "non_negative_difference"
"params": [
"$__interval"
],
"type": "non_negative_derivative"
},
{
"params": [
@ -961,7 +965,9 @@
"refresh": "1m",
"schemaVersion": 37,
"style": "dark",
"tags": [],
"tags": [
"sysmon"
],
"templating": {
"list": [
{
@ -1049,6 +1055,6 @@
"timezone": "",
"title": "Sysmon - Process Explorer",
"uid": "Vjut5mS7k",
"version": 3,
"version": 5,
"weekStart": ""
}

View File

@ -1,4 +1,4 @@
version = 1.0.23
version = 1.0.24
pf4jVersion = 3.7.0
slf4jVersion = 2.0.3
camelVersion = 3.14.5

View File

@ -27,6 +27,8 @@ public class BaseDiskExtension implements MetricExtension {
private String interval = "10s";
private HardwareAbstractionLayer hardwareAbstractionLayer;
private List<HWDiskStore> diskStores;
private int refreshCounter = 0;
@Override
@ -82,10 +84,15 @@ public class BaseDiskExtension implements MetricExtension {
public MetricResult getMetrics() {
ArrayList<Measurement> measurementList = new ArrayList<>();
List<HWDiskStore> diskStores = hardwareAbstractionLayer.getDiskStores();
if(diskStores == null || refreshCounter++ > 360) {
log.info("getMetrics() - refreshing list of disk stores");
diskStores = hardwareAbstractionLayer.getDiskStores();
refreshCounter = 0;
}
for(HWDiskStore store : diskStores) {
store.updateAttributes();
String name = store.getName();
if (name.matches("h?disk[0-9]+") ||
//name.matches("/dev/dm-[0-9]+") ||

View File

@ -36,6 +36,8 @@ public class BaseFilesystemExtension implements MetricExtension {
private HardwareAbstractionLayer hardwareAbstractionLayer;
private SystemInfo systemInfo;
private List<OSFileStore> fileStores;
private int refreshCounter = 0;
@Override
@ -103,7 +105,10 @@ public class BaseFilesystemExtension implements MetricExtension {
ArrayList<String> alreadyProcessed = new ArrayList<>();
ArrayList<Measurement> measurementList = new ArrayList<>();
List<OSFileStore> fileStores = systemInfo.getOperatingSystem().getFileSystem().getFileStores(true);
if(fileStores == null || refreshCounter++ > 360) {
fileStores = systemInfo.getOperatingSystem().getFileSystem().getFileStores(true);
}
for(OSFileStore store : fileStores) {
@ -125,7 +130,9 @@ public class BaseFilesystemExtension implements MetricExtension {
log.debug("Skipping name: " + name);
continue;
}
alreadyProcessed.add(name);
store.updateAttributes();
TreeMap<String, String> tagsMap = new TreeMap<String, String>() {{
put("name", name);

View File

@ -28,7 +28,7 @@ def projectName = "sysmon-server"
application {
// Define the main class for the application.
mainClass.set('sysmon.server.Application')
applicationDefaultJvmArgs = [ "-server", "-Xms64m", "-Xmx64m", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
applicationDefaultJvmArgs = [ "-Xms64m", "-Xmx64m", "-XX:+ExitOnOutOfMemoryError", "-XX:+AlwaysPreTouch" ]
}
run {

View File

@ -15,18 +15,5 @@
## limitations under the License.
## ---------------------------------------------------------------------------
# to configure camel main
# here you can configure options on camel main (see MainConfigurationProperties class)
camel.main.name = sysmon-server
# enable tracing
#camel.main.tracing = true
# bean introspection to log reflection based configuration
#camel.main.beanIntrospectionExtendedStatistics=true
#camel.main.beanIntrospectionLoggingLevel=INFO
# run in lightweight mode to be tiny as possible
camel.main.lightweight = true
# and eager load classes
#camel.main.eager-classloading = true