How can I use Longview to check the kernels my Linodes are running?

Linode Staff

I'm looking for any simple export options for Longview. In this case, I'm looking to make a report showing all version of the Linux kernel are in use on our account. Longview shows this information but I have to click each VM individually. Thanks!

1 Reply

The first thing you'll want to do is obtain the API key for each of your Longview clients. The easiest way to do this is via the Linode API and some jq magic to get a list the API keys. The commands below should return an array containing the Longview API key for each of your Longview clients. It will then loop over each Longview API key and return the hostname and kernel the associate Linode is running.

# Gets all the Longview API tokens and stores them in an array
a=($(curl -sH "Authorization: Bearer $TOKEN" \ \
| jq -r '.data[].api_key'))

# Loops through that array to return the hostname and kernel of each client
for i in "${a[@]}"
do curl -sX POST \
   -F "api_key=$i" \
   -F "api_action=getLatestValue" \
   -F 'keys=["SysInfo.*"]' | jq '.[0].DATA.SysInfo.hostname, .[0].DATA.SysInfo.kernel'


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct