What is wrong with my plugin N

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pcouderc
Posts: 1
Joined: Tue Mar 05, 2019 3:36 am

What is wrong with my plugin N

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: What is wrong with my plugin N

Post 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);
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked