Page tree
Skip to end of metadata
Go to start of metadata

This article describes how to run health check and check logs and statistics for Nexus Push Service

Expand/Collapse All

 View application information
  1. To check that the Nexus Push Server is alive, and view the running instance id and version, use the following command. Make sure to use the correct port:

    Example: View application information
    GET https://my-nps-server:20200/<contextPath>/info
     
    Response 200 OK
    Body
    {
    	"id": "nps.ce5fcf",
    	"build": {
    		"version": "1.0.2.RELEASE",
    		"artifact": "cod-nps",
    		"name": "Cod NPS",
    		"group": "com.nexusgroup.cod.nps",
    		"time": 1519631277000
    	}
    }
 Check application health
  1. To check the status of the Nexus Push Server, use the following command. Make sure to use the correct port:

    Example: Health check
    GET https://my-nps-server:20200/<contextPath>/health
     
    Response 200 OK
    Body
    {
    	"status":"UP"
    }

These are the built-in statuses:

Status

DOWN

OUT_OF_SERVICE

UP

UNKNOWN

 Check Nexus Push Service logs
  1. To check the logs:

    Example: Check logs
    # Login to the host
    ssh user@machine
    su - docker
     
    # Check logs
    cd compose/nps
    docker-compose logs -f
 Check metrics

The Nexus Push Service stores metrics since last restart. The metrics can be viewed via a http request.

  1. To view the Nexus Push Service metrics:

    Example: Check metrics
    # Login to the host
    ssh user@machine
    su - docker
    cd compose/nps
     
    # Find the current port for an NPS instance (32796 in this case)
    docker-compose ps | grep nps_nps
    nps_nps_1            ./fatjar-entrypoint.sh app ...   Up      0.0.0.0:32796->20200/tcp
     
    # Use curl to get metrics (You can use https://jsonformatter.curiousconcept.com/ to format the output)
    curl  http://localhost:32796/<contextPath>/metrics
     
    {
       "mem":673568,
       "mem.free":336830,
       "processors":2,
       "instance.uptime":57997012,
       "uptime":58006488,
       "systemload.average":0.0,
       "heap.committed":579072,
       "heap.init":112640,
       "heap.used":242241,
       "heap":1585664,
       "nonheap.committed":96768,
       "nonheap.init":2496,
       "nonheap.used":94496,
       "nonheap":0,
       "threads.peak":50,
       "threads.daemon":23,
       "threads.totalStarted":2493,
       "threads":49,
       "classes":10343,
       "classes.loaded":10343,
       "classes.unloaded":0,
       "gc.ps_scavenge.count":22,
       "gc.ps_scavenge.time":294,
       "gc.ps_marksweep.count":2,
       "gc.ps_marksweep.time":142,
       "api.notification.push.snapshot.999thPercentile":1060,
       "gauge.response.info":2.0,
       "api.notification.push.snapshot.max":1060,
       "gauge.response.inventory.device.register":347.0,
       "counter.status.200.info":3869,
       "counter.status.200.notification.push":1,
       "api.inventory.device.register.meanRate":3.467003987167159E-4,
       "api.inventory.device.register.snapshot.999thPercentile":339,
       "api.notification.push.snapshot.95thPercentile":1060,
       "api.notification.push.snapshot.median":1060,
       "api.notification.push.fifteenMinuteRate":2.40594379934471E-29,
       "counter.status.403.notification.push":2,
       "gauge.response.unmapped":5.0,
       "api.inventory.device.register.snapshot.stdDev":0,
       "api.inventory.device.register.snapshot.98thPercentile":339,
       "api.inventory.device.register.snapshot.mean":339,
       "gauge.response.metrics":24.0,
       "api.notification.push.count":2,
       "api.inventory.device.register.snapshot.75thPercentile":339,
       "api.inventory.device.register.count":20,
       "api.inventory.device.register.snapshot.median":339,
       "api.notification.push.snapshot.99thPercentile":1060,
       "api.inventory.device.register.fifteenMinuteRate":1.2096337463552884E-9,
       "api.notification.push.fiveMinuteRate":3.5188417433437274E-85,
       "api.inventory.device.register.oneMinuteRate":5.962202709954374E-92,
       "api.notification.push.snapshot.stdDev":157,
       "counter.status.405.unmapped":1,
       "gauge.response.notification.push":1070.0,
       "counter.status.200.metrics":1,
       "api.inventory.device.register.snapshot.99thPercentile":339,
       "api.notification.push.meanRate":3.455979751098208E-5,
       "api.inventory.device.register.fiveMinuteRate":4.3010078785694704E-21,
       "api.notification.push.oneMinuteRate":2.964393875E-314,
       "api.notification.push.snapshot.mean":1023,
       "api.notification.push.snapshot.75thPercentile":1060,
       "counter.status.404.notification.push":1,
       "counter.status.200.inventory.device.register":20,
       "api.inventory.device.register.snapshot.max":515,
       "api.notification.push.snapshot.min":339,
       "api.notification.push.snapshot.98thPercentile":1060,
       "api.inventory.device.register.snapshot.min":11,
       "api.inventory.device.register.snapshot.95thPercentile":339,
       "normalized.servo.rest.totaltime":0.0,
       "normalized.servo.rest.count":0.0,
       "gauge.servo.rest.min":0.0,
       "gauge.servo.rest.max":0.0,
       "httpsessions.max":-1,
       "httpsessions.active":0
    }