Hallo.
I would like to check last linux update date.
I see, on our linux hosts, the file /var/log/apt/history.log
that stores last date.
How could I check it inside icinga to have a service that checks last date?
Thanks a lot
Mario
Hallo.
I would like to check last linux update date.
I see, on our linux hosts, the file /var/log/apt/history.log
that stores last date.
How could I check it inside icinga to have a service that checks last date?
Thanks a lot
Mario
Hi,
you can use the apt
check plugin which is provided by the Monitoring Plugins package. A template for the apt
check plugin is integrated into the Icinga Template Library.
Best regards
Michael
Thanks a lot
But check_apt doesn’t return the last date, it is only to execute apt-get update etc.
I need to check the date when last update was executed (as last Windows Update date)
Thanks
Mario
I’ve written an appropriate plugin since I couldn’t find one in the internet. Unfortunately, I still haven’t been able to find a person/department/process that allows me to make it public available. However, it is not that difficult and you’ll find many hints about getting desired information here.
Hi,
I think for this specific use case there is no ready to use plugin out there. You have to write one yourself, but this should be straightforward.
Create a Bash script that greps the file /var/log/apt/history.log
for the last End-Date
entry. For example:
cat /var/log/apt/history.log | grep 'End-Date' | tail -1
Now you have the end date and can do what ever you want with it in your check plugin i.e. calcuate the days since the last update.
@rsx You are referring to Windows Update I think his question is related to the Linux apt
packaging tool. Nonetheless a good link for information about Windows Update.
Best regards
Michael
Thanks, a lot!
Yes, I nees to use for linux, I already made the Windows check.
A question, which plugin could I use to calcuate the days since the last update ?
@mcktr: You are right. I was referring to:
/var/log/apt/history.log
does not only contain updates. Hence, when someone have installed a new package, the last End-Date
refers to that installation date.
Hi.
The question is, which updates you want to check?
Edit: A quick google-search offered external link: this script. It reports the last updates and the number of overall updated packages.
A quick test worked. But since it is not a monitoring-script, it would require some adjustments. Maybe it is a good starting point.
Greetings
Any update
The command: cat /var/log/apt/history.log | grep ‘End-Date’ | tail -1 is good, I have to understand how to use in Icinga on remote host
Hallo
I created bash script, to check last update.
After, I will call it by check_by_ssh
The script, if could be useful.
check_linux_lastupd.txt (3.4 KB)
I know, this is a quite old topic, but it was mentioned in the last icinga newsletter…
We use the deb and rpm lastactivity plugins from Linuxfabrik for that.
deb: deb-lastactivity - Linuxfabrik GitHub
rpm: rpm-lastactivity - Linuxfabrik GitHub
Thanks a lot Luca.
Btw, plugin seems to work only locally, so, do I need to install in every linux host to check?
Thanks
Mario
Yes, this is the case with most check plugins.