网站首页 > 精选文章 正文
nagios 概述:
开源的免费的网络监视工具。 监控: windows, Linux,Unix,交换机和路由器。报警。
Nagios是插件式的结构,它本身没有任何监控功能,所有的监控都是通过插件进行的,因此其是高度模块化和富于弹性的。Nagios监控的对象可分为两类:主机和服务。主机通常指的是物理主机,如服务器、路由器、工作站和打印机等,这里的主机也可以是虚拟设备,如xen虚拟出的Linux系统;而服务通常指某个特定的功能,如提供http服务的httpd进程等。而为了管理上的方便,主机和服务还可以分别被规划为主机组和服务组等。
Nagios不监控任何具体数值指标(如操作系统上的进程个数),它仅用四种抽象属性对被监控对象的状态进行描述:OK、WARNING, CRITICAL和UNKNOWN。于是,管理员只需要对某种被监控对象的WARNING和CRITICAL状态的阈值进行关注和定义即可
nagios的监控对象有哪些
1.本机的运行状态
2.本机的服务的运行状态
3.远程主机【可以是linuc/unix主机也可以是windows主机】
4.远程主机上的服务
5.监控网络服务(SMTP、POP3、HTTP、PING等);
6.监控主机资源(处理器负荷、磁盘利用率等);
官方网站:
http://www.nagios.org/
nagios-cn 下载地址:
http://sourceforge.net/projects/nagios-cn/files/latest/download
需要软件:
nagios-cn-3.2.3.tar.bz2 #nagios 核心文件,nagios服务文件
nagios-plugins-1.4.16.tar.gz # nagios 中的插件。 存放:收集系统信息的脚本和命令
运行模式: 搜集信息时是 C/S模式 , 通过浏览器查看时:B/S
安装: nagios
安装LAMP环境。不需要用到mysql
注:安装环境:yum install mysql-devel openssl-devel -y
只有安装了mysql-devel,编译安装nagios-plugin时才会生成:脚本
/usr/local/nagios/libexec/check_mysql
[root@xinsz08 Desktop]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
Yum install php php-devel
测试:php
[root@xinsz08 html]# pwd
/var/www/html
[root@xinsz08 html]# cat index.php
<?php
phpinfo();
?>
重启下apache
出现此图证明php可以使用
安装nagios
创建运行nagios进程的用户:
[root@xinsz08 ~]# useradd nagios
[root@xinsz08 ~]# groupadd nagcmd
[root@xinsz08 ~]# usermod -G nagcmd nagios
[root@xinsz08 ~]# usermod -G nagcmd apache
[root@xinsz08 ~]# id apache
uid=48(apache) gid=48(apache) groups=48(apache),501(nagcmd)
安装nagios 核心包。:
[root@xinsz08 ~]#tar jxvf nagios-cn-3.2.3.tar.bz2
[root@xinsz08 ~]# cdnagios-cn-3.2.3
[root@xinsz08 ~]# ./configure --with-command-group=nagcmd #指定运行Nagios进程的用户组
[root@xinsz08 ~]# make all #编译
[root@xinsz08 ~]# make install
安装生成/usr/local/nagios/ 其中,/usr/local/nagios/share的目录(即nagiosWEB访问界面的站点目录)
[[root@xinsz08nagios-cn-3.2.3]# make install-init #安装生成/etc/rc.d/init.d/nagios 启动脚本
root@xinsz08 nagios-cn-3.2.3]#make install-commandmode
#设定相应nagios工作目录的权限
[root@xinsz08 ~]# makeinstall-config
安装生成/usr/local/nagios/etc下的nagios相关配置文件
[root@xinsz08nagios-cn-3.2.3]# ls /usr/local/nagios/etc
cgi.cfg htpasswd.users nagios.cfg nagiosgraph.cfg objects resource.cfg
nagios.cfg : nagios主配置文件。
htpasswd.users :生成访问nagios目录的用户名和密码
[root@xinsz08nagios-cn-3.2.3]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
//生成访问http://192.168.1.63/nagios 目录的用户和密码
安装Nagios的WEB配置文件到Apache的conf.d目录下
[root@xinsz08nagios-cn-3.2.3]# make install-webconf
重启httpd服务:
[root@xinsz08 nagios-cn-3.2.3]# service httpd restart
登录NAGIOS查看:
http://192.168.1.63/nagios/
到现在为止nagios搭建完成了,接下来就是应用了
欢迎关注公众号:xinsz08 ,每天一篇技术文章,总有一篇是你想要的
猜你喜欢
- 2024-12-13 MySQL自动部署搭建脚本只需上传安装包即可
- 2024-12-13 Linux|如何安装和运行多个 glibc 库
- 2024-12-13 linux??如何编译安装软件?我来告诉你
- 2024-12-13 WinRAR(32 bit) 5.20 简体中文版
- 2024-12-13 区块链教程(一):前置知识-linux补充
- 2024-12-13 玩openwrt的基础
- 2024-12-13 搭建简易堡垒机
- 2024-12-13 Linux云计算面试&学习必备知识汇总(二)
- 2024-12-13 Linux下用rm误删除文件的三种恢复方法
- 2024-12-13 现代CMake项目中的依赖管理
- 05-3022《Vue 入门教程》VueRouter 路由嵌套
- 05-30前端面试题-Vue 项目中,你做过哪些性能优化?
- 05-30超简 Vue3+elementPlus 后台管理系统
- 05-30还有前端不知道Electron的?手把手教你把Vue项目打包成桌面程序
- 05-30Nuxt最简入门,让vue项目快速被搜索引擎收录
- 05-30Mac上最美最好用软件系列
- 05-30AI编程小白必备|Cursor安装及配置教程
- 05-30好玩儿的编程语言——文言文编程语言
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)