zabbix_export: version: '5.4' date: '2021-11-21T21:27:22Z' groups: - uuid: 7df96b18c230490a9a0a9e2307226338 name: Templates templates: - uuid: e580bdff250d42c89ed2f2387487df42 template: 'App Needrestart' name: 'App Needrestart' description: | ## Overview Template for needrestart to check if the server needs a reboot / restart of services after package upgrade. [www.kaneo-gmbh.de](https://www.kaneo-gmbh.de) ### Install packages ``` apt install needrestart ``` ### Zabbix agent user parameter: ``` UserParameter=needrestart.kernel,sudo needrestart -b -r l -k | grep 'NEEDRESTART-KSTA:' | grep -Eo '[0-9]' UserParameter=needrestart.libs,sudo needrestart -b -r l -l | grep NEEDRESTART-SVC | wc -l ``` ### sudoers entry: ``` # allow zabbix to check for needrestart in batch listing mode zabbix ALL = NOPASSWD: /usr/sbin/needrestart -b -r l * ``` ## Author kaneo GmbH groups: - name: Templates items: - uuid: 6673bbe8b6b34fcd9a3e17b36f48e94b name: 'Kernel ABI update available' key: needrestart.kernel delay: '14400' tags: - tag: Application value: Needrestart - uuid: 76614c13db8c4caa875dc9097e210260 name: 'Services using old libs' key: needrestart.libs delay: '14400' tags: - tag: Application value: Needrestart triggers: - uuid: 1ca6572d2dae44beb425c09efcfb32ba expression: 'last(/App Needrestart/needrestart.kernel)<>1 or last(/App Needrestart/needrestart.libs)>0' name: 'Server needs maintainance' priority: INFO