I’m trying to pass Nagios macro outputs to an external script for service data processing and I’m having problems. Here’s an excerpt from the nagios.debug file:
[1255636024.077307] [2048.1] [pid=23651] Processing: ‘/usr/local/nagios/libexec/proc_perf_data.sh “$SERVICEOUTPUT$” “$SERVICEPERFDATA$” “$HOSTNAME$” “$SERVICEDESC$”’
[1255636024.077329] [2048.1] [pid=23651] Done. Final output: ‘/usr/local/nagios/libexec/proc_perf_data.sh “RL_PWR OKAY : The RL Power is: -10” “-10” “sit-TACE” “RL Pwr”’
To me the above lines look okay. The Final output is passing four arguments (delimited by double quotes) to my script (which is what I want). In fact if I copy and paste the command directly in a terminal window (minus the single quotes) it works.
However when monitoring “ps -aux” command (running it over and over) I see this:
nagios 23996 0.0 0.0 5260 1368 ? S 15:47 0:00 /bin/ksh /usr/local/nagios/libexec/proc_perf_data.sh RL_PWR OKAY : The RL Power is: -10 -10 sit-TACE RL Pwr
See how the " (quotes) have been removed ? Now it looks like 12 args are passed to my script and of course if fails.
any ideas
thanks
Guy
PS:
Using Nagios 3.2 on Fedora 11