Ad Widget

Collapse

Monitor updates on Gentoo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acalvo
    Member
    • Oct 2010
    • 30

    #1

    Monitor updates on Gentoo

    Having Zabbix to warn you when a server needs to be updated is a must-have for any sysadmin.

    So, here's what I've come with:

    Code:
    UserParameter=gentoo.security,glsa-check -t all 2>/dev/null | wc -l
    UserParameter=gentoo.updates,emerge -tpvuD system | grep ebuild|wc -l
    UserParameter=gentoo.portage,emerge --info| grep 'Timestamp of tree' | sed -e s/'Timestamp of tree':// -e 's/\n//' | xargs -I {} date --date={} +%s
    UserParameter=gentoo.config,find /etc/ -name '._cfg*' 2>/dev/null|wc -l
    Thanks to: http://en.gentoo-wiki.com/wiki/Zabbix
    (and some people in this forum!)
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    As I noted in another post you might want to put these into a cron job and push to the Zabbix server using zabbix_sender. If the download takes a while then the check will timeout and you won't have your data. You could write a trigger which checks to see if you don't have data for that value for a period double what your check interval is.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • acalvo
      Member
      • Oct 2010
      • 30

      #3
      Originally posted by nelsonab
      As I noted in another post you might want to put these into a cron job and push to the Zabbix server using zabbix_sender. If the download takes a while then the check will timeout and you won't have your data. You could write a trigger which checks to see if you don't have data for that value for a period double what your check interval is.
      This is right for Red Hat or CentOS.
      However, Gentoo uses an specific command to update it's local repository, so now download takes place during the invocation of the remote command.

      Comment

      Working...