当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 初学者玩Nagios被虐出翔:web添加主机权限问题和监控windows报错问题
帖子发表于 : 2012-08-23 18:15 

注册: 2012-08-08 13:02
帖子: 16
送出感谢: 0 次
接收感谢: 0 次
unbuntu12.04 nagios3.2.3

一、web添加主机权限问题
nagios3是用apt-get直接安装配置的
代码:
apt-get install nagios3

可以正常监控本机,除了硬盘意外是红的,其他全绿。
在http://localhost/nagios3/上的Command上添加主机,点击Commit后报错
引用:
Sorry, but you are not authorized to commit the specified command.
Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.
Return from whence you came

因为是全自动安装配置,所以没有添加用户名和组。
安装完之后也不知道怎么弄。是这个原因吗?求教怎么改。

二、监控windows报错问题
另一台win系统的NSClient++已经安装和配置好了,服务自动开启,端口监听正常。
就是回到监控服务器上来配置就出错啦。
听说要把/etc/nagios3/nagios.cfg里的这个改成这样,就是去掉注释
代码:
# Definitions for monitoring a Windows machine
cfg_file=/etc/nagios3/objects/windows.cfg

但是尼玛/etc/nagios3/没有objects文件夹,更没有windows.cfg文件
于是,好吧,我就自己建一个
照着这里复制的http://static.jumpbox.com/godber/misc/nagios-objects-dir/windows.cfg
除了address要改,还有什么要改呢?
代码:
###############################################################################
# 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   winserver   ; The name we're giving to this host
   alias      My Windows Server   ; A longer name associated with the host
   address      192.168.1.2   ; IP address of the host
   }




###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
#
###############################################################################
###############################################################################


# 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      winserver
   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      winserver
   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      winserver
   service_description   CPU Load
   check_command      check_nt!CPULOAD!-l 5,80,90
   }



# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above

define service{
   use         generic-service
   host_name      winserver
   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      winserver
   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      winserver
   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      winserver
   service_description   Explorer
   check_command      check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
   }




出来以后,service nagios3 restart
代码:
[email protected]:/etc/nagios3# service nagios3 restart
 * Restarting nagios3 monitoring daemon nagios3

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Processing object config directory '/etc/nagios-plugins/config'...
Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
Processing object config file '/etc/nagios-plugins/config/http.cfg'...
Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
Processing object config file '/etc/nagios-plugins/config/news.cfg'...
Processing object config file '/etc/nagios-plugins/config/real.cfg'...
Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
Processing object config file '/etc/nagios-plugins/config/games.cfg'...
Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
Processing object config file '/etc/nagios-plugins/config/load.cfg'...
Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
Processing object config file '/etc/nagios-plugins/config/users.cfg'...
Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
Processing object config directory '/etc/nagios3/conf.d'...
Processing object config file '/etc/nagios3/conf.d/timeperiods_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/generic-service_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/extinfo_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/localhost_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/services_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/generic-host_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/contacts_nagios2.cfg'...
Processing object config file '/etc/nagios3/objects/windows.cfg'...
Error: Template 'windows-server' specified in host definition could not be not found (config file '/etc/nagios3/objects/windows.cfg', starting on line 25)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

 * errors in config!
                                                                         [fail]

如果把cfg_file=/etc/nagios3/objects/windows.cfg注销掉。
还是可以正常restart,正常监控本机。

Nagios虐我千百遍,我待Nagios如初恋。
已出翔,受不了了。希望高手指点迷津!小弟感激不敬!


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 初学者玩Nagios被虐出翔:web添加主机权限问题和监控windows报错问题
帖子发表于 : 2012-08-31 0:28 
头像

注册: 2010-06-16 1:05
帖子: 14668
地址: Tencent
系统: Mac OS X
送出感谢: 1
接收感谢: 153
没玩过。。。 :em06


_________________
twitter求fo:http://twitter.com/maplebeats
博客求踩:http://maplebeats.com


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 初学者玩Nagios被虐出翔:web添加主机权限问题和监控windows报错问题
帖子发表于 : 2012-08-31 0:45 

注册: 2012-08-08 13:02
帖子: 16
送出感谢: 0 次
接收感谢: 0 次
好吧···问题是没有解决~
但是我照着Nagios的官方网站的ubuntu安装方法重新装了一编,好了···
虽然还有权限的问题,不能web添加主机
Sorry, but you are not authorized to commit the specified command.
Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.
Return from whence you came
但是,在后台改文档还是可以正常使用的!

凑合先吧= =


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 0 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译