Back to Geneos FAQ

REST API - How to use the REST API to return a list of managed entities with a warning or critical severity

To find all managed entities with a severity of warning or critical:

curl -u username:password -X GET -s --data '{"target":"//managedEntity[(state(\"severity\")>1)]"}' http://gatewayHost:gatewayPort/rest/xpaths/match | python -m json.tool

[geneos@kamcs7 ~]$ curl -u Web:hello123 -X GET -s --data '{"target":"//managedEntity[(state(\"severity\")>1)]"}' http://kamcs7.cslab.ldn.itrs:9007/rest/xpaths/match | python -m json.tool
{
    "xpaths": [
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"Birmingham\")]",
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"London\")]",
        "/geneos/gateway[(@name=\"OERH_RMDS_02\")]/directory/probe[(@name=\"Trades\")]/managedEntity[(@name=\"Swansea\")]"
    ]
}

Geneos - REST API - How to use the REST API to return a list of managed entities with a warning or critical severity

The definition of the severity states can be found here:

Guide/geneos_xpath_ug.html#ExtractRparams > state attributes Severity is a state attributes: 0 = none, 1 = OK, 2 = warning, 3 = critical, 4+ = user.

["Geneos"] ["Geneos > Gateway"] ["FAQ"]

Was this topic helpful?