How can you tell what version of sensu-go you're running

Hi -

I’m trying to figure out how to identify the “version” of sensu-go that is currently running. I’m aware of that you can run the commercial release of sensu-go for free (up to 100 nodes) but there is no node restriction in the OSS version. Before I go adding all the nodes I have in my environment into Sense I would like to know how I can identify whether I’m running the OSS version or the non-OSS version.

I’m not using a pre-compiled binary or their pre-built images. I ended up grabbing the source for both go and web and made docker containers out of it and running those.

Thanks.

1 Like

The /version API can be used to check your Sensu backend version(s):

Example:

$ curl -s http://127.0.0.1:8080/version 
{
  "etcd": {
    "etcdserver": "3.5.4",
    "etcdcluster": "3.5.1"
  },
  "sensu_backend": "6.7.2",
  "api_groups": {
    "core/v2": "v2.14.0",
    "core/v3": "v3.6.1"
  }
}

You can also use the /entities API to get version information for all of your connected agents. This works really well with tools like jq.

Example:

$ curl -sX GET -H "Authorization: Key $SENSU_API_KEY" "http://127.0.0.1:8080/api/core/v2/namespaces/default/entities" | jq .[] | jq '{name: .metadata.name, version: .sensu_agent_version}'
{
  "name": "3dc4fbb5e07c",
  "version": "6.7.2"
}
{
  "name": "learn.sensu.io",
  "version": ""
}
{
  "name": "workshop_app_1",
  "version": ""
}

Or if you have a lot of proxy entities – as shown above, from my Sensu Go Workshop environment, I have two proxy entities which would not have an agent version – you can use a field selector to only return agent entities.

Example (/entities?fieldSelector=entity.entity_class+matches+'agent'):

$ curl -sX GET -H "Authorization: Key $SENSU_API_KEY" "http://127.0.0.1:8080/api/core/v2/namespaces/default/entities?fieldSelector=entity.entity_class+matches+'agent'" | jq .[] | jq '{name: .metadata.name?, version: .sensu_agent_version}'
{
  "name": "3dc4fbb5e07c",
  "version": "6.7.2"
}

I hope this helps!