Install Weathermap
cd /tmp
wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip
unzip php-weathermap-0.97a.zip
mv weathermap /usr/local
cd /usr/local/weathermap/
chown -R apache:apache *
chmod u+w ./configs
mv editor-config.php-dist editor-config.php
cd /etc/httpd/conf.d/
vi weathermap.conf
# php-weathermap-0.9
# PHP-WEATHERMAP : A php writen network weathermap graphing tool
#
Alias /weathermap “/usr/local/weathermap”
<Directory “/usr/local/weathermap”>
#Order Deny,Allow Deny from all
# Allow from (ip address allowed) (take care, you must remove # to make this line readable)
Allow from 127.0.0.1
</Directory>
Install Centreon Weathermap Module
I downloaded the SVN version of Centreon Weathermap on another server because I don not want to install subversion and all the dependancies on my centreon server.
yum install subvervsion dos2unix
svn co http://svn.modules.centreon.com/centreon-weathermap/trunk/www/modules/
cd modules
scp -R php-weathermap root@centreon:/usr/local/centreon/www/modules/
chmod 755 /usr/local/centreon/www/modules/php-weathermap/configuration/editor/weathermap
chmod 775 -R /usr/local/centreon/www/modules/php-weathermap/views/renderer
chmod 775 -R /usr/local/centreon/www/modules/php-weathermap/configuration/editor/configs/
chown -R nagios:nagios /usr/local/centreon/www/modules/php-weathermap/
find . -type f -exec dos2unix {} \;
fgrep -r CENTREON_ETC .
find . -name '*.php*' -print0 | xargs -0 perl -pi -e 's/\@CENTREON_ETC\@/\/etc\/centreon/g'
fgrep -r PHP_BIN .
find . -name '*' -print0 | xargs -0 perl -pi -e 's/\@PHP_BIN\@/\/usr\/bin\/php/g'
fgrep -r BIN_RRDTOOL .
find . -name '
*
' -print0 | xargs -0 perl -pi -e 's/\@BIN_RRDTOOL\@/\/usr\/bin\/rrdtool/g'
Goto the Centreon web frontend.
Administration -> Modules php-weathermap -> Actions : Install Module Install Module
Views -> PHP-Weathermap -> PWM Editor : Configuration
Create A New Map as a copy of an existing map : test -> Create
Add node: click on the node : change the host and the label (i.e. create a server)
Add node: click on the node : change the host and the label (i.e. create a switch)
Add Link: click on Add a Link : change Traffic service and the Maximum Bandwidth
Views -> PHP-Weathermap -> PWM Editor : Generate Views -> PHP-Weathermap -> Images : List
Which RRD file is used by a service
# mysql -uroot -p centstorage
mysql> SELECT id FROM index_data WHERE host_name = "router01" AND service_description = "Network Usage Internet";
+----+
| id |
+----+
| 74 |
+----+
1 row in set (0.00 sec)
mysql>
select * from metrics where index_id = '74' +-----------+----------+--------------+------------------+-----------+------+------+--------+------+------+--------+ | metric_id | index_id | metric_name | data_source_type | unit_name | warn | crit | hidden | min | max | locked | +-----------+----------+--------------+------------------+-----------+------+------+--------+------+------+--------+ | 195 | 74 | inAbsolut | 0 | | 0 | 0 | 1 | 0 | 0 | NULL | | 193 | 74 | inBandwidth | 0 | KBs | 0 | 0 | 0 | 0 | 0 | NULL | | 191 | 74 | inUsage | 0 | % | 85 | 98 | 0 | 0 | 0 | NULL | | 196 | 74 | outAbsolut | 0 | | 0 | 0 | 1 | 0 | 0 | NULL | | 194 | 74 | outBandwidth | 0 | KBs | 0 | 0 | 0 | 0 | 0 | NULL | | 192 | 74 | outUsage | 0 | % | 85 | 98 | 0 | 0 | 0 | NULL | +-----------+----------+--------------+------------------+-----------+------+------+--------+------+------+--------+ 6 rows in set (0.00 sec)
Leave a Reply