Wednesday, September 8th 2010, 2:37am UTC+2
You are not logged in.
Birthday: Feb 28th 1981 (29)
Gender: male
Location: koblenz
Occupation: admin
Number of Nagios server: ~
Nagios Versions: 3.02
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: viele
Number of services: viele
OS: ubuntu 8.04
Plugin Versions: letze veriosn
This post has been edited 1 times, last edit by "smueller" (Jul 21st 2010, 9:59am)
Birthday: May 30th 1983 (27)
Gender: male
Location: Wien
Occupation: DNS Developer / Monitoring-Admin
Number of Nagios server: 3
Nagios Versions: 3.0.3
Icinga-Version(en): 1.0.3 / GIT
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: 100-200
Number of services: 1000-2000
OS: RHEL 5.5 x64
Plugin Versions: 1.4.14
NDO Version: 1.4b7 Oracle
IDO-Version: 1.0.3 / GIT MySQL/Postgresql/Oracle
Birthday: Feb 28th 1981 (29)
Gender: male
Location: koblenz
Occupation: admin
Number of Nagios server: ~
Nagios Versions: 3.02
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: viele
Number of services: viele
OS: ubuntu 8.04
Plugin Versions: letze veriosn
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
SELECT count(DISTINCT UPPER(CONCAT(no.name1,';', no.name2))) FROM nagios_objects no, nagios_servicestatus nss WHERE no.object_id = nss.service_object_id AND no.name1 NOT LIKE '_Module_%' AND no.name1 IN (SELECT no.name1 FROM nagios_hostgroup_members hm, nagios_objects no WHERE no.object_id = hm.host_object_id AND hm.hostgroup_id IN (SELECT hostgroup_id FROM nagios_hostgroups WHERE alias LIKE 'Tolle Hostgroup')); |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
+----+--------------------+-------------------+-----------------+-----------------------+-------------+---------+------------------------------+-------+--------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+-------------------+-----------------+-----------------------+-------------+---------+------------------------------+-------+--------------------------+ | 1 | PRIMARY | nss | index | object_id | object_id | 4 | NULL | 19843 | Using index | | 1 | PRIMARY | no | eq_ref | PRIMARY | PRIMARY | 4 | db_ndo.nss.service_object_id | 1 | Using where | | 2 | DEPENDENT SUBQUERY | hm | index | NULL | instance_id | 8 | NULL | 2970 | Using where; Using index | | 2 | DEPENDENT SUBQUERY | no | eq_ref | PRIMARY | PRIMARY | 4 | db_ndo.hm.host_object_id | 1 | Using where | | 3 | DEPENDENT SUBQUERY | nagios_hostgroups | unique_subquery | PRIMARY,alias_2,alias | PRIMARY | 4 | func | 1 | Using where | +----+--------------------+-------------------+-----------------+-----------------------+-------------+---------+------------------------------+-------+--------------------------+ 5 rows in set (0.00 sec) |
Birthday: May 30th 1983 (27)
Gender: male
Location: Wien
Occupation: DNS Developer / Monitoring-Admin
Number of Nagios server: 3
Nagios Versions: 3.0.3
Icinga-Version(en): 1.0.3 / GIT
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: 100-200
Number of services: 1000-2000
OS: RHEL 5.5 x64
Plugin Versions: 1.4.14
NDO Version: 1.4b7 Oracle
IDO-Version: 1.0.3 / GIT MySQL/Postgresql/Oracle
Birthday: Feb 28th 1981 (29)
Gender: male
Location: koblenz
Occupation: admin
Number of Nagios server: ~
Nagios Versions: 3.02
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: viele
Number of services: viele
OS: ubuntu 8.04
Plugin Versions: letze veriosn
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
+----+--------------------+-------------------+-----------------+-----------------------+----------------+---------+---------------------+-------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+-------------------+-----------------+-----------------------+----------------+---------+---------------------+-------+-------------+ | 1 | PRIMARY | no | ALL | PRIMARY,objecttype_id | NULL | NULL | NULL | 16460 | Using where | | 1 | PRIMARY | nss | eq_ref | object_id | object_id | 4 | db_ndo.no.object_id | 1 | Using index | | 2 | DEPENDENT SUBQUERY | no | ref | PRIMARY,names | names | 130 | func | 11 | Using where | | 2 | DEPENDENT SUBQUERY | hm | ref | host_object_id | host_object_id | 4 | db_ndo.no.object_id | 2 | Using where | | 3 | DEPENDENT SUBQUERY | nagios_hostgroups | unique_subquery | PRIMARY,alias_2,alias | PRIMARY | 4 | func | 1 | Using where | +----+--------------------+-------------------+-----------------+-----------------------+----------------+---------+---------------------+-------+-------------+ 5 rows in set (3.59 sec) |
Birthday: Nov 11th 1979 (30)
Gender: female
Location: KL
Occupation: B.Sc. Informatik schimpft sich das, heißt aber auch nix weiter, als prämierter IT-Futzi in weiblicher Form (weiß jemand, wie das dann heißt?)
Number of Nagios server: 3
Nagios Versions: 3.0.3
Distributed monitoring: Nein
Redundant monitoring: Ja
Number of hosts: ~1043
Number of services: ~3368
OS: SuSE 10.1/SLES 10
Plugin Versions: diverse
NagVis Version: 1.1
NDO Version: 1.4b7
Other Addons: Eigene und Centreon 2.x , NTOP, SPLUNK, syslog-php, BASE, ...
Birthday: May 30th 1983 (27)
Gender: male
Location: Wien
Occupation: DNS Developer / Monitoring-Admin
Number of Nagios server: 3
Nagios Versions: 3.0.3
Icinga-Version(en): 1.0.3 / GIT
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: 100-200
Number of services: 1000-2000
OS: RHEL 5.5 x64
Plugin Versions: 1.4.14
NDO Version: 1.4b7 Oracle
IDO-Version: 1.0.3 / GIT MySQL/Postgresql/Oracle
INDEX auf nagios_objects.name1 und nagios_objects.name2 gesetzt (seltsamerweise funktioniert der nur gut, wenn man den index von (obecttype,name1 und name2) löscht und nacher wieder einführt.
|
|
Source code |
1 |
KEY `objecttype_id` (`objecttype_id`,`name1`,`name2`) |
|
|
Source code |
1 2 3 4 |
CREATE INDEX objects_objtype_id_idx ON icinga_objects(objecttype_id); CREATE INDEX objects_name1_idx ON icinga_objects(name1); CREATE INDEX objects_name2_idx ON icinga_objects(name2); CREATE INDEX objects_inst_id_idx ON icinga_objects(instance_id); |
|
|
Source code |
1 2 3 4 |
KEY `objects_objtype_id_idx` (`objecttype_id`), KEY `objects_name1_idx` (`name1`), KEY `objects_name2_idx` (`name2`), KEY `objects_inst_id_idx` (`instance_id`) |
und führt zu ner ausführungzeit von 25sekunde (gegeüber vorher 3,5Minuten)
ist vorallem nur der count der so abartig, wenn der durch ist passiert danach nix schlimmes(zeitaufwendiges mehr),
Birthday: Feb 28th 1981 (29)
Gender: male
Location: koblenz
Occupation: admin
Number of Nagios server: ~
Nagios Versions: 3.02
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: viele
Number of services: viele
OS: ubuntu 8.04
Plugin Versions: letze veriosn
Birthday: Jan 29th 1966 (44)
Gender: male
Location: Löffingen
Occupation: Datentechniker
Number of Nagios server: 3
Hobbies: fahrrad fahren, schwimmen, wandern, Open Source Software
Nagios Versions: 3.2.1
Distributed monitoring: Ja
Redundant monitoring: Nein
Number of hosts: 245
Number of services: 2312
OS: Linux (REDHAT 5.5), Windows
Plugin Versions: 1.4.14
NagVis Version: 1.5.1
NDO Version: 1.4b9
Other Addons: snmptt, centreon 2.1.8, mklivestatus
hmm besten dank für die tipps,
hab mich gestern ma n bisl durch "explain EXPLAIN" und n bisl durch indize gelesen.
und eineteilweise lösug gefunden:
INDEX auf nagios_objects.name1 und nagios_objects.name2 gesetzt (seltsamerweise funktioniert der nur gut, wenn man den index von (obecttype,name1 und name2) löscht und nacher wieder einführt.
senkt die Anzahl der ubqierie zeilen ziemlich:
und führt zu ner ausführungzeit von 25sekunde (gegeüber vorher 3,5Minuten)
Birthday: Feb 28th 1981 (29)
Gender: male
Location: koblenz
Occupation: admin
Number of Nagios server: ~
Nagios Versions: 3.02
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: viele
Number of services: viele
OS: ubuntu 8.04
Plugin Versions: letze veriosn
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
CREATE TABLE IF NOT EXISTS `nagios_objects` ( `object_id` int(11) NOT NULL auto_increment, `instance_id` smallint(6) NOT NULL default '0', `objecttype_id` smallint(6) NOT NULL default '0', `name1` varchar(128) NOT NULL default '', `name2` varchar(128) default NULL, `is_active` smallint(6) NOT NULL default '0', PRIMARY KEY (`object_id`), KEY `objecttype_id` (`objecttype_id`,`name1`,`name2`), KEY `object_id` (`object_id`,`name1`,`is_active`) ) ENGINE=InnoDB |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 |
CREATE TABLE IF NOT EXISTS `nagios_objects` ( `object_id` int(11) NOT NULL auto_increment, `instance_id` smallint(6) NOT NULL default '0', `objecttype_id` smallint(6) NOT NULL default '0', `name1` varchar(128) NOT NULL default '', `name2` varchar(128) default NULL, `is_active` smallint(6) NOT NULL default '0', PRIMARY KEY (`object_id`), KEY `names` (`name1`,`name2`), KEY `objecttype_id` (`objecttype_id`,`name1`,`name2`), KEY `object_id` (`object_id`,`name1`,`is_active`) ) ENGINE=InnoDB |