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 c94db92
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 tags;

// 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 tags){
this.nagiosStatusName = nagiosStatusName;
this.nagiosStatusCode = nagiosStatusCode;
this.message = message;
this.elapsedTime_MS = elapsedTime_MS;
this.tags = tags;
}

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 WARNING");
}
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, "WARNING");
}
}

Expand Down

0 comments on commit c94db92

Please sign in to comment.