This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
docpublic:reseaux:services:monitcacti [2015/03/29 09:27] procacci@tem-tsp.eu [DB mariaDB] |
docpublic:reseaux:services:monitcacti [2019/03/11 21:53] (current) procacci@tem-tsp.eu [postfix template for cacti] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== supervision cacti ====== | ====== supervision cacti ====== | ||
| + | |||
| + | ===== references ===== | ||
| + | |||
| + | ==== debug ==== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| ===== base systeme ===== | ===== base systeme ===== | ||
| Line 138: | Line 145: | ||
| Query OK, 0 rows affected (0.04 sec) | Query OK, 0 rows affected (0.04 sec) | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== import initial DB structure ==== | ||
| + | |||
| + | if not recovering an aold instance, create new one | ||
| + | |||
| + | < | ||
| + | # mysql -u usercacti -p -h localhost cacti_bd < / | ||
| + | Enter password: | ||
| + | </ | ||
| + | ===== installation cacti 8.8c ===== | ||
| + | |||
| + | < | ||
| + | [root@monitor ~]# wget http:// | ||
| + | |||
| + | [root@monitor html]# tar xvfz / | ||
| + | [root@monitor html]# ln -s cacti-0.8.8c/ | ||
| + | [root@monitor html]# ls -l | ||
| + | total 4 | ||
| + | lrwxrwxrwx. | ||
| + | drwxr-xr-x. 13 1000 users 4096 23 nov. 21:18 cacti-0.8.8c | ||
| + | |||
| + | [root@monitor html]# adduser cacti | ||
| + | [root@monitor html]# cd / | ||
| + | [root@monitor cacti]# chown -R cacti.apache rra log | ||
| + | [root@monitor cacti]# chmod 775 rra log | ||
| + | |||
| + | [root@monitor cacti]# vim ./ | ||
| + | </ | ||
| + | |||
| + | ==== cacti cron job ==== | ||
| + | |||
| + | beware to set full path name to **/ | ||
| + | |||
| + | < | ||
| + | # cat / | ||
| + | */5 * * * * cacti / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== upgrade-recover data from old cacti ===== | ||
| + | |||
| + | * http:// | ||
| + | |||
| + | < | ||
| + | [root@monitor cacti]# | ||
| + | Enter password: | ||
| + | </ | ||
| + | |||
| + | ==== copy rrd files ==== | ||
| + | |||
| + | 6 . Copy the *.rrd files from the old Cacti directory. | ||
| + | |||
| + | < | ||
| + | [root@monitor cacti]# cp -v -u / | ||
| + | « / | ||
| + | « / | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== copy-recover ressources ==== | ||
| + | |||
| + | < | ||
| + | [root@monit cacti]# cp -v -u -R / | ||
| + | « / | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ==== run web update URL ==== | ||
| + | |||
| + | go run install-update to your server http:// | ||
| + | |||
| + | < | ||
| + | Cacti Installation Guide | ||
| + | |||
| + | Upgrade results: | ||
| + | |||
| + | 0.8.7g -> 0.8.7h | ||
| + | |||
| + | [Success] ALTER TABLE host_snmp_cache ADD COLUMN present tinyint NOT NULL DEFAULT ' | ||
| + | |||
| + | [Success] ALTER TABLE host_snmp_cache ADD INDEX present (present) | ||
| + | |||
| + | [Success] ALTER TABLE poller_item ADD COLUMN present tinyint NOT NULL DEFAULT ' | ||
| + | |||
| + | [Success] ALTER TABLE poller_item ADD INDEX present (present) | ||
| + | |||
| + | [Success] ALTER TABLE poller_reindex ADD COLUMN present tinyint NOT NULL DEFAULT ' | ||
| + | |||
| + | [Success] ALTER TABLE poller_reindex ADD INDEX present (present) | ||
| + | |||
| + | [Success] ALTER TABLE host ADD COLUMN device_threads tinyint(2) unsigned NOT NULL DEFAULT ' | ||
| + | |||
| + | [Success] ALTER TABLE `data_template_rrd` ADD UNIQUE INDEX `duplicate_dsname_contraint` (`local_data_id`, | ||
| + | |||
| + | 0.8.7i -> 0.8.8 | ||
| + | |||
| + | [Success] ALTER TABLE `poller_item` MODIFY COLUMN `host_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT ' | ||
| + | |||
| + | [Success] ALTER TABLE `poller_output` DROP PRIMARY KEY | ||
| + | |||
| + | [Success] ALTER TABLE `poller_output` ADD PRIMARY KEY (`local_data_id`, | ||
| + | |||
| + | [Success] ALTER TABLE `user_log` ADD KEY `user_id` (`user_id`) | ||
| + | |||
| + | [Success] CREATE TABLE IF NOT EXISTS `plugin_config` ( | ||
| + | `id` int(8) unsigned NOT NULL auto_increment, | ||
| + | `directory` varchar(32) NOT NULL default '', | ||
| + | `name` varchar(64) NOT NULL default '', | ||
| + | `status` tinyint(2) NOT NULL default 0, | ||
| + | `author` varchar(64) NOT NULL default '', | ||
| + | `webpage` varchar(255) NOT NULL default '', | ||
| + | `version` varchar(8) NOT NULL default '', | ||
| + | PRIMARY KEY (`id`), | ||
| + | KEY `status` (`status`), | ||
| + | KEY `directory` (`directory`) | ||
| + | ) ENGINE=MyISAM COMMENT=' | ||
| + | |||
| + | [Success] CREATE TABLE IF NOT EXISTS `plugin_db_changes` ( | ||
| + | `id` int(10) unsigned NOT NULL auto_increment, | ||
| + | `plugin` varchar(16) NOT NULL default '', | ||
| + | `table` varchar(64) NOT NULL default '', | ||
| + | `column` varchar(64) NOT NULL default '', | ||
| + | `method` varchar(16) NOT NULL default '', | ||
| + | PRIMARY KEY (`id`), | ||
| + | KEY `plugin` (`plugin`), | ||
| + | KEY `method` (`method`) | ||
| + | ) ENGINE=MyISAM COMMENT=' | ||
| + | |||
| + | [Success] CREATE TABLE IF NOT EXISTS `plugin_hooks` ( | ||
| + | `id` int(8) unsigned NOT NULL auto_increment, | ||
| + | `name` varchar(32) NOT NULL default '', | ||
| + | `hook` varchar(64) NOT NULL default '', | ||
| + | `file` varchar(255) NOT NULL default '', | ||
| + | `function` varchar(128) NOT NULL default '', | ||
| + | `status` int(8) NOT NULL default 0, | ||
| + | PRIMARY KEY (`id`), | ||
| + | KEY `hook` (`hook`), | ||
| + | KEY `status` (`status`) | ||
| + | ) ENGINE=MyISAM COMMENT=' | ||
| + | |||
| + | [Success] CREATE TABLE IF NOT EXISTS `plugin_realms` ( | ||
| + | `id` int(8) unsigned NOT NULL auto_increment, | ||
| + | `plugin` varchar(32) NOT NULL default '', | ||
| + | `file` text NOT NULL, | ||
| + | `display` varchar(64) NOT NULL default '', | ||
| + | PRIMARY KEY (`id`), | ||
| + | KEY `plugin` (`plugin`) | ||
| + | ) ENGINE=MyISAM COMMENT=' | ||
| + | |||
| + | [Success] REPLACE INTO `plugin_realms` VALUES (1, ' | ||
| + | |||
| + | [Success] REPLACE INTO `plugin_hooks` VALUES (1, ' | ||
| + | |||
| + | [Success] REPLACE INTO `plugin_hooks` VALUES (2, ' | ||
| + | |||
| + | [Success] REPLACE INTO user_auth_realm VALUES (101,1) | ||
| + | |||
| + | [Success] ALTER TABLE `data_template_data` ADD KEY `data_input_id` (`data_input_id`) | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== optimize run with spine ===== | ||
| + | |||
| + | < | ||
| + | [root@monitor ~]# cat / | ||
| + | */5 * * * * | ||
| + | |||
| + | [root@monitor ~]# chown apache.cacti / | ||
| + | |||
| + | [root@monitor ~]# wget http:// | ||
| + | |||
| + | [root@monitor ~]# tar xvfz cacti-spine-0.8.8c.tar.gz | ||
| + | [root@monitor ~]# cd cacti-spine-0.8.8c/ | ||
| + | [root@monitor cacti-spine-0.8.8c]# | ||
| + | [root@monitor cacti-spine-0.8.8c]# | ||
| + | [root@monitor cacti-spine-0.8.8c]# | ||
| + | [root@monitor cacti-spine-0.8.8c]# | ||
| + | make[1] : on entre dans le répertoire « / | ||
| + | / | ||
| + | /bin/sh ./ | ||
| + | libtool: install: / | ||
| + | / | ||
| + | / | ||
| + | make[1] : on quitte le répertoire « / | ||
| + | </ | ||
| + | |||
| + | ==== debug spine poller ==== | ||
| + | |||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | parfois un script a un pb de droit de fichier tmp dans /tmp apres debug en root , cela marche en shell root mais pas via spine / apache . | ||
| + | |||
| + | < | ||
| + | [cacti@mon ~]$ / | ||
| + | Could not open cache / | ||
| + | [cacti@mon ~]$ exit | ||
| + | déconnexion | ||
| + | [root@mon include]# ls -l / | ||
| + | -rw-r--r-- 1 root root 2045 18 avril 21:18 / | ||
| + | [root@monit include]# chown apache: | ||
| + | </ | ||
| + | |||
| + | |||
| ===== cacti 8.8c ===== | ===== cacti 8.8c ===== | ||
| Line 227: | Line 446: | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ===== postfix template for cacti ===== | ||
| + | |||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | recopies depuis smtpO vers smtpF | ||
| + | |||
| + | < | ||
| + | [root@smtpO ~]# scp / | ||
| + | |||
| + | |||
| + | [root@smtpO ~]# scp -r / | ||
| + | spamd.pm | ||
| + | postfix-stats-local | ||
| + | |||
| + | |||
| + | [root@smtpO ~]# scp / | ||
| + | local-snmp | ||
| + | |||
| + | [root@smtpO ~]# scp -r / | ||
| + | postfix.pm | ||
| + | |||
| + | [root@smtpO ~]# scp / | ||
| + | uloganalyser | ||
| + | |||
| + | </ | ||
| + | |||
| + | sur la destination | ||
| + | |||
| + | < | ||
| + | [root@smtpF ~]# mkdir / | ||
| + | </ | ||
| + | |||
| + | puis apres 5-10 mn , le cron a joué son role et les stats pour cacti sont là : | ||
| + | |||
| + | < | ||
| + | [root@smtpF ~]# cat / | ||
| + | lastrun=1552322401 | ||
| + | lastline=16519 | ||
| + | lastposition=2213301 | ||
| + | repeatline=Mar 11 17:39:54 smtp4 postfix/ | ||
| + | lastinode=344479 | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | postfix: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ajouter les extend a snmpd.conf | ||
| + | |||
| + | < | ||
| + | ## # | ||
| + | ## # # | ||
| + | # | ||
| + | extend postfixlocal | ||
| + | extend postfixlmtp | ||
| + | extend postfixpickup / | ||
| + | extend postfixqueue / | ||
| + | extend postfixsmtp | ||
| + | extend postfixsmtpstatus | ||
| + | extend postfixsmtptls | ||
| + | extend postfixsmtpwarn | ||
| + | extend postfixsmtpd | ||
| + | extend postfixsmtpdnq | ||
| + | extend postfixsmtpdnqrec | ||
| + | extend postfixsmtpdnqrel | ||
| + | extend postfixsmtpdnqsnd | ||
| + | extend postfixsmtpdnqclnt | ||
| + | extend postfixsmtpdqd | ||
| + | extend postfixsmtpdtls | ||
| + | extend postfixsmtpdwarn / | ||
| + | extend postfixcleanup | ||
| + | extend postfixpolicy / | ||
| + | extend postfixip / | ||
| + | extend clamav / | ||
| + | extend dkim / | ||
| + | extend spamd / | ||
| + | </ | ||