Page 1 of 1

What is wrong with my plugin N

Posted: Sat Mar 09, 2019 1:43 pm
by pcouderc
Here is a working pluging called by NRPE ;

Code: Select all

#!/bin/bash
    echo "CRITICAL-pc "
    exit 1
It works either on the client either on the nagios server.

Here is a non working plugin:

Code: Select all

#!/usr/bin/perl
#
print STDERR "CRITICAL-pc\n ";
exit(1);
This works fine on the client but on the server, it gives me back : NRPE: Unable to read output

Everything is identical : same directory , owner and rights : -rwxrwxrwx

What do I miss ?

Thanks for any idea.

Re: What is wrong with my plugin N

Posted: Mon Mar 11, 2019 7:19 am
by scottwilkerson
You need to print to STDOUT, change to this

Code: Select all

#!/usr/bin/perl
#
print STDOUT "CRITICAL-pc\n ";
exit(1);
Also, just as an FYI, the exit code for CRITICAL should be 2 not 1, 1 is WARNING, so

Code: Select all

#!/usr/bin/perl
#
print STDOUT "CRITICAL-pc\n ";
exit(2);