9.1 ndoutils安装
tar -zxvf ndoutils-1.4b9.tar.gz
cd ndoutils-1.4b9
./configure –prefix=/var/www/localhost/htdocs/nagios
--with-mysql-inc=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --enable-mysql --with-ndo2db-user=nagios --with-ndo2db-group=nagios
Make不需要make install
cd src/
cp ndomod-3x.o ndo2db-3x log2ndo file2sock /var/www/localhost/htdocs/nagios/bin
cd ../config
cp ndo2db.cfg-sample /var/www/localhost/htdocs/nagios/etc/ndo2db.cfg
cp ndomod.cfg-sample /var/www/localhost/htdocs/nagios/etc/ndomod.cfg
cd /var/www/localhost/htdocs/nagios/etc
vi ndo2db.cfg
socket_name=/var/www/localhost/htdocs/nagios/var/ndo.sock db_name=cactidb db_prefix=npc_ db_user=cactiuser db_pass=cactipass debug_level=1 debug_file=/var/www/localhost/htdocs /nagios/var/ndo2db.debug |
vi ndomod.cfg
output=/var/www/localhost/htdocs/nagios/var/ndo.sock buffer_file=/var/www/localhost/htdocs/nagios/var/ndomod.tmp |
9.2 开启ndo2db服务
Cd /var/www/localhost/htdocs/nagios/
Bin/nagios –d etc/nagios.cfg
Bin/ndo2db –c etc/ndo2db.cfg
9.3 NPC的安装
Tar zxvf npc-2.0.4.tar.gz –C /var/www/localhost/htdocs/cacti/plugins/
登录cacti管理界面
点击”Console”->”plugin Management”->安装并打开NPC界面,如下图
9.4 NPC配置
点击”console”->”settings”->”NPC”,配置nagios访问路径和nagiosNaNd路径
9.5 修改几个错误的按钮
Vi /var/www/htdoc/localhost/cacti/plugins/npc/ top_graph_header.php
第95行修改红色部分
<td id="gtabs" nowrap> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_settings.php"><img src="'. $config['url_path'] . 'p_w_picpaths/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=tree"><img src="<?php echo $config['url_path']; ?>p_w_picpaths/tab_mode_tree<?php if ($_REQUEST["action"] == "tree") { print "_down"; }?>.gif" border="0" title="Tree View" alt="Tree View"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=list"><img src="<?php echo $config['url_path']; ?>p_w_picpaths/tab_mode_list<?php if ($_REQUEST["action"] == "list") { print "_down"; }?>.gif" border="0" title="List View" alt="List View"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=preview"><img src="<?php echo $config['url_path']; ?>p_w_picpaths/tab_mode_preview<?php if ($_REQUEST["action"] == "preview") { print "_down"; }?>.gif" border="0" title="Preview View" alt="Preview View"></a><?php }?> <br> </td> |
修改为
<td id="gtabs" nowrap> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["graph_settings"] == "on")) { print '<a href="'. $config['url_path'] . 'graph_settings.php"><img src="'. $config['url_path'] . 'p_w_picpaths/tab_settings'; if (basename($_SERVER["PHP_SELF"]) == "graph_settings.php") { print "_down"; } print '.gif" border="0" alt="Settings"></a>';}?> <?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_tree"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=tree"><img src='p_w_picpaths/tab_mode_tree.gif' border="0" title="Tree View" alt="Tree View"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_list"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=list"><img src='p_w_picpaths/tab_mode_list.gif' border="0" title="List View" alt="List View"></a><?php }?><?php if ((!isset($_SESSION["sess_user_id"])) || ($current_user["show_preview"] == "on")) {?><a href="<?php echo $config['url_path']; ?>graph_view.php?action=preview"><img src='p_w_picpaths/tab_mode_preview.gif' border="0" title="Preview View" alt="Preview View"></a><?php }?> <br> </td>
|