Nagios-RSV Alarm System � Sarah Williams OSG Site Admin’s Workshop at SLAC Nov 14, 2008
Prerequisites � Working RSV install • Working Nagios install • OR • Rpm-based linux server on which to install Nagios CHECKPOINT Does everyone have these? Can you access them via http(s) and ssh? March 2, 08
Install Nagios and Apache � Set up your installation tool of choice to use the Dag repository: • http://dag.wieers.com/rpm/FAQ.php#B1 OR • Download the latest Nagios and Nagios-plugin rpm for your distro: http://dag.wieers.com/rpm/packages/nagios/ http://dag.wieers.com/rpm/packages/nagios-plugins/ Install the apache rpm using your preferred install tool. Example: • %yum install httpd OR • Direct download the appropriate apache rpm for your distro. http://rpm.pbone.net/ March 2, 08
Install Nagios and Apache (cont.) � Add web accounts: • % htpasswd -c /etc/nagios/htpasswd.users sarah % htpasswd -c /etc/nagios/htpasswd.users nagios • Add rights to your viewing account by editing /etc/nagios/cgi.cfg and adding: authorized_for_all_services=nagiosadmin,sarah authorized_for_all_hosts=nagiosadmin,sarah Start Nagios & Apache: • % /etc/init.d/nagios start % /etc/init.d/httpd start March 2, 08
CHECKPOINT � Can you view your Nagios interface? • Ex: http://iut2-c082.iu.edu/nagios/ If you get ‘connection refused’, you may need to open port 80 in your firewall. If you are behind a campus firewall, you can run lynx from inside your terminal: % lynx http://iut2-c082.iu.edu/nagios/ • Can you authenticate with both usernames? • Click ‘Service Detail’ in the sidebar. Do you see localhost with 8 services? • If you get a misconfiguration error, it may be an selinux issue. Try % setenforce 0 Which temporarily disables selinux. If you want to run both selinux and nagios, this guide may help: http://www.rickwargo.com/2006/10/29/fc6-selinux-and-nagios/ March 2, 08
Configure RSV � Edit • $VDT_LOCATION/osg-rsv/config/rsv-nagios.conf Ignore ‘short_hostname’ – this is no longer used. • ## Your Nagios server coordinates NAGIOS_URL: http://nagios-server.domain.edu/ nagios/cgi-bin/cmd.cgi NAGIOS_USERNAME: nagios-username NAGIOS_PASSWORD: nagios-password March 2, 08
Configure RSV (cont.) � Download the newest version of the rsv2nagios.py file: • wget http://repo.mwt2.org/viewvc/rsv/nagios/ rsv2nagios.py -O $VDT_LOCATION/osg-rsv/bin/ misc/rsv2nagios.py chmod a+x $VDT_LOCATION/osg-rsv/bin/misc/ rsv2nagios.py Note: After VDT 1.10.1n is released (around Nov 17 2008), you will no longer need to download this file. • Enable the Nagios consumer: % $VDT_LOCATION/osg-rsv/setup/configure_osg_rsv -- verbose --consumers --setup-rsv-nagios • Restart osg-rsv: % vdt-control –off osg-rsv % vdt-control –on osg-rsv March 2, 08
CHECKPOINT � • Is the nagios-consumer process running? % ps –Afwww | grep nagios- consumer March 2, 08
Configure Nagios � • Create a Nagios contact and contact group by editing /etc/nagios/objects/contacts.cfg and adding: define contact{ contact_name sarah use generic-contact alias Sarah Wililams email saewill@iupui.edu can_submit_commands 1 } define contact{ contact_name nagios use generic-contact can_submit_commands 1 } define contactgroup{ contactgroup_name rsv-admins alias RSV Administrators members sarah,nagios } March 2, 08
Configure Nagios (cont.) � Create the file /etc/nagios/objects/service-groups.cfg and add: • define servicegroup{ servicegroup_name Critical_Services alias Critical Services } define servicegroup{ servicegroup_name RSV alias RSV Probe Results } • Edit /etc/nagios/nagios.cfg to add: cfg_file=/etc/nagios/objects/service-groups.cfg • Edit /etc/nagios/objects/commands.cfg to add: define command{ command_name check_dummy command_line $USER1$/check_dummy $ARG1$ $ARG2$ } March 2, 08
CHECKPOINT � • Do a Nagios pre-flight check for syntax errors: % nagios -v /etc/nagios/ nagios.cfg March 2, 08
Configure Nagios (cont.) � Make a work directory: • % mkdir /etc/nagios/rsv/ ; cd /etc/nagios/rsv/ Download rsv_config.pl and passive-template.cfg • % wget http://repo.mwt2.org/viewvc/rsv/nagios/rsv_config.pl % wget http://repo.mwt2.org/viewvc/rsv/nagios/passive- template.cfg % chmod u+x /etc/nagios/rsv/rsv_config.pl March 2, 08
Configure Nagios (cont.) � Edit passive-template.cfg to replace CONTACTGROUP with the • name of your contact group (rsv-admins) Generate the Nagios config file for rsv: • % /etc/nagios/rsv/rsv_config.pl >/etc/nagios/ rsv.cfg CHECKPOINT rsv_config.pl prints a list of hosts and services to the terminal. Were there any errors? March 2, 08
Configure Nagios (cont.) � Edit /etc/nagios/nagios.cfg to include the rsv.cfg file: • cfg_file=/etc/nagios/rsv.cfg • Adjust these file ownerships: chgrp apache /var/nagios/rw chgrp apache /var/nagios/rw/nagios.cmd chmod g+s /var/nagios/rw/ CHECKPOINT • Do a Nagios pre-flight check for syntax errors: % nagios -v /etc/nagios/nagios.cfg • Restart Nagios: % /etc/init.d/nagios restart • Check your webconsole. Ex: http://iut2-c082.iu.edu/nagios/ Can you see the hosts and services defined in RSV, labeled ‘PASV’ and state ‘PENDING’? March 2, 08
Final Checks � • Login to your RSV host and check $VDT_LOCATION/osg-rsv/logs/ consumers/nagios-consumer.log. Any errors? • Check your webconsole again. Are results coming in? org.osg.general.osg- version is one of the most frequent probes, so it should come up quickly. • Are you receiving emails? March 2, 08
Finished! � • Any questions? March 2, 08
Recommend
More recommend