Configure disk space usage monitors - refresh rate?

Jenkins setup:
Jenkins: 2.501
OS: Linux - 4.18.0-553.34.1.el8_10.x86_64
Java: 17.0.14 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

I am trying to configure different threshold for disk space usage monitor (Manage Jenkins → Nodes → Configure Monitors → Free Space Threshold) from the default 1GB.

I set it to 50GB, saved the configuration, and then I created a huge file at jenkins home on one of my agent, and intentionally trying to see if the agent will be taken offline. I waited a long while and nothing happened. I also clicked into the agent page, and the “Monitoring Data” is not reflecting the truth.

I then went back to Nodes page, and click the “refresh” button at the top right, then suddenly that agent went offline promptly. The Monitoring Data is also reflecting the actual situation.

I thought the disk usage monitor runs on a cron that periodically scans, but it seems “not working” until I clicked refresh. Is that the right understanding, or am I simply doing it wrong?

By default the node monitors run only every 60min. Can be configured by setting -Dhudson.node_monitors.AbstractNodeMonitorDescriptor.periodMinutes=5 (would set it to 5 minutes) at startup.

1 Like