Re: Yey Another "NRPE: Unable to read output"
Andrei-Florian Staicu <[email protected]> Sun, 10 Mar 2019 20:24:33 +0200
| Newsgroups | gmane.network.nagios.plugins |
|---|---|
| Message-ID | <CANK4U2q7g6TY5i3vx7AkDkY3xi1to_CvfB+kt4Ur3=pqM=M9Ag__47008.7068317056$1552242302$gmane$org@mail.gmail.com> |
--0000000000004cb19a0583c19268 Content-Type: text/plain; charset="UTF-8" Why do you print to stderr in perl? https://nagios-plugins.org/doc/guidelines.html#PLUGOUTPUT On Sun, Mar 10, 2019 at 8:11 PM Pierre Couderc <pierre-ZaSpn73FS/[email protected]> wrote: > Having this message with a debian plugin, I have tried a minimum example > : plugin on the "client" in a /home/nagios : > > > nagios@server:/home/nagios$ ls -lh > total 8.0K > -rwxrwxrwx 1 nagios nagios 48 Mar 8 07:08 check_bash > -rwxrwxrwx 1 nagios nagios 73 Mar 10 09:26 check_pl > nagios@server:/home/nagios$ cat check_bash > #!/bin/bash > > echo "CRITICAL-pc " > exit 2 > nagios@server:/home/nagios$ cat check_pl > #!/usr/bin/perl > # > # > # > use strict; > print STDERR "CRITICAL-pc\n"; > exit(2); > nagios@server:/home/nagios$ ./check_pl > CRITICAL-pc > nagios@server:/home/nagios$ echo $? > 2 > nagios@server:/home/nagios$ ./check_bash > CRITICAL-pc > nagios@server:/home/nagios$ echo $? > 2 > > When executed on the nagios "server" : > > root@nagios:~# /usr/lib/nagios/plugins/check_nrpe -H 192.168.163.1 -c > check_bash > CRITICAL-pc > root@nagios:~# /usr/lib/nagios/plugins/check_nrpe -H 192.168.163.1 -c > check_pl > NRPE: Unable to read output > > What do I miss ....? > > Why perl (or python...) plugin does not work ? > > Thanks for any help > > PC > > > > -- Beware of programmers who carry screwdrivers! --0000000000004cb19a0583c19268 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">Why do you print to stderr in perl?<div><= a href=3D"https://nagios-plugins.org/doc/guidelines.html#PLUGOUTPUT">https:= //nagios-plugins.org/doc/guidelines.html#PLUGOUTPUT</a><br></div></div></di= v><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On S= un, Mar 10, 2019 at 8:11 PM Pierre Couderc <<a href=3D"mailto:pierre@cou= derc.eu">pierre-ZaSpn73FS/[email protected]</a>> wrote:<br></div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2= 04,204);padding-left:1ex">Having this message with a debian plugin, I have = tried a minimum example <br> : plugin on the "client" in a /home/nagios :<br> <br> <br> nagios@server:/home/nagios$ ls -lh<br> total 8.0K<br> -rwxrwxrwx 1 nagios nagios 48 Mar=C2=A0 8 07:08 check_bash<br> -rwxrwxrwx 1 nagios nagios 73 Mar 10 09:26 check_pl<br> nagios@server:/home/nagios$ cat check_bash<br> #!/bin/bash<br> <br> =C2=A0=C2=A0=C2=A0=C2=A0 echo "CRITICAL-pc "<br> =C2=A0=C2=A0=C2=A0=C2=A0 exit 2<br> nagios@server:/home/nagios$ cat check_pl<br> #!/usr/bin/perl<br> #<br> #<br> #<br> use strict;<br> print STDERR "CRITICAL-pc\n";<br> exit(2);<br> nagios@server:/home/nagios$ ./check_pl<br> CRITICAL-pc<br> nagios@server:/home/nagios$ echo $?<br> 2<br> nagios@server:/home/nagios$ ./check_bash<br> CRITICAL-pc<br> nagios@server:/home/nagios$ echo $?<br> 2<br> <br> When executed on the nagios "server" :<br> <br> root@nagios:~# /usr/lib/nagios/plugins/check_nrpe=C2=A0 -H 192.168.163.1 -c= <br> check_bash<br> CRITICAL-pc<br> root@nagios:~# /usr/lib/nagios/plugins/check_nrpe=C2=A0 -H 192.168.163.1 -c= <br> check_pl<br> NRPE: Unable to read output<br> <br> What do I miss ....?<br> <br> Why perl (or=C2=A0 python...) plugin does not work ?<br> <br> Thanks for any help<br> <br> PC<br> <br> <br> <br> </blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"= class=3D"gmail_signature">Beware of programmers who carry screwdrivers!</d= iv> --0000000000004cb19a0583c19268--