Fix zabbix support for metrics and status per NIC

Restricting NICs to the same regexps exclusion list than LMA collector
Simplify deployment by putting everything into single template file
Disable puppet-lint check for 140 chars wide lines for the moment

Closes-Bug: #1522831

Change-Id: I863d7e556b2933727a7899b0e8c3619dbbaa0064
This commit is contained in:
Olivier Bourdon 2016-03-14 08:50:04 +01:00
parent 19228c54e4
commit b25ae621b1
5 changed files with 14 additions and 18 deletions

View File

@ -4,6 +4,7 @@ require 'puppet-syntax/tasks/puppet-syntax'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_class_parameter_defaults')
PuppetLint.configuration.send('disable_autoloader_layout')

View File

@ -1,2 +0,0 @@
INSERT INTO `regexps` (`regexpid`,`name`,`test_string`) values ('10','Block devices for discovery','vda');
INSERT INTO `expressions` (`expressionid`,`regexpid`,`expression`,`expression_type`,`exp_delimiter`,`case_sensitive`) values ('10','10','^(vd.|sd.)$','3',',','0');

View File

@ -1,2 +0,0 @@
INSERT INTO `regexps` (`regexpid`, `name`, `test_string`) VALUES (1,'File systems for discovery','ext3');
INSERT INTO `expressions` (`expressionid`,`regexpid`,`expression`,`expression_type`,`exp_delimiter`,`case_sensitive`) values ('1','1','^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|ntfs|fat32|zfs)$','3',',','0');

View File

@ -25,19 +25,9 @@ class plugin_zabbix::db::mysql(
mode => '0755',
}
file { '/tmp/zabbix/parts':
ensure => directory,
purge => true,
force => true,
recurse => true,
mode => '0755',
source => 'puppet:///modules/plugin_zabbix/sql',
require => File['/tmp/zabbix']
}
file { '/tmp/zabbix/parts/data_clean.sql':
file { '/tmp/zabbix/data_clean.sql':
ensure => present,
require => File['/tmp/zabbix/parts'],
require => File['/tmp/zabbix'],
content => template('plugin_zabbix/data_clean.erb'),
}
@ -50,10 +40,10 @@ class plugin_zabbix::db::mysql(
}
exec { 'prepare-schema-2':
command => 'cat /tmp/zabbix/parts/*.sql >> /tmp/zabbix/schema.sql',
command => 'cat /tmp/zabbix/data_clean.sql >> /tmp/zabbix/schema.sql',
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'],
refreshonly => true,
require => File['/tmp/zabbix/parts/data_clean.sql'],
require => File['/tmp/zabbix/data_clean.sql'],
}
exec{ "${plugin_zabbix::params::db_name}-import":

View File

@ -45,6 +45,15 @@ INSERT INTO `graph_theme` (`graphthemeid`, `description`, `theme`, `backgroundco
INSERT INTO `graph_theme` (`graphthemeid`, `description`, `theme`, `backgroundcolor`, `graphcolor`, `graphbordercolor`, `gridcolor`, `maingridcolor`, `gridbordercolor`, `textcolor`, `highlightcolor`, `leftpercentilecolor`, `rightpercentilecolor`, `nonworktimecolor`, `gridview`, `legendview`) VALUES (4,'Classic','classic','F0F0F0','FFFFFF','333333','CCCCCC','AAAAAA','000000','222222','AA4444','11CC11','CC1111','E0E0E0',1,1);
INSERT INTO `globalmacro` (`globalmacroid`, `macro`, `value`) VALUES (2,'{$SNMP_COMMUNITY}','public');
INSERT INTO `sysmaps` (`sysmapid`, `name`, `width`, `height`, `backgroundid`, `label_type`, `label_location`, `highlight`, `expandproblem`, `markelements`, `show_unack`, `grid_size`, `grid_show`, `grid_align`, `label_format`, `label_type_host`, `label_type_hostgroup`, `label_type_trigger`, `label_type_map`, `label_type_image`, `label_string_host`, `label_string_hostgroup`, `label_string_trigger`, `label_string_map`, `label_string_image`, `iconmapid`, `expand_macros`) VALUES (1,'Local network',680,200,NULL,0,0,1,1,1,0,50,1,1,0,2,2,2,2,2,'','','','','',NULL,1);
# Filesystems low level discovery
INSERT INTO `regexps` (`regexpid`, `name`, `test_string`) VALUES (1,'File systems for discovery','ext3');
INSERT INTO `expressions` (`expressionid`,`regexpid`,`expression`,`expression_type`,`exp_delimiter`,`case_sensitive`) values (1,1,'^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|ntfs|fat32|zfs)$',3,',',0);
# Network interfaces low level discovery
INSERT INTO `regexps` (`regexpid`, `name`, `test_string`) VALUES (2,'Network interfaces for discovery','eth0');
INSERT INTO `expressions` (`expressionid`,`regexpid`,`expression`,`expression_type`,`exp_delimiter`,`case_sensitive`) values (2,2,'^lo$',4,',',0),(3,2,'^[a-z0-9]+$',4,',',0);
# SNMP
INSERT INTO `regexps` (`regexpid`, `name`, `test_string`) VALUES (3,'Storage devices for SNMP discovery','/boot');
# Block devices low level discovery
INSERT INTO `regexps` (`regexpid`,`name`,`test_string`) values (4,'Block devices for discovery','vda');
INSERT INTO `expressions` (`expressionid`,`regexpid`,`expression`,`expression_type`,`exp_delimiter`,`case_sensitive`) values (4,4,'^(vd.|sd.)$',3,',',0);
COMMIT;