Ad Widget

Collapse

monitor kernel updates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andrej553
    Junior Member
    • Jun 2022
    • 2

    #1

    monitor kernel updates

    Greetings,

    i am new to zabbix. So far i really like it.
    I installed a new Zabbix Server and added some hosts via agent or snmp.

    Now i try to get some more data that aren't in the pre delivered templates.
    In particular i search a convenient way to report the running Linux kernel and if there is an kernel update available.
    Kind of the same would be nice for windows server.


    I was not able to find a related thread via search. Neither was i able to find a current discussion on google (only one that is 11 years old). At least regarding the linux part.
    For windows i found a script+template on github but i did not try it yet in hope to find a more built in solution.

    Can you help me in that regard?
  • Andrej553
    Junior Member
    • Jun 2022
    • 2

    #2
    Found some help via discord.
    I solved my problem with this little script:
    #!/bin/bash -x

    # Get current kernel version and the new version if there is one available
    kernelVersion=$(uname -a)
    checkIfKernelUpdateAvailable=$(dnf check-update | grep -i kernel)

    # Use zabbix sender to send send those informations to our zabbix server at ZabbixServerIP
    # Prior to do that we have to create a host and two custom items "zabbix trapper" with the corresponding key (like trap.KernelVersion)
    zabbix_sender -z ZabbixServerIP -s Hostname -k trap.KernelVersion -o "$kernelVersion"
    zabbix_sender -z ZabbixServerIP -s Hostname -k trap.KernelUpdate -o "$checkIfKernelUpdateAvailable"

    Comment

    Working...