"No Output" from plugin

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Fri Dec 31 09:58:27 CET 2004


Dear Sir,

I am writing to thank you for your letter and say,

On Thu, Dec 30, 2004 at 08:15:48PM -0800, nagios-users-request at lists.sourceforge.net wrote:

   ... lots of HTML and quoted printable deleted (please check your mail 
config and send text only)

> 
> Message: 10
> Date: Thu, 30 Dec 2004 14:14:55 -0700
> From: Lewis Getschel <lgetschel at denver.westerngeco.slb.com>
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] "No Output" from plugin
> 
> All-
> I'm running 1.2. It's worked great since I inherited it and have gotten 
> up-to-speed on Nagios. I have 1157 systems & 1378 services being monitored.

decent monitoring setup.

> I decided to write my own plugin to check the disk arrays we are 
> running on a number of systems. (I'm using snmpget and snmpwalk to 
> gather stats.)

Good move. The really _nice_ thing about Nagios is that plugins are so 
easy to write.

> 
> I wrote it in /bin/tcsh for various reasons, mostly because I works well 
> for me (and I don't know perl or c). The actual script doesn't matter 
> here, because Nagios will NOT  run anything that uses tcsh as far as I 
> can tell. It just returns (No Output!).
> 
> Here is the current plugin TEST script:
> #!/bin/tcsh  
> echo $0 >> /tmp/nagios_event_debug.txt
> echo $1 >> /tmp/nagios_event_debug.txt
> echo OK - tcsh
> exit 3
> 
> Nice and simple. When I run it as the nagios user from command line, it 
> runs fine and logs itself into the tmp file.

> When it is run as a plugin from the system, it only returns the No 
> Output!, and nothing is logged.
>

Ok. This is really an FAQ but 'No output!' means that when the Nagios 
process called the popen() (eg man 3 popen) library call to fork a new 
process and exec your shell script, Nagios could not read anything from 
the stream connected to the processes standard output.

Nagios can use any language that can call exit() and write to standard 
output. Under Linux/POSIX OS's I can't think of any language that rules 
out.

To find out why your plugin is not working you can 

1 Use a test Nagios (ie one in a sandbox, with a stripped config that 
does _not_ generate notifications) to run your plugin.

Build the test nag with its own prefix and enable one of the DEBUG 
options to configure. You want to run Nag in the foreground (no -d) so 
you can see the debug messages.

2 Wrap your plugin in a /bin/sh script that logs the parameters and 
actions to another stream.

You can find an example of doing this by searching Nag users on gmane (I 
know its there because I wrote it).
 
Prob time to submit an FAQ about this.

> If I change the script shell to #!/bin/sh instead, it DOES log itself 
> and returns the echo values just fine from both the command line and the 
> system.
> 
> 1) Can anyone figure a way to get it to run properly under tcsh. And 
> maybe explain why?



> or 2) Could someone confirm that this won't run on your system too,  (to 
> verify my sanity) [on this point at least <smile>]
>

Your plugin works on this (FreeBSD) system

Fri Dec 31 19:53:32 SERVICE ALERT: test;Plugin under test - 
dev/debug;UNKNOWN;SOFT;2;OK - tcsh

tsitc# more /tmp/nagios_event_debug.txt 
/usr/local/nagios/libexec/check_test

/usr/local/nagios/libexec/check_test



 
> Thanks for any help
> Lewis
> 
>

Good luck.

I can't guess what could be going wrong but its nothing to do with your 
plugin lang.

Yours sincerely.
 

-- 
Stanley Hopcroft

IP Australia
Ph: (02) 6283 3189  Fax: (02) 6281 1353
PO Box 200 Woden  ACT 2606
http://www.ipaustralia.gov.au
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: disclaimer.txt
URL: <https://www.monitoring-lists.org/archive/users/attachments/20041231/a4cb94aa/attachment.txt>


More information about the Users mailing list