监控windows主机
1.概述
如果想监控windwos主机就需要安装客户端,而这个客户端是Nagios plugin和windows机器之间的传递的介质.
那么这个客户端是NSClient++,Nagios服务器端使用check_nt插件和NSClient++插件进行数据交互.
2.监控windows的步骤
①.满足首次安装条件;
②.在windows主机上安装客户端;
③.创建新的主机和服务定义来监控windows主机;
④.重启Nagios守护进程
官方简化
1.check_nt命令已经添加至commands.cfg配置文件中,并且允许你使用check_nt来监控windows主机;
2.监控windows主机可以套用定义好的windows主机模板,配置文件为templates.cfg,并且允许你使用这个模板来监控主机.
①满足首次安装的安装条件
首次监控windwos主机时,首先需要做的是编辑nagios的配置文件
vim /usr/local/nagios/etc/nagios.cfg
将
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
去掉开头井号(#)
cfg_file=/usr/local/nagios/etc/objects/windows.cfg
你可以在/usr/local/nagios/etc/objects/windows.cfg配置文件中定义你想要的主机和服务.
②安装客户端
在你想要监控widows主机之前,你需要在你的主机上安装客户端,官方推荐NSClient++插件,你可以在http://sourceforge.net/projects/nscplus.这个网站中找到它.
访问http://sourceforge.net/projects/nscplus.下载最新的NSClient++插件.
解压下载后的文件至C盘
运行cmd并更改至刚刚解压后的目录下
使用nsclient++ /install命令注册windows系统服务(此种安装方式局限于0.9以前的版本)
使用nsclient++ SysTray安装系统任务栏
在windows系统服务中开启“属性” -> “登录” -> “运行服务于桌面交互”
编辑NSC.INI配置文件
· 取消[modules]中所有注释的模块(.dll结尾),除了CheckWMI.dll 和RemoteConfiguration.dll.
· 更改[Settings]中‘password’选项用于设置客户端密码(可选)
· 取消[Settings]中‘allowed_hosts’选项注释,添加Nagios服务器IP地址,或者什么都不写代表允许所有主机
· 确认[NSClient]中‘port’选项注释已经去掉,并且已经设置为12489端口(默认为12489,可变)
使用nsclient++ /start启动服务
如果安装成功,那么将有一个新的图标出现在你的系统托盘中,它是一个黄色圆圈并且中间有个黑色的‘M’
成功!现在就开始在Nagios服务器中添加Windows服务器的监控配置.
③创建新的主机和服务定义来监控windows主机
现在开始进行Nagios服务定义监控windows主机
打开并编辑windows配置文件
添加一个新的windows主机,首先需要定义一个host,你可以根据下面的实例来更改成要监控的windwos主机的信息.
建议增加windows监控主机时以主机为名称新建配置文件
cp /usr/local/nagios/etc/objects/windows.cfg /usr/local/nagios/etc/objects/<windowsIP>.cfg
在将nagios.cfg配置中新增一行
vim /usr/local/nagios/etc/nagios.cfg
cfg_file=/usr/local/nagios/etc/objects/<windowsIP>.cfg
define host{
use windows-server ; Inherit default values from a Windows server template (make sure you keep this line!)
host_name winserver
alias My Windows Server
address 192.168.1.2
}
添加下面服务定义,用来检测NSClient++ 插件的版本信息
define service{
use generic-service
host_name winserver
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
添加下面服务定义,用来检测windows服务器的运行时间
define service{
use generic-service
host_name winserver
service_description Uptime
check_command check_nt!UPTIME
}
添加下面服务定义,用来监控cpu使用率,在持续五分钟cpu使用率在80%以上报WARNING,在持续五分钟cpu使用率在90%以上报CRITICAL.
define service{
use generic-service
host_name winserver
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}
添加下面服务定义,用来监控内存使用并生成一个告警,80%以上报WARNING,90%以上报CRITICAL.
define service{
use generic-service
host_name winserver
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
添加下面服务定义用来监控C盘使用量,若使用量在80%以上报WARNING,90%以上报CRITICAL.
define service{
use generic-service
host_name winserver
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}
-l 后跟需要监控的盘符
添加下面服务定义用来监控W3SVC进程是否正在运行,如果停止状态将会产生一个CRITICAL报警.
define service{
use generic-service
host_name winserver
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}
添加下面服务定义用来监控Explorer进程是否正在运行,如果停止状态将会产生一个CRITICAL报警.
define service{
use generic-service
host_name winserver
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}
如果客户端设置了连接密码,那么需要在Nagios服务器上指定这个密码.
编辑
vi /usr/local/nagios/etc/objects/commands.cfg
指定密码格式如下
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v $ARG1$ $ARG2$
}
其中-s后跟客户端设定的密码.
④重启Nagios守护进程
如果修改了Nagios配置文件,需要检查正确性在重启.
检查配置文件需要使用Nagios -v选项
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
重启Nagios有三种方式
[1]脚本重启
/etc/rc.d/init.d/nagios restart
[2]网页重启
"Process" -> "Restart the Nagios Process"
[3]手动重启
kill -HUP <nagios_pid>
具体信息请移步至
http://nagios.sourceforge.net/docs/nagioscore/4/en/monitoring-windows.html
相关推荐
Windows Security Monitoring Scenarios and Patterns 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Monitoring .NET Performance with Event Tracing for Windows
Statistical profile monitoring is an area of statistical quality control that is growing in significance for researchers and practitioners, specifically because of its range of applicability across ...
Device Monitoring Studio is a software solution for monitoring, logging and analyzing data coming through PC ports and connections. Combining together the power of Serial, USB and Network monitoring ...
Microsoft Monitoring Agent 2013可以监视计算机基础结构和应用程序运行状况。它收集诊断数据,如性能指标、事件日志和跟踪。Microsoft Monitoring Agent 可用作独立工具,或与 System Center Operations Manager ...
SQL SERVER MONITORING SQL SERVER 有样例和PPT
串口和TCP还有usb协议调试软件,可以分析设备管理器里面通讯协议,非常适合开发人员进行数据分析和处理。
IBM Tivoli Monitoring v6.1培训笔记.doc IBM Tivoli Monitoring v6.1培训笔记.doc
ITM6概述,IBM Tivoli Monitoring
device-monitoring-studio.7.25版本,在Windows10实测可用
Tivoli Monitoring 部署实践
Monitoring network traffic and detecting unwanted applications has become a challenging problem, since many applications obfuscate their traffic using unregistered port numbers or payload encryption. ...
Microcontroller-Based Temperature Monitoring and Control is an essential and practical guide for all engineers involved in the use of microcontrollers in measurement and control systems. The book ...
Monitoring with Graphite 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Linux System and Performance Monitoring
Monitoring Hadoop 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Zabbix 4 Network Monitoring is the perfect starting point for monitoring the performance of your network devices and applications with Zabbix. Even if you've never used a monitoring solution before, ...
device-monitoring-studio.7.25破解版本,调试代码的时候监控串口收发数据流,非常好用,本人亲测,欢迎下载。设置时候选中USB,然后Visualizers 双击选中RAW Data View即可监视数据流
Monitoring with Graphite 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Device Monitoring Studio8.45.01.9934,全网唯一,最强大的串口监听软件最新版,也可以监听USB和网口,已河蟹,自己已经安装成功。