13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 ■ MONITORING AND UPDATING# this command runs a program $ARG1$ with one argument, $ARG2$, passed to $ARG1$define command {command_name check_nrpecommand_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ ARG1$ -a $ARG2$}# this command runs a program $ARG1$ without any argument passed in to itdefine command {}command_namecommand_linecheck_nrpe_1arg/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ ARG1$Edit /etc/nagios/conf.d/services_nagios3.cfg on the monitored machine (cepheus in thisexample) to add the services you want to monitor:# SMTP doesn't need any arguments passed into the check_smtp# program, so we use check_nrpe_1argdefine service {service_description SMTPusegeneric-servicehostgroup_namenrpecheck_commandcheck_nrpe_1arg!check_smtp}define service {service_descriptionusehostgroup_namecheck_command}LOADgeneric-servicenrpecheck_nrpe_1arg!check_load# check_disk takes an argument, /, so we use check_nrpedefine service {service_description DISKusegeneric-servicehostgroup_namenrpecheck_commandcheck_nrpe!check_disk!/}■ Note This requires an nrpe hostgroup to be set up on the server.Commands that take only one argument—the service to check—use the check_nrpe_1arg command(see /etc/nagios-plugins/config/check_nrpe.cfg).If you want to give further arguments to commands, you need to edit /etc/nagios/nrpe.cfg on theclient machine so that the dont_blame_nrpe keyword has the value 1. Then use the check_nrpe command.In the previous code, I use it to pass the disk mount point to be checked.74Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!