nagios客户端安装与配置windows篇

简介: 一、被监控的windows xp客户端的配置1、安装NSClient++并安装下载地址: http://sourceforge.net/projects/nscplusNSClient++-0.3.8-Win32.

一、被监控的windows xp客户端的配置

1、安装NSClient++并安装
下载地址: http://sourceforge.net/projects/nscplus
NSClient++-0.3.8-Win32.msi  
NSClient++-0.3.8-x64.msi

2、安装NSClient++
双击安装 -> next -> 同意 -> next  -> next -> next -> 设置允许IP,设置密码(这里密码一般可以不设置),Modules to load (选前三个模块就可以了,第2个为chect_nt用于监控windows,第3个为checp_nrpe用于监控linux) -> next  -> install  -> finish

3、启动NSClientpp服务,并允许服务交互式

4、如果windows开启了自带的防火墙,那么必须设置让该程序通过




二、监控端主机的设置(Nagios服务器)

1、检查Nagios目录下的libexec子目录,一定要存在check_nt(例如:/usr/local/nagios/libexec/check_nt)



2、配置command.cfg文件(例如:/usr/local/nagios/etc/objects/command.cfg),增加如下几行(默认应该已经有了)

 

#/usr/local/nagios/etc/objects/command.cfg

 

# 'check_nt' command definition


define command{
command_name    check_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}

3、编译nagios.cfg文件

 

#/usr/local/nagios/etc/nagios.cfg,打开下面这一行

 

# Definitions for monitoring a Windows machine

 

cfg_file=/usr/local/nagios/etc/objects/windows.cfg



#vi  /usr/local/nagios/etc/objects/windows.cfg,下面为配置主要的监控项目



#定义要被监控的windows主机名与主机的IP地址

define host{

 

use             windows-server 

 

host_name       ruanxi         

 

alias           My Windows Server

 

address         192.168.0.5    

 

}



#定义一个主机名组(可以不用管它)

define hostgroup{

 

hostgroup_name  windows-servers

 

alias           Windows Servers

 

}



#检查windows主机是否已经安装了NSClient++,及它的版本号

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     NSClient++ Version

 

check_command           check_nt!CLIENTVERSION

 

}



#监控 windows 主机的开机运作时间

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Uptime

 

check_command           check_nt!UPTIME

 

}



#监控 windows 主机的 CPU 负载

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     CPU Load

 

check_command           check_nt!CPULOAD!-l 5,80,90    #CPU如果到达80%则报警,到达90%则警笛

 

}



#监控 windows 主机的内存使用状况 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Memory Usage

 

check_command           check_nt!MEMUSE!-w 80 -c 90  #内存使用到达80%则warn,到达90%则Critical

 

}



#监控 windows 主机的 C:\ 的空间使用量 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     C:\ Drive Space

 

check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90

 

}



#监控 windows主机的W3SVC设置的动作状况

                         ------>此服务为WEB服务器有关日志的服务程序

 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     W3SVC

 

check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC

 

}



#监控 windows 主机的 Explorer.exe 执行程序的运作状况,如程序终止了,则会发 CRITICA

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Explorer

 

check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe

 

}



#监控 windows 主机的 MSSQLSERVER 服务的运作状况,如服务终止了,则会发 CRITICAL 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     MSSQL

 

check_command           check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER

 

}



说明:如果有多台的windows xp客户端要监控,那么就以上述这样写多个就可以了


3、检查nagios.cfg文件有没有错误

 

#nagios -c  nagios.cfg



4、重新启动一下nagios服务

 

#service nagios restart



5、访问页面进行查看

 

#elinks http://localhost/nagios/

目录
相关文章
|
5月前
|
人工智能 JavaScript 开发工具
极速上手!Claude Code 原生支持 Windows 免WSL安装教程
Claude Code 现已支持 Windows 原生运行,无需 WSL 配置。本文提供详细安装教程,涵盖 Node.js 环境验证、Git 安装及 Claude Code 配置步骤,助你快速上手这一强大 AI 编程工具。
4153 5
|
5月前
|
存储 虚拟化 Windows
VMware安装Windows10
本案例介绍了在Windows系统上使用VMware Workstation 17.5 Pro安装配置Windows 10虚拟机的详细步骤,包括所需设备、软件下载链接、虚拟机设置及系统安装全过程。
2570 133
VMware安装Windows10
|
4月前
|
安全 Ubuntu iOS开发
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
233 3
Nessus Professional 10.10 Auto Installer for Windows - Nessus 自动化安装程序
|
4月前
|
Linux 虚拟化 iOS开发
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
964 0
VMware Remote Console 13.0.1 for macOS, Linux, Windows - vSphere 虚拟机控制台的桌面客户端
|
5月前
|
NoSQL IDE MongoDB
Studio 3T 2025.17 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
Studio 3T 2025.17 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
375 1
Studio 3T 2025.17 (macOS, Linux, Windows) - MongoDB 的终极 GUI、IDE 和 客户端
|
5月前
|
安全 数据安全/隐私保护 Windows
ZyperWin++使用教程!让Windows更丝滑!c盘飘红一键搞定!ZyperWin++解决系统优化、Office安装和系统激活
ZyperWin++是一款仅5MB的开源免费Windows优化工具,支持快速优化、自定义设置与垃圾清理,兼具系统加速、隐私保护、Office安装等功能,轻便无广告,小白也能轻松上手,是提升电脑性能的全能管家。
1789 0
|
6月前
|
Ubuntu Linux Windows
如何在Ubuntu系统中安装Wine,借此来运行Windows程序
熟悉的登录画面出现,在Ubuntu系统中扫描登录微信程序。
|
监控 数据安全/隐私保护 Windows