Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu May 14, 2015 10:10 am 
Offline
Junior Member

Joined: Wed Nov 18, 2009 12:27 am
Posts: 28
Running the following script under cron and it will notify you your Linode needs rebooting to pick up the latest kernel:

Code:
#!/bin/bash

curl -s "https://api.linode.com/?api_key=TODOyourlongLinodeAPIKeyhere&api_action=avail.kernels&isXen=1" | jq '.DATA' | grep "Latest.*$(uname -r)" > /dev/null
if [ $? -eq 1 ]; then
  touch /var/run/reboot-required
  echo "New Linode Kernel is available - Reboot Required" | mail -s "New Linode Kernel is available" TODO@email
fi


Top
   
PostPosted: Thu May 14, 2015 10:18 am 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Rather than putting an API key on the Linode, you could also use the RSS feed:

https://www.linode.com/rss/kernels.xml

Either way works, all depends what kind of parsing you want to do.

- Les


Top
   
PostPosted: Thu May 14, 2015 10:27 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Quote:
Rather than putting an API key on the Linode, you could also use the RSS feed:

https://www.linode.com/rss/kernels.xml

Either way works, all depends what kind of parsing you want to do.

- Les


And here's a bash script that uses the rss feed
Code:
#!/bin/bash
    curl -s https://www.linode.com/rss/kernels.xml | grep "Latest.*$(uname -r)" > /dev/null
    if [ $? -eq 1 ]
    then
        echo -n 'Not using latest Linode kernel'
    fi

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu May 14, 2015 11:03 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Shows 4.0.2 as the latest for me <title>Latest 64 bit (4.0.2-x86_64-linode56)</title> note the newest kernel isn't always the one marked as latest. A kernel is only given the Latest flag when Linode think it's stable.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group