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

tags/smeserver-zabbix-agent-0.4.5-1
Daniel Berteaud 4 years ago
parent 4cd1050cfc
commit e9f44d8d03
  1. 2
      createlinks
  2. 13
      root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf.d/block_devices.conf/10All

@ -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");

@ -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
}
}
Loading…
Cancel
Save