nagios 安装备忘

简介: 前提, rhel6.2  环境 安装 lamp 架构,支持 GD 库 www.nagios.org 下载 nagios-3.5.0.tar.gz 配置前初始化用户及建立目录 useradd nagios mkdir /tmp/nagios /tmp/nagios-temp /var/run/nagios chown nagios:nagios /tmp/nagios /t

前提, rhel6.2  环境
安装 lamp 架构,支持 GD 库

www.nagios.org 下载 nagios-3.5.0.tar.gz


配置前初始化用户及建立目录
useradd nagios
mkdir /tmp/nagios /tmp/nagios-temp /var/run/nagios
chown nagios:nagios /tmp/nagios /tmp/nagios-temp /var/run/nagios

  注: 官方推荐用户与执行命令组不一样 ./configure --with-command-group=nagcmd

 

编译参数
./configure --enable-nanosleep --enable-event-broker --enable-embedded-perl --enable-cygwin --enable-libtap --with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios --with-command-group=nagios --with-httpd-conf=/usr/local/apache2/conf/extra/ --with-checkresult-dir=/tmp/nagios --with-temp-dir=/tmp/nagios-temp --with-init-dir=/etc/rc.d/init.d --with-lockfile=/var/run/nagios --with-gd-lib=/usr/local/lib --with-perlcache  --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios

 

编译提示
 General Options:
 -------------------------
        Nagios executable:  nagios.exe
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
            Embedded Perl:  yes, with caching
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
                Lock file:  /var/run/nagios
   Check result directory:  /tmp/nagios
           Init directory:  /etc/rc.d/init.d
  Apache conf.d directory:  /usr/local/apache2/conf/extra/
             Mail program:  /bin/mail
                  Host OS:  linux-gnu

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /bin/traceroute

 

安装过程
make all
make install
 ( cd base ; cp nagios nagios.exe ; cp nagiostat nagiostat.exe )
 ( cd /usr/local/nagios/bin ; cp nagios.exe nagios ; cp nagiostat.exe nagiostat )
make install-init
make install-commandmode
make install-config
make install-webconf
make install-exfoliation
make install-classicui

cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers

 


检测安装是否成功,同样可以用下面方法检测配置文件是否具有错误
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start

 

创建 nagios 登陆用户
htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin

 


安装参数帮助
  make install
     - This installs the main program, CGIs, and HTML files

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-config
     - This installs *SAMPLE* config files in /usr/local/nagios/etc
       You'll have to modify these sample files before you can
       use Nagios.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!

  make install-webconf
     - This installs the Apache config file for the Nagios
       web interface

  make install-exfoliation
     - This installs the Exfoliation theme for the Nagios
       web interface

  make install-classicui
     - This installs the classic theme for the Nagios
       web interface

 


安装过程需要注意的目录
command dir
/usr/local/nagios/bin

html dir
/usr/local/nagios/share

daemon dir
/etc/rc.d/init.d/nagios

commandmode dir
/usr/local/nagios/var/rw

web config file
/usr/local/apache2/conf/extra//nagios.conf


exfoliation dir (theme)
/usr/local/nagios/share/stylesheets
/usr/local/nagios/share/images


sample config file
/usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/etc/cgi.cfg
/usr/local/nagios/etc/resource.cfg
/usr/local/nagios/etc/objects/templates.cfg
/usr/local/nagios/etc/objects/commands.cfg
/usr/local/nagios/etc/objects/contacts.cfg
/usr/local/nagios/etc/objects/timeperiods.cfg
/usr/local/nagios/etc/objects/localhost.cfg
/usr/local/nagios/etc/objects/windows.cfg
/usr/local/nagios/etc/objects/printer.cfg
/usr/local/nagios/etc/objects/switch.cfg


可参考  http://support.nagios.com/ 中 nagios core 的安装文档
也可以参考  http://nagios.sourceforge.net/docs/3_0/toc.html 中的配置文档

目录
相关文章
|
2月前
|
人工智能 自然语言处理 物联网
GEO优化方法有哪些?2025企业抢占AI流量必看指南
AI的不断重塑传统的信息入口之际,用户的搜索行为也从单一的百度、抖音的简单的查找答案的模式,逐渐转向了对DeepSeek、豆包、文心一言等一系列的AI对话平台的更加深入的探索和体验。DeepSeek的不断迭代优化同时,目前其月活跃的用户已破1.6亿,全网的AI用户规模也已超过6亿,这无疑为其下一阶段的迅猛发展提供了坚实的基础和广泛的市场空间。
|
数据库
OVS 总体架构、源码结构及数据流程全面解析
在前文「从 Bridge 到 OVS」中,我们已经对 OVS 进行了一番探索。本文决定从 OVS 的整体架构到各个组件都进行一个详细的介绍。 OVS 架构 OVS 是产品级的虚拟交换机,大量应用在生产环境中,支撑整个数据中心虚拟网络的运转。
4671 0
|
1月前
|
监控 安全 网络协议
C&C服务器:网络攻击的指挥中心
C&C服务器是网络攻击的指挥中心,控制“肉鸡”执行恶意行为。其通过隐蔽通信、DGA、Fast Flux等技术逃避检测,广泛用于勒索软件、僵尸网络等攻击。需结合流量分析、威胁情报与多层防护应对。
200 0
|
3月前
|
监控 Kubernetes 安全
Istio 服务网格技术详解与实践指南
本文档全面介绍 Istio 服务网格的核心概念、架构设计和实践应用。作为云原生领域的关键技术,Istio 提供了透明的、语言无关的服务间通信解决方案,实现了流量管理、安全加固和可观测性等功能。本文将深入探讨其数据平面与控制平面架构、Envoy 代理机制、流量治理策略以及与 Kubernetes 的深度集成,帮助开发者构建可靠、安全的分布式系统。
279 5
|
4月前
|
Ubuntu 安全 数据挖掘
Ubuntu作为初学者Linux发行版的选择:众多优势解析
总的来说,选择Ubuntu作为初学者的Linux发行版,将享受到诸多优势。从用户友好的界面到强大的社区支持,再到丰富的学习资源和安全性保障,Ubuntu为初学者提供了一个理想的学习环境,助力他们快速掌握Linux系统。通过使用Ubuntu,用户不仅能获取操作系统的基础知识,还能培养解决问题的能力和自信,为未来的技术发展奠定坚实基础。无论是出于个人兴趣还是职业发展需求,Ubuntu都是不二之选。
|
7月前
|
存储 人工智能 安全
赋能数字化转型的创新引擎
阿里云是全球领先的云计算与人工智能科技公司,其强大的技术实力和丰富的解决方案正深刻影响企业运营与竞争力。依托坚实的云计算基础设施,阿里云提供弹性计算、存储与网络服务,满足多样化需求。在AI与大数据领域,机器学习平台PAI及MaxCompute助力智能决策与创新应用。同时,阿里云构建全方位安全防护体系,保障数据隐私,并通过活跃的开发者社区与生态合作推动行业进步。未来,阿里云将持续加大研发投入,优化云原生技术,深化AI与大数据研究,引领数字化转型潮流,共创美好未来。
赋能数字化转型的创新引擎
|
7月前
|
存储 SQL BI
大型医院HIS,EMR,LIS,PACS源码
本产品支持信创,适用于三级及大中型医院,涵盖全面业务系统,助力医共体与单体医院发展。系统包括门诊和住院医生工作站、护士工作站、电子病历(EMR)、实验室信息系统(LIS)、放射科室管理(PACS/RIS)等模块,实现医院信息化建设目标。功能覆盖人性化服务、集成化管理、智能化操作、无纸化与无胶片化流程,优化医疗资源,提升医疗服务效率与质量,打造现代化数字医院。支持多系统接口与数据交换,满足医保需求,提供统计分析与权限管理,确保信息准确、安全、高效流转。
|
9月前
|
人工智能 API 开发者
HarmonyOS Next~鸿蒙应用框架开发实战:Ability Kit与Accessibility Kit深度解析
本书深入解析HarmonyOS应用框架开发,聚焦Ability Kit与Accessibility Kit两大核心组件。Ability Kit通过FA/PA双引擎架构实现跨设备协同,支持分布式能力开发;Accessibility Kit提供无障碍服务构建方案,优化用户体验。内容涵盖设计理念、实践案例、调试优化及未来演进方向,助力开发者打造高效、包容的分布式应用,体现HarmonyOS生态价值。
593 27
|
9月前
|
人工智能 安全
湖南省大模型备案情况分析及新通知对企业的影响
本文分析了湖南省大模型备案情况,涵盖行业应用领域、备案时间及未来发展方向,并结合2025年3月发布的生成式人工智能备案/登记专项通知,探讨其对企业的影响。湖南在人工智能领域的布局积极,大模型已应用于多个行业。新通知通过提升合规意识、加强监督检查和促进高质量发展,助力企业规范运营并推动产业健康发展。企业应主动适应政策,探索创新应用,为湖南乃至全国的人工智能发展贡献力量。