nagios服务器设置

Steven · 2021-11-14 09:11 · 115 views · Monitoring · old id 98

GPOC nagios服务器设置
#Centos6.5 下挂载windows共享文件夹 到 linux

mount -t cifs -o username="syinsh\rootadmin" //10.200.2.40/General/Professional\ Software/nagios/nagios-3.4.3  /mnt/windows

nagios 用户密码 formas
nagiosadmin 用户密码 formas

新nagios监控服务器
http://10.200.2.206/nagios/

#增加了新用户 nagiosadmin
/usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd nagiosadmin
如果要增加 非nagiosadmin 用户,需要修改apache配置文件中的一处认证

网站目录:
/usr/local/apache2/htdocs
日志目录
/usr/local/nagios/var/nagios.log
/usr/local/apache2/bin/apachectl status
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl stop


#验证 nagios的配置
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios restart
# /etc/init.d/nagios start
or
# service nagios start

#验证通过,重启nagios服务
service nagios restart

cd /usr/local/nagios/etc/objects/

============================
Apache start
find / -name httpd
/usr/local/apache2/bin/httpd -k restart


配置文件目录
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg

#new insert
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
cfg_file=/usr/local/nagios/etc/objects/services.cfg

# Definitions for monitoring the local (Linux) host
cfg_file=/usr/local/nagios/etc/objects/localhost.cfg

# Definitions for monitoring a Windows machine
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg

# Definitions for monitoring a router/switch
cfg_file=/usr/local/nagios/etc/objects/switch.cfg

# Definitions for monitoring a network printer
cfg_file=/usr/local/nagios/etc/objects/printer.cfg


=========================
1.关闭SELinux
(1)关闭永久有效
vi /etc/selinux/config
# 修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重启。
SELINUX=disabled
(2)即时生效
setenforce 0
查看是是否生效的命令:
getenforce
##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式


===========================
#service iptables stop
#service ip6tables stop
这个命令可以临时关闭防火墙

#chkconfig iptables off
#chkconfig ip6tables off
这个命令可以永久关闭防火墙

#chkconfig iptables --list
#chkconfig ip6tables --list
这个命令可以查看防火墙的状态

← Back to home