Skip to content

Commit

Permalink
sim health is now OK:UP, Warning:UP, Critical:DOWN, Uknown:DOWN
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 17, 2024
1 parent cd007ba commit 65befbb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vcell-api/src/main/java/org/vcell/rest/health/HealthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,28 @@ public static class NagiosStatus {
int nagiosStatusCode;
String message;
Long elapsedTime_MS;
String up_or_down;

// exit with parsed nagios code (0-OK,1-Warning,2-Critical,3-Unknown)
NagiosStatus(String nagiosStatusName, int nagiosStatusCode, String message, Long elapsedTime_MS){
NagiosStatus(String nagiosStatusName, int nagiosStatusCode, String message, Long elapsedTime_MS, String up_or_down){
this.nagiosStatusName = nagiosStatusName;
this.nagiosStatusCode = nagiosStatusCode;
this.message = message;
this.elapsedTime_MS = elapsedTime_MS;
this.up_or_down = up_or_down;
}

static NagiosStatus OK(Long elapsedTime_MS) {
return new NagiosStatus("OK",0,null,elapsedTime_MS);
return new NagiosStatus("OK",0,null,elapsedTime_MS, "UP");
}
static NagiosStatus Warning(Long elapsedTime_MS) {
return new NagiosStatus("Warning",1,null,elapsedTime_MS);
return new NagiosStatus("Warning",1,null,elapsedTime_MS, "UP");
}
static NagiosStatus Critical(Long elapsedTime_MS, String message) {
return new NagiosStatus("Critical",2,message,elapsedTime_MS);
return new NagiosStatus("Critical",2,message,elapsedTime_MS, "DOWN");
}
static NagiosStatus Unknown() {
return new NagiosStatus("Unknown",3,null,null);
return new NagiosStatus("Unknown",3,null,null, "DOWN");
}
}

Expand Down

0 comments on commit 65befbb

Please sign in to comment.