nagios安装与配置

上传人:第*** 文档编号:31079583 上传时间:2018-02-04 格式:DOC 页数:12 大小:62.50KB
返回 下载 相关 举报
nagios安装与配置_第1页
第1页 / 共12页
nagios安装与配置_第2页
第2页 / 共12页
nagios安装与配置_第3页
第3页 / 共12页
nagios安装与配置_第4页
第4页 / 共12页
nagios安装与配置_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《nagios安装与配置》由会员分享,可在线阅读,更多相关《nagios安装与配置(12页珍藏版)》请在金锄头文库上搜索。

1、linux_nagios服务端:yum install httpd php1.添加账户和组:useradd nagiosgroupadd nagcmdusermod -G nagcmd nagiosusermod -G nagcmd apache2.安装 nagios:tar zxvf nagios-3.2.0.tar.gz -C /usr/local/src/cd /usr/local/src/nagios-3.2.0/./configure -with-nagios-group=nagcmd -prefix=/usr/local/nagios #有的写 -with-command-grou

2、p=nagcmd 我做实验时没这么写make allmake installmake install-initmake install-configmake install-commandmodemake install-webconf3.安装插件 nagios-plugins-1.4.14.tartar zxvf nagios-plugins-1.4.14.tarcd /nagios-plugins-1.4.14./configure -with-nagios-user=nagios -with-nagios-group=nagiosmakemake install4.安装 httpd,如果

3、安装 nagios 之前用 yum 安装了 httpd,则不用改 httpd 的配置文件。如果在安装 nagios 之后才用 yum 安装的 httpd 或编译安装的 httpd:则在 /etc/httpd/conf/httpd.conf 后面加入以下内容:vim /httpd.conf#setting for nagiosScriptAlias /nagios/cgi-bin /usr/local/nagios/sbinAuthType BasicOptions ExecCGIAllowOverride NoneOrder allow,denyAllow from allAuthName N

4、agios AccessAuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user Alias /nagios /usr/local/nagios/shareAuthType BasicOptions NoneAllowOverride NoneOrder allow,denyAllow from allAuthName nagios AccessAuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user:wq/usr/local/apac

5、he/bin/apachctl t #检查 APACHE 的配置文件有无语法错误5.htpasswd -c/usr/local/nagios/etc/htpasswd.users nagiosadmin #给nagios 访问网页加用户6.设置邮件联系人yum install sendmail m4 mailxvim /usr/local/nagios/etc/objects/contacts.cfg define contactcontact_name nagiosadmin ; Short name of useruse generic-contact ; Inherit default

6、values from generic-contact template (defined above)alias Nagios Admin ; Full name of useremail ; -c|-criticalTHRESHOLD_USAGE=WARNING threshold must be greater than CRITICAL: basename $0 $*calc=/tmp/memcalcpercent_free=/tmp/mempercentcritical=warning=STATE_OK=0STATE_WARNING=1STATE_CRITICAL=2STATE_U

7、NKNOWN=3# print usage if $# -lt 4 thenecho echo Wrong Syntax: basename $0 $* echo echo Usage: $USAGE echo exit 0fi# read input while $# -gt 0 docase $1 in-w|-warning)shiftwarning=$1;-c|-critical)shiftcritical=$1;esacshiftdone# verify input if $warning -eq $critical | $warning -lt $critical thenecho

8、echo $THRESHOLD_USAGE echo echo Usage: $USAGE echo exit 0fi# Total memory available total=free -m | head -2 |tail -1 |gawk print $2# Total memory used echo exit 0fi# Total memory available total=free -m | head -2 |tail -1 |gawk print $2# Total memory used used=free -m | head -2 |tail -1 |gawk print

9、$3# Calc total minus used free=free -m | head -2 |tail -1 |gawk print $2-$3# normal values #echo $totalMB total #echo $usedMB used #echo $freeMB free # make it into % percent free = (free mem / total mem) * 100) echo 5 $calc # decimal accuracy echo k $calc # commit echo 100 $calc # multiply echo $fr

10、ee $calc # division integer echo $total $calc # division integer echo / $calc # division sign echo * $calc # multiplication sign echo p $calc # print percent=/usr/bin/dc $calc|/bin/sed s/./0./|/usr/bin/tr . |/usr/bin/gawk print $1#percent1=/usr/bin/dc $calc #echo $percent1 if $percent -le $critical

11、thenecho CRITICAL - $free MB ($percent%) Free Memory exit 2fiif $percent -le $warning thenecho WARNING - $free MB ($percent%) Free Memory exit 1fiif $percent -gt $warning thenecho OK - $free MB ($percent%) Free Memory exit 0fi:wqwindows 下安装 NSClient+从 http:/.nsclient.org/nscp/downloads 下载 NSClient+C

12、mdCd c:nsclient+Nsclient+ /install #安装 nsclient+服务Nsclient+ SysTray #将 nsclient+ 作为启动进程( 系统托盘)在运行里打开 Services.msc 然后找到 NSClientpp(nagios).属性点 登录 允许服务与桌面交互. 确定编辑 c:NSClient+ 目录下的 NSC.inimodules;# NSCLIENT+ MODULES;# A list with DLLs to load at startup.; Youwill need to enable some of these for NSClie

13、nt+ to work.; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !; * *; * N O T I C E ! ! ! - Y O U H A V E T O E D I T T H I S *; * *; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !FileLogger.dllCheckSystem.dllCheckDisk.dllNSClientListener.dllNRPEListener.dllSysTray.dll

14、CheckEventLog.dllCheckHelpers.dll;CheckWMI.dllCheckNSCP.dll; Script to check external scripts and/orinternal aliases.CheckExternalScripts.dll; NSCA Agent if you enable this NSClient+will talk to NSCA hosts repeatedly (so dont enable unless you want to use NSCA)NSCAAgent.dll; LUA script module used to write your owncheck deamon.LUAScript.dll; RemoteConfiguration IS AN EXTREM EARLY IDEASO DONT USE FOR PRODUCTION ENVIROMNEMTS!;RemoteConfigurati

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号