please refer http://hj192837.blog.51cto.com/655995/1357552 and http://hj192837.blog.51cto.com/655995/1358716 for installing Nagios 3 and PNP4Nagios and Nagvis
Linux Platform: CentOS 6.5 x86_64
1. yum -y install gcc-c++
tar zxf check_mk-1.2.4.tar.gz
cd check_mk-1.2.4
./setup.sh
please check below setting for it:
bindir='/usr/local/check_mk/bin'
confdir='/usr/local/check_mk/etc'
sharedir='/usr/local/check_mk/share'
docdir='/usr/local/check_mk/doc'
checkmandir='/usr/local/check_mk/doc/manuals'
vardir='/usr/local/check_mk/var'
agentslibdir='/usr/local/check_mk/extensions'
agentsconfdir='/usr/local/check_mk/etc'
nagiosuser='nagios'
wwwuser='apache'
wwwgroup='nagios'
nagios_binary='/usr/local/nagios/bin/nagios'
nagios_config_file='/usr/local/nagios/etc/nagios.cfg'
nagconfdir='/usr/local/nagios/etc/check_mk.d'
nagios_startscript='/etc/init.d/nagios'
nagpipe='/usr/local/nagios/var/rw/nagios.cmd'
check_result_path='/usr/local/nagios/var/spool/checkresults'
nagios_status_file='/usr/local/nagios/var/status.dat'
check_icmp_path='/usr/local/nagios/libexec/check_icmp'
url_prefix='/'
apache_config_dir='/etc/httpd/conf.d'
htpasswd_file='/usr/local/nagios/etc/htpasswd.users'
nagios_auth_name='Nagios Access'
pnptemplates='/usr/local/pnp4nagios/share/templates'
rrd_path='/usr/local/pnp4nagios/var/perfdata'
rrdcached_socket='/tmp/rrdcached.sock'
enable_livestatus='yes'
nagios_version='3.5.1'
libdir='/usr/local/check_mk/lib'
livesock='/usr/local/nagios/var/rw/live'
livebackendsdir='/usr/local/check_mk/livestatus'
enable_mkeventd='yes'
mkeventdstatedir='/usr/local/check_mk/mkeventd'
chkconfig --add mkeventd
vi /etc/init.d/mkeventd
MKEVENTD_SYSLOG=on
service mkeventd start
2. rpm -ivh http://mirrors.sohu.com/fedora-epel/6Server/x86_64/epel-release-6-8.noarch.rpm
yum -y install mod_python
service nagios restart
service httpd restart
http://nagios-server/check_mk/ using nagiosadmin:nagiosadmin
from left bottom of page, check below to add Custom Links
vi /usr/local/check_mk/etc/multisite.mk
3. Install the agent on localhost
yum -y install xinetd
service xinetd start; chkconfig xinetd on
rpm -ivh check_mk-agent-1.2.4-1.noarch.rpm
rpm -ivh check_mk-agent-logwatch-1.2.4-1.noarch.rpm
It's recommended to use WATO to add hosts、run service inventory、modify etc
vi /usr/local/check_mk/etc/main.mk
all_hosts = [ "localhost" ]
vi /usr/local/nagios/etc/nagios.cfg
comment all cfg_file lines as below:
enable_environment_macros=0
log_external_commands=0
log_passive_checks=0
You can also use WATO
/usr/local/check_mk/bin/cmk -I localhost
vi /usr/local/check_mk/var/autochecks/localhost.mk to remove unwanted item as you needed
/usr/local/check_mk/bin/cmk -R
http://nagios-server/check_mk/ using nagiosadmin:nagiosadmin
Install check_mk agent on monitered linux client (no NRPE required)
1. yum -y install xinetd
service xinetd start; chkconfig xinetd on
2. rpm -ivh check_mk-agent-1.2.4-1.noarch.rpm
rpm -ivh check_mk-agent-logwatch-1.2.4-1.noarch.rpm
3. It's recommended to use WATO to add hosts、run service inventory、modify etc
on Nagios check_mk server
vi /etc/hosts
192.168.1.11 linuxtestclient
vi /usr/local/check_mk/etc/main.mk
all_hosts = [ 'localhost','linuxtestclient' ]
You can also use WATO
/usr/local/check_mk/bin/cmk -I linuxtestclient
vi /usr/local/check_mk/var/autochecks/linuxtestclient.mk to remove unwanted item as you needed
/usr/local/check_mk/bin/cmk -R
Install check_mk agent on monitered windows client (no NSCP required)
1. install check-mk-agent-1.2.4.exe
2. create inbound firewall rule for tcp port 6556
3. It's recommended to use WATO to add hosts、run service inventory、modify etc
on Nagios check_mk server
vi /etc/hosts
192.168.1.12 windowsclient
vi /usr/local/check_mk/etc/main.mk
all_hosts = [ 'localhost','linuxtestclient','windowsclient' ]
You can also use WATO
/usr/local/check_mk/bin/cmk -I windowsclient
vi /usr/local/check_mk/var/autochecks/windowsclient.mk to remove unwanted item as you needed
/usr/local/check_mk/bin/cmk -R
You can also use WATO
Remove monitored client from check_mk
vi /usr/local/check_mk/etc/main.mk
remove item for it
/usr/local/check_mk/bin/cmk -R
You can also use WATO
Modify service for monitored client
vi /usr/local/check_mk/var/autochecks/*.mk to remove unneed item
/usr/local/check_mk/bin/cmk -R
You can also use WATO
renew service for host
/usr/local/check_mk/bin/cmk -II host-name
vi /usr/local/check_mk/var/autochecks/*.mk to remove unneed item
/usr/local/check_mk/bin/cmk -R
Managing NagVis permissions in WATO
As this module only works in OMD environments at the moment now , we should remove it from check_mk available snapins
cd /usr/local/check_mk/share/web/plugins/sidebar/
mv nagvis_maps.py nagvis_maps.py.bak
service nagios restart
service httpd restart
Interface in PNP service graph has red error issue:
1. you will find below error
2. to resolve this issue, just upgrade to rrdtool 1.4
yum -y install ruby
rpm -Fvh rrdtool-perl-1.4.7-1.el6.wrl.x86_64.rpm rrdtool-1.4.7-1.el6.wrl.x86_64.rpm
To get popup PNP graph in check_mk
1. vi /usr/local/nagios/etc/nagios.cfg
broker_module=/usr/local/check_mk/lib/livestatus.o pnp_path=/usr/local/pnp4nagios/var/perfdata /usr/local/nagios/var/rw/live
2. /usr/local/check_mk/bin/cmk -R
now it's done