资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Nagios安装配置教程(六)nagiosql的安装-创新互联

Nagios安装配置教程(六)nagiosql的安装

创新互联专注于中大型企业的网站设计制作、成都做网站和网站改版、网站营销服务,追求商业策划与数据分析、创意艺术与技术开发的融合,累计客户数千家,服务满意度达97%。帮助广大客户顺利对接上互联网浪潮,准确优选出符合自己需要的互联网运用,我们将一直专注成都品牌网站建设和互联网程序开发,在前进的路上,与客户一起成长!

  Nagios的监控配置信息都存放于文件中,配置和修改都需要手工编辑文件,十分不便,尤其当监控的内容增多时,问题就更加明显。NagiosQL是一个基于Web方式的Nagios配置管理工具,它使用PHP语言开发,可运行在Apache下,后台使用Mysql数据库。提供了可视化的配置环境(基于Web方式),可以在web页面里添加主机、服务、主机组、服务组、命令、通知组。。。。。等等;重要的,NagiosQL也是一个开源软件。

安装PEAR Module: HTML_Template_IT 1.1

        安装以下项目前,请确保安装 php-pear 安装命令yum install php-pear

        通过 pear install HTML_Template_IT 命令进行安装

        如果出现无法找到HTML_Template_IT包的现象

        到PEAR 官网下载最新的HTML_Template_IT包 http://pear.php.net/package/PEAR 放到如下目录:/usr/share/pear/PEAR/PackageFile/

        cp /root/shared/HTML_Template_IT-1.3.0.gz /usr/share/pear/PEAR/PackageFile/

        再次运行以下命令 安装成功

        pear install HTML_Template_IT-1.3.0.gz

安装php 的 SSH2扩展

        1.用rpm -qa openssl 、rpm -qa openssl-devel命令 查看是否安装openssl openssl-devel 两个

        2.编译安装libssh3

          cd /usr/local/soft/

          wget http://www.libssh3.org/download/libssh3-1.2.9.tar.gz

          tar zxvf libssh3-1.2.9.tar.gz

          cd libssh3-1.2.9

          ./configure

          make

          make install

        3.编译安装ssh3(官网http://www.php.net/ssh3)

          安装前请确保安装php-devel

          cd /usr/local/soft/

          wget http://pecl.php.net/get/ssh3-0.11.2.tgz

          tar zxvf ssh3-0.11.2.tgz

          cd ssh3-0.11.2

          phpize(如果没有找到该命令,请确定是否安装的是php-devel)

          ./configure --with-ssh3

          make

          cp modules/ssh3.so /usr/lib/php/modules/

          echo "extension=ssh3.so" >> /etc/php.ini

        4.重启php

          service httpd restart

修改php时差及标准时间

        php默认date.timezone为utc,改为date.timezone = PRC

        vim /etc/php.ini

        找到date.timezone 将值修改为PRC 并去掉;号

        重启php service httpd restart

安装nagiosql  主程序

相关环境

      Nagios根位置:/usr/local/nagios

      Nagios配置文件位置:/usr/local/nagios/etc

      Nagios的用户和用户组:nagios|nagios

      apache的启动用户和用户组:apache|apache

 安装主程序

      解压nagiosql_320.tar.gz到/usr/local/nagios/nagiosql下

      cd /usr/local/nagios/

      cp /root/shared/nagiosql_320.tar.gz ./

      tar -zxvf nagiosql_320.tar.gz

    mv nagiosql32 nagiosql

修改用户权限

      chown -R nagios:nagios /usr/local/nagios/nagiosql

      chmod 777 /usr/local/nagios/nagiosql

      修改config目录的访问权限,以使apache对其具有写权限,、

      chmod -R 777 /usr/local/nagios/nagiosql/config

      创建配置文件目录,并修改权限

      cd /usr/local/nagios/nagiosql/

      mkdir etc

      cd etc

mkdir backup hosts import services

      cd backup

      mkdir hosts services

      对nagiosql下的etc进行权限设置

      chown -R apache:apache  etc

      在install下创建ENABLE_INSTALLER文件

      cd /usr/local/nagios/nagiosql/install

      touch ./ENABLE_INSTALLER

   修改apache的httpd.conf文件,部署web服务,添加如下内容。

      apache配置文件位置vim /etc/httpd/conf/httpd.conf

Alias /nagiosQL "/usr/local/nagios/nagiosql"

      

      #  SSLRequireSSL

       Options None

       AllowOverride None

       Order allow,deny

       Allow from all

      

   重启php service httpd restart

      通过IE浏览器进入如下地址http:/// nagiosQL,其中IP是apache服务主机的IP地址,开始下一步的安装

   修改基本系统配置:

Nagios安装配置教程(六)nagiosql的安装

        【管理】-【Config targets】-【修改】

        如下:

        【基目录】/usr/local/nagios/nagiosql/

        【主机目录】/usr/local/nagios/nagiosql/etc/hosts/

        【服务目录】/usr/local/nagios/nagiosql/etc/services/

        【备份目录】/usr/local/nagios/nagiosql/etc/backup/

        【主机备份目录】/usr/local/nagios/nagiosql/etc/backup/hosts/

        【服务备份目录】/usr/local/nagios/nagiosql/etc/backup/services/

        【Nagios基目录】/usr/local/nagios/etc/

        【导入路径】/usr/local/nagios/etc/objects/

        【Nagios命令文件】/usr/local/nagios/var/rw/nagios.cmd

        【Nagios执行文件】/usr/local/nagios/bin/nagios

        【Nagios进程文件】/usr/local/nagios/var/nagios.lock

        【Nagios配置文件 】/usr/local/nagios/etc/nagios.cfg

    导入nagios配置到Nagiosql里

        点击工具→导入数据→按住ctrl,选择以下组件,然后点击导入

        commands.cfg

        contacts.cfg

        templates.cfg

        timeperiods.cfg

    更改Nagiosql的权限

        chown -R nagios.nagios /usr/local/nagios/nagiosql/

        chmod -R 777 /usr/local/nagios/nagiosql/

    写入配置文件

    写入检测数据

Nagios安装配置教程(六)nagiosql的安装

          根据所导入的数据生成hosts、hostgroup、services、servicegroup之类文件,点击工具→Nagios控制→写入检测数据→提交

          此时会在/usr/local/nagios/nagiosql/下生成如下文件

          hostgroups.cfg

          hosttemplates.cfg

          servicegroups.cfg

          servicetemplates.cfg

          在/usr/local/nagios/nagiosql/etc/hosts/目录生成对应已有主机台数数量的主机配置文件

          在/usr/local/nagios/nagiosql/etc/services/目录中生成services的文件

    写入其他数据

          根据所导入的数据生成command、timeperiods.cfg、contacts.cfg 等文件,点击工具→Nagios控制→写入其他数据→提交

          此时会在/usr/local/nagios/nagiosql/目录中生成如下文件

          commands.cfg

          contacts.cfg

          timeperiods.cfg

          servicetemplates.cfg

    关闭nagios配置文件,应用Nagiosql配置文件

          #cfg_file=/usr/local/nagios/etc/objects/commands.cfg

          #cfg_file=/usr/local/nagios/etc/objects/contacts.cfg

          #cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg

          #cfg_file=/usr/local/nagios/etc/objects/templates.cfg

        以下项打开,没有的添加

          cfg_file=/usr/local/nagios/nagiosql/commands.cfg

          cfg_file=/usr/local/nagios/nagiosql/contactgroups.cfg

          cfg_file=/usr/local/nagios/nagiosql/contacts.cfg

          cfg_file=/usr/local/nagios/nagiosql/contacttemplates.cfg

          cfg_file=/usr/local/nagios/nagiosql/hostdependencies.cfg

          cfg_file=/usr/local/nagios/nagiosql/hostescalations.cfg

          cfg_file=/usr/local/nagios/nagiosql/hostextinfo.cfg

          cfg_file=/usr/local/nagios/nagiosql/hostgroups.cfg

          cfg_file=/usr/local/nagios/nagiosql/hosttemplates.cfg

          cfg_file=/usr/local/nagios/nagiosql/servicedependencies.cfg

          cfg_file=/usr/local/nagios/nagiosql/serviceescalations.cfg

          cfg_file=/usr/local/nagios/nagiosql/serviceextinfo.cfg

          cfg_file=/usr/local/nagios/nagiosql/servicegroups.cfg

          cfg_file=/usr/local/nagios/nagiosql/servicetemplates.cfg

          cfg_file=/usr/local/nagios/nagiosql/timeperiods.cfg

          cfg_dir=/usr/local/nagios/nagiosql/etc/hosts/

          cfg_dir=/usr/local/nagios/nagiosql/etc/services/

   登录Nagiosql界面,添加主机和服务器

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页题目:Nagios安装配置教程(六)nagiosql的安装-创新互联
标题来源:http://cdkjz.cn/article/djhgpi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220