l0f...@tuta.io wrote:
> Hi,
> 
> 7 juil. 2020 à 09:23 de v...@sibptus.ru:
> 
> > After reading your replies and the Debian security advisories, I made up
> > my mind that I probably just want to now if new versions of packages are
> > available in the repos. Perhaps it's the best thing I can do about
> > vulnerabilities. 
> >
> > So I wrote the following UserParameter for the Zabbix agent, and I think
> > I've found it useful already:
> >
> > # Number of upgradable packages
> > UserParameter=packages.upgradeable,if [ -x /usr/bin/apt-get ] ; then 
> > /usr/bin/apt-get upgrade -s | grep -c '^Inst' ; elif [ -x /usr/bin/yum ] ; 
> > then /usr/bin/yum check-update | grep -c 'updates$'; else echo "1" ; fi
> >
> > It does not require any extra utilities to estimate the number of
> > upgradeable packages.
> >
> Regarding APT, don't forget first to do:
> apt update
> ...otherwise you won't get so many upgrades available ;)

This already happens automatically, from apt.systemd.daily I think.

> Why not just counting results of:
> apt list --upgradable
> or
> apt list --upgradeable
> ?

"WARNING: apt does not have a stable CLI interface. Use with caution in 
scripts."

So I chose to exercise caution.

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

Attachment: signature.asc
Description: PGP signature

Reply via email to