nagios整合cacti2011版(五)
下载NSClient++-Win32-0.3.8.msi并安装。
到安装目录打开NSC.ini文件进行修改:
在[modules]模块,将除CheckWMI.dll和RemoteConfiguration.dll外的所有dll文件明前的注释(;)去掉。
在[Settings]模块可以设置一个连接密码password=PWD,为了简单,在此不设密码。设置allowed_hosts=127.0.0.1/32,192.168.0.19,可以连接的监控服务器的地址,如果写成192.168.0.0/24则表示该子网内的所有机器都可以访问;如果这个地方是空白则表示所有的主机都可以连接上来(注意在[NSClient]有allowed_hosts的同样设置,不要设置错了),最后不要忘记去掉前面的注释符(;)。
运行nsclient++
NSClient++ /install
NSClient++ SysTray install
NSClient++ /start
如果有防火墙,请开放相应端口。
创建监控配置文件,使用check_nt命令监控windows系统信息(此命令默认已定义)。
Windows监控示例配置文件:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@tech etc]# cat /usr/local/nagios/etc/servers/print-w-80.cfg
###############################################################################
# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
#
# Last Modified: 06-13-2007
#
# NOTES: This config file assumes that you are using the sample configuration
# files that get installed with the Nagios quickstart guide.
#
###############################################################################
###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################
# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation
define host{
use windows-server ; Inherit default values from a template
host_name print80 ; The name we're giving to this host
alias Print80 ; A longer name associated with the host
address 192.168.0.80 ; IP address of the host
}
###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
# 主机组在/usr/local/nagios/etc/servers/hostgroup.cfg中单独配置
###############################################################################
###############################################################################
# Define a hostgroup for Windows machines
# All hosts that use the windows-server template will automatically be a member of this group
#define hostgroup{
# hostgroup_name windows-servers ; The name of the hostgroup
# alias Windows Servers ; Long name of the group
# }
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description Uptime
check_command check_nt!UPTIME
}
# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}
# Create a service for monitoring
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description C_Drive_Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}
# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}
# Create a service for monitoring the Explorer.exe process
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name print80
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}
#主机组配置文件
[root@tech etc]# cat /usr/local/nagios/etc/servers/hostgroup.cfg
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost,wiki ; Comma separated list of hosts that belong to this group
}
define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
members print80 ; Comma separated list of hosts that belong to this group
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# 确定无误后重启Nagios:
service nagios restart
-rwxr-xr-x 1 root root 77882 11-03 14:23 /usr/local/bin/sendEmail
|
Reading message body from STDIN because the ‘-m’ option was not used.
If you are manually typing in a message:
- First line must be received within 60 seconds.
- End manual input with a CTRL-D on its own line
|
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.9 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -f test@jetsum.net -t 15107170098@139.com,17610376@qq.com -s mail.jetsum.net -u "send by nagios" -xu test -xp 密码
}
|
转载于:https://blog.51cto.com/17610376/543614
nagios整合cacti2011版(五)相关推荐
- 冀教版五年级计算机教学计划,冀教版五年级科学教学计划
冀教版五年级科学教学计划 生物与生物之间.生物与环境之间存在的相互作用和平衡关系.同时,着重培养同学搜集资料.分析资料,以控制实验.模拟实验.分析实验结果.提出假设等探究能力,鼓励同学从正反两个方面分 ...
- 把一个人的特点写具体作文_部编版五年级下册语文习作把一个人的特点写具体教案课件+范文...
第一单元 部编版五年级下册语文第1课<古诗词三首>知识点+图文讲解 部编版小学语文五年级下册第2课<祖父的园子>课文讲解 部编版小学语文五年级下册第3课<月是故乡明> ...
- 分数怎么化成带分数_人教版五年级下册第4单元带分数及把假分数化成整数或带分数教学视频+知识点...
|点击题目下方蓝字一键关注 小学生知识库| [教学视频]分数的分类与互化[知识点] 带分数的意义和特征: 像-这样由整数和真分数合成的数叫做带分数. 假分数化成整数或带分数的方法是什么? ①当假分数的 ...
- 不规则图形数格子的方法_【微课堂】人教版五年级数学(上)6.5不规则图形的面积图文精讲+教学视频+同步练习...
小学生精选资料库,家有小学生都在关注 更多资料.微课堂,请至文末 人教教材同步微课堂(包括视频微课.教材同步.图文讲解.同步练习等),可以在课堂之外帮助同学们学习.欢迎转发给更多的同学哦~~ 电子课本 ...
- 3d数学基础:图形和游戏开发(第2版)_人教版五年级数学上册教学计划进度表
文末有打印资料的方法 往期回顾: 统编版五年级语文上册第1课<白鹭>视频+课件+练习 统编版五年级语文上册第2课<落花生>视频+课件+练习 统编版五年级语文上册第3课<桂 ...
- css 平行四边形 梯形 组合_微课|人教版五年级数学上册6.4组合图形的面积(P99)...
|点击题目下方蓝字一键关注 小学生知识库| 视频微课 在公众号菜单"爱学小学",打开小程序 "爱学中小学",免费观看人教版数学教学视频. 您也可以在这里搜一搜, ...
- my batis plus 小数没有0_北师大版五年级第一单元小数除法知识点总结及易错题解析(1)...
北师大版五年级上册第一单元<小数除法>包括小数除法,积商近似值,循环小数.小数四则混合运算等内容.看似简单,但出错率很高,家长.老师都说:孩子一问好像都知道,但是一做题就这问题那问题,笔者 ...
- 不规则图形数格子的方法_北师大版五年级数学上册数学6.1组合图形的面积微课堂、同步练习、图文解读...
点击上方蓝字关注我们! 电子教材 点击图片,查看大图 ▼▼▼ 微课堂 知识点 知识点:了解组合图形:有几个简单的图形拼出来的图形,我们把它们叫做组合图形. 计算组合图形的面积的方法是多种多样的.一般运 ...
- cacti+nagios整合(未成)
cacti+nagios整合: http://pkgs.fedoraproject.org/repo/pkgs/php-json/php-json-ext-1.2.1.tar.bz2/e06e7014 ...
最新文章
- 你熟知的那个杀毒软件公司McAfee,用这种方法骗过护照人脸识别系统
- 推荐系统-03-简单基于用户的推荐
- 【 FPGA 】状态机的模型之Mealy型状态机
- 用Spark实现简单的单词统计
- Android ContentResolver
- source insight c++ namespace 无法跳转解决方法
- 专题一:预处理数据(使用sklearn-preprocessing)
- iOS之Socket的使用-AsyncSocket
- Linux系统正则表达式用法笔记
- 基于OpenCV实现------图像的转置
- python将json数据集转成voc xml文件
- 《小团团团队》【Alpha】Scrum Meeting 3
- HashMap和HashSet的区别?
- html个人中心源代码,HTML用户注册页面设置源码
- WebRTC SDP 详解和剖析
- iphone 投android电视,手机投屏到电视上的2种方法,看完才知道原来这么简单
- 如何删除word页眉的横线
- 几个黑科技、实用网站(转自公众号:趣说软件)
- 字节面试官推荐的一份 Java 基础面试题!太顶了
- 可解释性机器学习( Explainable Artificial Intelligence (XAI) )文献阅读记录(1.1)
热门文章
- es6去除重复项_Excel的去除重复项你真的明白原理吗?浅尝去除重复项的函数奥秘...
- 转转钓鱼php,最新转转钓鱼源码程序网站微信:mm88wk 最新转转源码 - 下载 - 搜珍网...
- 计算机自然语言的中国科学家,中科院教授王斌加入小米 任自然语言处理首席科学家...
- 怎么在计算机里找到CF里保存的视频,电脑怎么查看穿越火线录制保存视频?操作方法...
- ios 系统提示框_ios13终于能屏蔽系统更新了!附详细教程
- Linux Ubuntu 16.04系统下可用的Windows应用
- hdu Caocao's Bridges(无向图边双连通分量,找出权值最小的桥)
- Floyd算法的理解
- checkA.php,php window平台模拟checkdnsrr函数检测_php
- distinct返回null报错_C#之集合常用扩展方法与Linq