Detect if running >= 4.4, and remove vfs.dev.discovery UserParameter in this case

This commit is contained in:
Daniel Berteaud 2019-11-27 09:45:47 +01:00
parent 4cd1050cfc
commit e9f44d8d03
2 changed files with 14 additions and 1 deletions

View File

@ -7,7 +7,7 @@ foreach my $conf (qw!zabbix_agentd.conf zabbix_agentd.conf.d/asterisk.conf
zabbix_agentd.conf.d/deprecated_cpunum.conf zabbix_agentd.conf.d/deprecated_memory.conf
zabbix_agentd.conf.d/deprecated_netstat.conf zabbix_agentd.conf.d/deprecated_swap.conf
zabbix_agentd.conf.d/extip.conf zabbix_agentd.conf.d/mail.conf zabbix_agentd.conf.d/mysql.conf
zabbix_agentd.conf.d/phpki_certs.conf zabbix_agentd.conf.d/samba.conf!){
zabbix_agentd.conf.d/phpki_certs.conf zabbix_agentd.conf.d/samba.conf zabbix_agentd.conf.d/block_devices.conf!){
templates2events("/etc/zabbix/$conf", qw(zabbix-agent-update bootstrap-console-save));
}
templates2events("/etc/sudoers", "zabbix-agent-update");

View File

@ -0,0 +1,13 @@
{
$OUT = '';
qx(zabbix_agentd -t vfs.dev.discovery -c /dev/null | grep -q ZBX_NOTSUPPORTED);
if ($? != 0){
$OUT .= '# vfs.dev.discovery is natively supported, not UserParameter needed';
} else{
$OUT .=<<'_EOF';
# Discover block devices
UserParameter=vfs.dev.discovery,/var/lib/zabbix/bin/disco_block_devices
_EOF
}
}