Servicecheckoutput problem

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
krishna23
Posts: 2
Joined: Sun May 29, 2011 8:01 am

Servicecheckoutput problem

Post by krishna23 »

Can you help?

I've got a very simple script, something like

Code: Select all

#!/bin/bash
out=$( nmap google.com | grep / | sed '/Starting/d' | cut -f 1 -d '/' | sed ':a;N;$!ba;s/\n/,/g' )
printf "These ports are opened on google.com $out \n"

What is does is, that it shows opened ports on certain host. No warnings, no criticals, just info..

It's working perfectly on Nagios 3.2.3, centos 6.3 installed from old repository, look at "check_test"

Image

But it does not work on Nagios 3.4.1.:
Image


If I run the script as a root, it's working, if I run the script as a user nagios, it's also working, but if nagios runs this script itself, the "$out" variable is simply missing. The same situation is happening with my other easy bash scripts. What am I doing wrong?

Thanks a lot
Locked