19. 12. 2019 Giuseppe Di Garbo Downloads / Release Notes, NetEye

Never Forget Your NetEye Updates!

Regularly updating operating systems is now an essential task. And the operating system at the base of NetEye (CentOS 7) must be regularly updated.

But I still find many customers who for lack of time forget these updates and ask me if it’s possible to get an automatic report of them.

And here I found a very useful utility called yum-cron which is just right for us!

What is yum-cron?

From its man page:

yum-cron  is  an  alternate  interface  to yum that is optimized to be convenient to call from cron.  It provides methods to keep repository metadata up to date, and to check for, download, and apply updates.  Rather than accepting many different command line arguments, the different functions of yum-cron can be accessed through config files.

With this utility it is possible both to download and perform updates, but I always suggest that customers use it ONLY for downloading and for notification of the availability of updates and then proceed manually.

Installing the yum-cron package

The installation steps are quite easy:

# yum install yum-cron
# systemctl start yum-cron
# systemctl enable yum-cron 

Configuring yum-cron

Now we can edit the yum-cron configuration file:

# cp -a /etc/yum/yum-cron.conf /etc/yum/yum-cron.conf.orig
# vim /etc/yum/yum-cron.conf

In the [commands] section we can define the types of packages we want to be updated, enable messages and downloads, and it’s here that I suggest you set “no” for automatic applying updates:

[commands]
 update_cmd = yum update --enablerepo=neteye
 update_messages = yes
 download_updates = yes
 apply_updates = no
 random_sleep = 360

In the following sections we can define how to send a notification via email:

[emitters]
 system_name = neteye4.mydomain.com
 emit_via = email
 output_width = 80
[email]
 email_from = neteye4@mydomain.com
 email_to = my_email@mydomain.com

Check logs

You can grep /var/log/cron to check if cron jobs associated with yum have been executed:

[root@neteye4 ~]# grep yum /var/log/cron  Dec 18 14:01:01 neteye4 run-parts(/etc/cron.hourly)[21718]: starting 0yum-hourly.cron  Dec 18 14:04:53 neteye4 run-parts(/etc/cron.hourly)[21763]: finished 0yum-hourly.cron  Dec 18 15:01:01 neteye4 run-parts(/etc/cron.hourly)[23121]: starting 0yum-hourly.cron  Dec 18 15:01:05 neteye4 run-parts(/etc/cron.hourly)[23137]: finished 0yum-hourly.cron

That’s all! From now on you will be notified about any available updates via email.

Giuseppe Di Garbo

Giuseppe Di Garbo

Consultant at Würth Phoenix
Hi everybody. I’m Giuseppe and I was born in Milan in 1979. Since the early years of university, I was attracted by the Open Source world and operating system GNU\Linux. After graduation I had the opportunity to participate in a project of a startup for the realization of an Internet Service Provider. Before joining Würth Phoenix as SI consultant, I gained great experience as an IT consultant on projects related to business continuity and implementation of open source software compliant to ITIL processes of incident, change and service catalog management. My free time is completely dedicated to my wife and, as soon as possible, run away from Milan and his caotic time and trekking discover our beautiful mountain near Lecco for relax and lookup the (clean) sky.

Author

Giuseppe Di Garbo

Hi everybody. I’m Giuseppe and I was born in Milan in 1979. Since the early years of university, I was attracted by the Open Source world and operating system GNU\Linux. After graduation I had the opportunity to participate in a project of a startup for the realization of an Internet Service Provider. Before joining Würth Phoenix as SI consultant, I gained great experience as an IT consultant on projects related to business continuity and implementation of open source software compliant to ITIL processes of incident, change and service catalog management. My free time is completely dedicated to my wife and, as soon as possible, run away from Milan and his caotic time and trekking discover our beautiful mountain near Lecco for relax and lookup the (clean) sky.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive