From: Tim D. <ti...@co...> - 2007-08-03 20:28:11
|
That cleared things up immensely. I have it working now. Thanks a bunch. -----Original Message----- From: pnp...@li... [mailto:pnp...@li...] On Behalf Of Miguel Angelo Rozsas Sent: Friday, August 03, 2007 11:33 AM Cc: pnp...@li... Subject: Re: [Pnp4nagios-users] Templates and check_nrpe To take advantage of PNP templates you need to change your check_command definition to something like this: For local checks (in services.cfg): check_command check_local_load!15,10,5!30,25,20 For remote checks (in services.cfg): check_command check_load #I don't like NRPE receiving arguments from remote host. and the definition of check_local_load and check_load: For local checks (in checkcommands.cfg) define command{ command_name check_local_load command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ } For remote checks (in checkcommands.cfg): define command{ command_name check_load command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_load } finally in remote machine (/etc/nagios/nrpe.cfg). Note the arguments are static here. I don't think nrpe receiving arbitrary arguments is a good idea. command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 The point here is to have a check_command in services.cfg named "check_load" which binds to check_load.php in PNP templates.dist directory. To bind check_local_load to check_load.php in PNP templates directory, crate a link from check_local_load.php to check_load.php: # ls -l check_local_load.php lrwxrwxrwx 1 root root 32 2007-07-18 10:44 check_local_load.php -> ../templates.dist/check_load.php # Them, does not matter if you calling check_local_load or check_load via nrpe. The output is the same and both are handled by ../templates.dist/check_load.php. Bottom line: Don't use check_nrpe in services.cfg. Map check_remote_whatever to check_nrpe in check_commands.cfg. Doing so, your check commands will match a template name in PNP templates.dist or templates dir. The same ideia applies to check_disk_whatever, like I explained in my previous post. I hope this can make the thinks more clear. Tim Donnelly wrote: > Thanks both for your quick responses. I have actually made some progress :) > > However I am a bit confused on two things. > > One is the syntax of this line: > > check_command check_nrpe!LOAD5!80%!90% > > What does the LOAD5!80%!90% mean? I assume the percentages are warning > levels and the graph will show when the load reached those marks? > > Look the definition of LOAD5 in the remote machine ! (grep -i load --color /etc/nagios/nrpe.cfg) In my check_load command the arguments are different. It expects a triplet for waring and critical values. /usr/lib/nagios/plugins/check_load -w 80% -c 90% Warning threshold must be float or float triplet! Usage:check_load -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15 > I am currently gathering perfdata for load, users, disk status and http > status via nrpe. I would like to have non-default templates applied to > these as well, if the etc/pnp/check_commands file for load is called > check_nrpe.cfg, how do I define a custom cfg for the disk status? > I think the best is to define nrpe in check_commands.cfg, not in services.cfg. > I am not sure that the above is clear so if I can do anything to clarify > please let me know. > Please, if there are any questions already, don't hesitate to ask. best regards, ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Pnp4nagios-users mailing list Pnp...@li... https://lists.sourceforge.net/lists/listinfo/pnp4nagios-users |