Problem with nrpe



I tried to search if anyone else have had same kind of problem that I have. I made my own plugin that checks size of one file… everything works fine on local computer but with nrpe it won’t return any variables values.

plungin is basic shell script that echos values

echo “File OK - File size is $SIZE Mb”

this will return this: File OK - File size is Mb

does anyone have any ideas why variables values won’t be passed to nagios sever?

May by I have to write the plugin again using c/c++


Is NRPE returning variable values or arguments for any other checks on remote hosts that you’re making?


Yes, nrpe is working fine with nagios_plugins, but not with my own bash skripts.



if $# -ne 4 ]; then
$ECHO "Usage: $0 -w -c "
exit 127

SIZE=wc -c /var/spool/qmailscan/qmail-queue.log |cut -d ' ' -f1
MB_SIZE=expr $SIZE / 100000

   if  $MB_SIZE -gt $2 ];
                    if  $MB_SIZE -gt $4 ];
                            echo "FILE CRITICAL - Qmail file size $MB_SIZE MB"
                            echo "FILE WARNING - Qmail file size $MB_SIZE MB"

            echo "FILE OK - Qmail file size $MB_SIZE' MB"


that is the skript … it is not that complitate

Edited Sun Dec 18 2005, 05:57PM ]


Here are the macros that nagios understands.
You could define $USERn$ to be what you need in the resource.cfg file.


Thanks that helped :slight_smile: