Visit my.sonatype.com for documentation on Nexus Repository version 2.
The uptime of a Nexus Repository 2 instance can be monitored by using the /service/local/status REST resource, e.g.:https://localhost:8081/nexus/service/local/status
The current state of the server can be found in the "state" field of the response, and the start time can be found in the "initializedAt" field.
You can use this REST endpoint in conjunction with your whatever server monitoring you have in place, and have it raise an alert if the resource either fails to respond, the "state" is not "STARTED", or the "initializedAt" field contains an unexpected time.
6 Comments
I'm going to do that in nagios, thanks. What are the different states we can expect in the field?
Also note for users: you can also send an "Accept: application/json" in headers to get the JSON version of that XML output if that's easier for you to digest.
You can find the enumeration which defines these states here:
https://github.com/sonatype/nexus-oss/blob/nexus-2.11.4-01/components/nexus-core/src/main/java/org/sonatype/nexus/SystemState.java
Oh of course... Thank you very much.
The link seems to be broken. Could you please fix it? Thank you
If you're talking about the github link, yes the nexus project has been moved to nexus-oss.
https://github.com/sonatype/nexus-oss/blob/nexus-2.11.4-01/components/nexus-core/src/main/java/org/sonatype/nexus/SystemState.java
We are closing this article for comments.
If you have a support license, please contact us by submitting a support ticket.
If you do not have a support license, please use our Nexus Users List or our other free support resources.