program.sh is working for me.
Anything else doesn't, no errors. I have tried this exhaustively. I think I'll just give up cause its driving me nuts.
The actual scripts I wrote are much longer. It didn't work for them, and when I narrowed it down this was the main problem.
---------- Post updated at 09:21 AM ---------- Previous update was at 08:34 AM ----------
Okay, so my fault here I over simplified my example in OP.
This is more of what I'm doing which for the line previous to the send_nsca binary program is not working:
in shell:
echo "host,log,0,message" | program_below.sh
program:
while read -r line; do
STRING=$line
echo $STRING > /usr/local/nagios/syslog/debug #and I see no output in debug file
echo $STRING | /usr/local/nagios/libexec/send_nsca -H 192.168.93.55 -d ',' -c /usr/local/nagios/etc/send_nsca.cfg #this works
done
HELP!!! LOL
---------- Post updated at 10:27 AM ---------- Previous update was at 09:21 AM ----------
These are all working, my bad, but for some reason they didn't before.
Solved the problem.
I am using syslog-ng program() as a destination for a log.
Apparently, the problem has to do with the absolute path in the script. I'm guessing if calling with program() it leaves the directory that script is called from, so the absolute path is necessary. Either way, it works now to:
absolute_path/debug.log
Thanks for the response, hours upon hours again wasted for nothing, I will ALWAYS freaken add an absolute path to every line of every script from now on. Lesson learned.