forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-72009] allow agents to define diskspace monitoring thresholds
Introduces a NodeProperty to define agent specific thresholds for free disk and temp space. Enhance the tooltip in the executor widget so it includes the threshold Show a tooltip in the nodes table when agent was marked offline todo: add a warning threshold
- Loading branch information
1 parent
7d1217b
commit 217e80f
Showing
32 changed files
with
205 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
core/src/main/java/hudson/node_monitors/DiskSpaceMonitorNodeProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package hudson.node_monitors; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import hudson.model.Node; | ||
import hudson.slaves.NodeProperty; | ||
import hudson.slaves.NodePropertyDescriptor; | ||
import org.jenkinsci.Symbol; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
public class DiskSpaceMonitorNodeProperty extends NodeProperty<Node> { | ||
private final String freeDiskSpaceThreshold; | ||
private final String freeTempSpaceThreshold; | ||
|
||
@DataBoundConstructor | ||
public DiskSpaceMonitorNodeProperty(String freeDiskSpaceThreshold, String freeTempSpaceThreshold) { | ||
this.freeDiskSpaceThreshold = freeDiskSpaceThreshold; | ||
this.freeTempSpaceThreshold = freeTempSpaceThreshold; | ||
} | ||
|
||
public String getFreeDiskSpaceThreshold() { | ||
return freeDiskSpaceThreshold; | ||
} | ||
|
||
public String getFreeTempSpaceThreshold() { | ||
return freeTempSpaceThreshold; | ||
} | ||
|
||
@Extension | ||
@Symbol("diskspaceMonitor") | ||
public static class DescriptorImpl extends NodePropertyDescriptor { | ||
|
||
@NonNull | ||
@Override | ||
public String getDisplayName() { | ||
return Messages.DiskSpaceMonitorNodeProperty_DisplayName(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
...main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
<div> | ||
This option configures the amount of minimum amount of free disk space desired | ||
for an agent's proper operation, such as "1.5GB", "100KB", etc. If an agent is | ||
found to have less free disk space than this amount, it will be marked | ||
offline. | ||
for an agent's proper operation, such as "1.5GB", "100KiB", etc. If an agent | ||
is found to have less free disk space than this amount, it will be marked | ||
temporarily offline. The threshold can be configured individually for each | ||
agent via a property. | ||
<p> | ||
Set to 0 to disable this check except for agents that configure the | ||
threshold explicitly. | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
core/src/main/resources/hudson/node_monitors/DiskSpaceMonitor/help.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
core/src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
<f:entry field="freeDiskSpaceThreshold" title="${%Free Disk Space Threshold}"> | ||
<f:textbox default="1GB"/> | ||
</f:entry> | ||
<f:entry field="freeTempSpaceThreshold" title="${%Free Temp Space Threshold}"> | ||
<f:textbox default="1GB"/> | ||
</f:entry> | ||
</j:jelly> |
2 changes: 2 additions & 0 deletions
2
...src/main/resources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/config_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Free\ Disk\ Space\ Threshold=Schwellwert für freien Festplattenspeicherplatz | ||
Free\ Temp\ Space\ Threshold=Schwellwert für freien temporären Speicherplatz |
7 changes: 7 additions & 0 deletions
7
...ources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeDiskSpaceThreshold.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div> | ||
This option configures the amount of minimum amount of free disk space desired | ||
for the agent's proper operation, such as "1.5GB", "100KiB", etc. If an agent | ||
is found to have less free disk space than this amount, it will be marked | ||
temporarily offline. | ||
<p>Set to 0 to disable this check on this agent.</p> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
...ources/hudson/node_monitors/DiskSpaceMonitorNodeProperty/help-freeTempSpaceThreshold.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div> | ||
This option configures the amount of minimum amount of free temp space desired | ||
for the agent's proper operation, such as "1.5GB", "100KiB", etc. If an agent | ||
is found to have less free temp space than this amount, it will be marked | ||
temporarily offline. | ||
<p>Set to 0 to disable this check on this agent.</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.