|
[ Return To FAQ Index | Search The FAQs ]
|
|
| Title: | Debugging plugins |
| FAQ ID: | F0162 |
| Submitted By: | Patrick LeBoutillier |
| Last Updated: | 05/15/2003 |
|
| Description: | How can I see what arguments are passed to a specific plugin? |
|
| Solution: |
Let's take check_http as an example.
One way to do this is to create a shell script in the libexec/ directory (say debug_check_http) that looks something like this:
#!/bin/sh
echo `date` >> /tmp/debug_check_http_plugin
echo $* /tmp/debug_check_http_plugin
/usr/local/nagios/libexec/check_http $*
Be sure to give the executable permission to your script.
Then go to the check command defintion you are interested in in checkcommands.cfg and place your script's name instead of the real plugin command:
define command {
command_name check_http
command_line $USER1$/debug_check_http -H $HOSTADDRESS$
}
Now reload Nagios. The next time that check command is used, inspect the /tmp/debug_check_http_plugin file and you will see the date and the arguments passed.
|
|
| Keywords: | plugin debug arguments |
|